From d44396288e72b6bb29bb0857df365445d06f5f9f Mon Sep 17 00:00:00 2001 From: ArtChaos189 Date: Wed, 27 Dec 2023 22:13:46 +0300 Subject: [PATCH 01/10] =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20=D0=B2?= =?UTF-8?q?=D0=B5=D1=80=D1=82=D0=B8=D0=BA=D0=B0=D0=BB=D1=8C=D0=BD=D1=8B?= =?UTF-8?q?=D0=B9=20=D1=81=D0=BA=D1=80=D0=BE=D0=BB=D0=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/startPage/EditPage.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index 8a0bed52..defb826e 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -426,6 +426,7 @@ export default function EditPage() { fontSize: "14px", lineHeight: "18px", height: "34px", + whiteSpace: "nowrap", minWidth: "130px", }} onClick={() => @@ -440,9 +441,9 @@ export default function EditPage() { variant="contained" sx={{ fontSize: "14px", + whiteSpace: "nowrap", lineHeight: "18px", height: "34px", - minWidth: "130px", }} > Тестовый просмотр @@ -457,7 +458,8 @@ export default function EditPage() { fontSize: "14px", lineHeight: "18px", height: "34px", - background: quiz?.status === "start" ? "#7E2AEA" : "#FA5B0E", + background: quiz?.status === "stop" ? "#7E2AEA" : "#FA5B0E", + p: "0 18px", }} onClick={handleClickStatusQuiz} > @@ -473,6 +475,10 @@ export default function EditPage() { Date: Wed, 27 Dec 2023 23:27:12 +0300 Subject: [PATCH 02/10] =?UTF-8?q?=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BF=D0=B5=D1=80=D0=B5=D0=BA=D0=BB=D1=8E=D1=87=D0=B0?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C=20=D0=B2=D0=B5=D1=82=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/assets/icons/TreeStructure.tsx | 33 +++++ src/pages/startPage/EditPage.tsx | 188 ++++++++++++++++++++--------- 2 files changed, 164 insertions(+), 57 deletions(-) create mode 100644 src/assets/icons/TreeStructure.tsx diff --git a/src/assets/icons/TreeStructure.tsx b/src/assets/icons/TreeStructure.tsx new file mode 100644 index 00000000..282b22ad --- /dev/null +++ b/src/assets/icons/TreeStructure.tsx @@ -0,0 +1,33 @@ +export const TreeStructure = () => ( + + + + + + + +); diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index defb826e..30e497fb 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -59,6 +59,7 @@ import { deleteTimeoutedQuestions } from "@utils/deleteTimeoutedQuestions"; import { toggleQuizPreview } from "@root/quizPreview"; import { LinkSimple } from "@icons/LinkSimple"; import { BackButtonIcon } from "@icons/BackButtonIcon"; +import { TreeStructure } from "@icons/TreeStructure"; let init: () => void; export default function EditPage() { @@ -311,6 +312,7 @@ export default function EditPage() { {isMobile ? : } @@ -356,66 +358,138 @@ export default function EditPage() { background: "#FFF", }} > - {isConditionMet && ( - - - - Логика ветвления + > + } + checkedIcon={} + checked={openBranchingPage} + onChange={openBranchingPageHC} + sx={{ + width: 50, + height: 30, + padding: 0, + "& .MuiSwitch-switchBase": { + padding: 0, + margin: "2px", + width: "26px", + height: "26px", + background: "#fff", + transitionDuration: "300ms", + "&:hover": { + background: "#fff", // Цвет при ховере, замените на ваш желаемый + }, + "&:active": { + background: "#fff", // Цвет при активном состоянии, замените на ваш желаемый + }, + "&.Mui-checked": { + transform: "translateX(20px)", + color: theme.palette.brightPurple.main, + "& + .MuiSwitch-track": { + backgroundColor: "#7E2AEA", + opacity: 1, + border: 0, + }, + "&.Mui-disabled + .MuiSwitch-track": { opacity: 0.5 }, + }, + "&.Mui-disabled .MuiSwitch-thumb": { + color: theme.palette.mode === "light" ? theme.palette.grey[100] : theme.palette.grey[600], + }, + "&.Mui-disabled + .MuiSwitch-track": { + opacity: theme.palette.mode === "light" ? 0.7 : 0.3, + }, + }, + "& .MuiSwitch-thumb": { + boxSizing: "border-box", + width: 25, + height: 25, + }, + "& .MuiSwitch-track": { + backgroundColor: "rgba(217, 188, 255, 0.16)", + borderRadius: 13, + opacity: 1, + transition: theme.transitions.create(["background-color"], { + duration: 500, + }), + }, + }} + /> - - )} + ) : ( + + + + Логика ветвления + + + ))} {!canCreatePublic && quiz.config.type !== "form" ? ( From 759a8d458c5bedf4c5bd6ee964e7eef30254de69 Mon Sep 17 00:00:00 2001 From: ArtChaos189 Date: Wed, 27 Dec 2023 23:28:19 +0300 Subject: [PATCH 03/10] =?UTF-8?q?=D1=83=D0=B1=D1=80=D0=B0=D0=BB=20=D0=BB?= =?UTF-8?q?=D0=B8=D1=88=D0=BD=D0=B8=D0=B5=20=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5?= =?UTF-8?q?=D0=BD=D1=82=D0=B0=D1=80=D0=B8=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/startPage/EditPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index 30e497fb..7d1c0a2a 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -392,10 +392,10 @@ export default function EditPage() { background: "#fff", transitionDuration: "300ms", "&:hover": { - background: "#fff", // Цвет при ховере, замените на ваш желаемый + background: "#fff", }, "&:active": { - background: "#fff", // Цвет при активном состоянии, замените на ваш желаемый + background: "#fff", }, "&.Mui-checked": { transform: "translateX(20px)", From 6184f2893a90d7e2af3ff2c91b9368b92658fef2 Mon Sep 17 00:00:00 2001 From: ArtChaos189 Date: Wed, 27 Dec 2023 23:34:50 +0300 Subject: [PATCH 04/10] =?UTF-8?q?=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=86=D0=B2=D0=B5=D1=82=20=D0=BB=D0=BE=D0=B3=D0=BE?= =?UTF-8?q?=D1=82=D0=B8=D0=BF=D0=B0=20=D0=B2=20=D0=BC=D0=BE=D0=B1=D0=B8?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=BE=D0=B9=20=D0=B2=D0=B5=D1=80=D1=81=D0=B8?= =?UTF-8?q?=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/Landing/images/icons/QuizLogo.tsx | 21 ++++++++------------- src/pages/startPage/EditPage.tsx | 4 ++-- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/pages/Landing/images/icons/QuizLogo.tsx b/src/pages/Landing/images/icons/QuizLogo.tsx index 0c12503d..76ae536d 100644 --- a/src/pages/Landing/images/icons/QuizLogo.tsx +++ b/src/pages/Landing/images/icons/QuizLogo.tsx @@ -2,19 +2,14 @@ import { useTheme } from "@mui/material"; interface Props { width: number; + color?: string; } -export default function QuizLogo({ width }: Props) { +export default function QuizLogo({ width, color = "#151515" }: Props) { const theme = useTheme(); return ( - + diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index 7d1c0a2a..dfa2e031 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -105,6 +105,7 @@ export default function EditPage() { const quizConfig = quiz?.config; const disableTest = quiz === undefined ? true : quiz.config.type === null; const [openBranchingPage, setOpenBranchingPage] = useState(false); + const [buttonText, setButtonText] = useState("Опубликовать"); const openBranchingPageHC = () => { if (!openBranchingPage) { @@ -164,7 +165,6 @@ export default function EditPage() { const isConditionMet = [1].includes(currentStep) && !openBranchingPanel && quizConfig.type !== "form"; - const [buttonText, setButtonText] = useState("Опубликовать"); const handleClickStatusQuiz = () => { if (Object.keys(whyCantCreatePublic).length === 0) { if (buttonText === "Опубликовать") { @@ -204,7 +204,7 @@ export default function EditPage() { }} > - {isMobile ? : } + {isMobile ? : } Date: Wed, 27 Dec 2023 23:37:58 +0300 Subject: [PATCH 05/10] =?UTF-8?q?=D0=BF=D0=BE=D1=84=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=B2=D1=8B=D1=81=D0=BE=D1=82=D1=83=20=D0=BA?= =?UTF-8?q?=D0=BE=D0=BD=D1=82=D0=B5=D0=BD=D1=82=D0=B0=20,=20=D1=87=D1=82?= =?UTF-8?q?=D0=BE=D0=B1=D1=8B=20=D0=BD=D0=B5=D0=B1=D1=8B=D0=BB=D0=BE=20?= =?UTF-8?q?=D1=81=D0=BA=D1=80=D0=BE=D0=BB=D0=BB=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/startPage/EditPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index dfa2e031..09e61868 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -327,7 +327,7 @@ export default function EditPage() { sx={{ padding: isMobile ? "16px 16px 20px 16px" : "25px 25px 20px 25px", overflow: "auto", - height: isMobile ? ` calc(100vh - 125px) ` : `calc(100vh - ${isConditionMet ? "186px" : "166px"})`, + height: isMobile ? ` calc(100vh - 125px) ` : `calc(100vh - ${isConditionMet ? "199px" : "166px"})`, boxSizing: "border-box", }} > From 13c09684ba27dd5d6122d03a0fcdf0f5aef59f87 Mon Sep 17 00:00:00 2001 From: ArtChaos189 Date: Thu, 28 Dec 2023 00:17:39 +0300 Subject: [PATCH 06/10] =?UTF-8?q?=D0=BF=D0=BE=D1=84=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B8=D0=B6=D0=BD=D0=B5=D0=B3=D0=BE?= =?UTF-8?q?=20=D0=BC=D0=B5=D0=BD=D1=8E=20=D0=B2=20=D0=A1=D1=82=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=86=D0=B5=20=D0=92=D0=BE=D0=BF=D1=80=D0=BE=D1=81?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/startPage/EditPage.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index 09e61868..8730273e 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -98,6 +98,7 @@ export default function EditPage() { const navigate = useNavigate(); const currentStep = useQuizStore((state) => state.currentStep); const isTablet = useMediaQuery(theme.breakpoints.down(1000)); + const isBranchingLogic = useMediaQuery(theme.breakpoints.down(1100)); const isMobile = useMediaQuery(theme.breakpoints.down(660)); const isMobileSm = useMediaQuery(theme.breakpoints.down(370)); const [mobileSidebar, setMobileSidebar] = useState(false); @@ -327,7 +328,13 @@ export default function EditPage() { sx={{ padding: isMobile ? "16px 16px 20px 16px" : "25px 25px 20px 25px", overflow: "auto", - height: isMobile ? ` calc(100vh - 125px) ` : `calc(100vh - ${isConditionMet ? "199px" : "166px"})`, + height: isMobile + ? `calc(100vh - 125px)` + : isConditionMet + ? isBranchingLogic + ? `calc(100vh - 166px)` + : `calc(100vh - 186px)` + : `calc(100vh - 166px)`, boxSizing: "border-box", }} > @@ -359,7 +366,7 @@ export default function EditPage() { }} > {isConditionMet && - (isMobile ? ( + (isBranchingLogic ? ( - Логика ветвления + + Логика ветвления + ))} @@ -549,7 +558,6 @@ export default function EditPage() { Date: Thu, 28 Dec 2023 00:23:44 +0300 Subject: [PATCH 07/10] =?UTF-8?q?=D0=BF=D0=BE=D1=87=D0=B8=D0=BD=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=82=D0=B5=D0=BA=D1=81=D1=82=20=D0=B2=20=D0=BA=D0=BD?= =?UTF-8?q?=D0=BE=D0=BF=D0=BA=D0=B5=20=D0=BE=D0=BF=D1=83=D0=B1=D0=BB=D0=B8?= =?UTF-8?q?=D0=BA=D0=BE=D0=B2=D0=B0=D1=82=D1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/startPage/EditPage.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index 8730273e..d3b789ed 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -106,7 +106,7 @@ export default function EditPage() { const quizConfig = quiz?.config; const disableTest = quiz === undefined ? true : quiz.config.type === null; const [openBranchingPage, setOpenBranchingPage] = useState(false); - const [buttonText, setButtonText] = useState("Опубликовать"); + const [buttonText, setButtonText] = useState(quiz?.status === "stop" ? "Опубликовать" : "Отозвать"); const openBranchingPageHC = () => { if (!openBranchingPage) { @@ -172,7 +172,7 @@ export default function EditPage() { setButtonText("Опубликовано"); setTimeout(() => { setButtonText("Отозвать"); - }, 3000); + }, 1500); } else { setButtonText("Опубликовать"); } From 42d563ac8fea5dd2243a7486d1e05261484a3432 Mon Sep 17 00:00:00 2001 From: ArtChaos189 Date: Thu, 28 Dec 2023 00:36:33 +0300 Subject: [PATCH 08/10] =?UTF-8?q?=D0=BF=D0=BE=D1=84=D0=B8=D0=BA=D1=81?= =?UTF-8?q?=D0=B8=D0=BB=20=D0=BE=D1=82=D0=BE=D0=B1=D1=80=D0=B0=D0=B6=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BD=D0=B8=D0=B6=D0=BD=D0=B5=D0=B3=D0=BE?= =?UTF-8?q?=20=D0=BC=D0=B5=D0=BD=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/startPage/EditPage.tsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index d3b789ed..15c94634 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -372,6 +372,7 @@ export default function EditPage() { width: "77px", height: "51px", position: "fixed", + zIndex: "99999", right: "0", top: "20%", background: "#333647", @@ -543,6 +544,7 @@ export default function EditPage() { height: "34px", background: quiz?.status === "stop" ? "#7E2AEA" : "#FA5B0E", p: "0 18px", + minWidth: "120px", }} onClick={handleClickStatusQuiz} > From c75c73bb3e895691aad31b93ef5107da36f19ca3 Mon Sep 17 00:00:00 2001 From: ArtChaos189 Date: Thu, 28 Dec 2023 00:41:35 +0300 Subject: [PATCH 09/10] style Switch --- src/pages/startPage/EditPage.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index 15c94634..ca361e6c 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -400,7 +400,7 @@ export default function EditPage() { background: "#fff", transitionDuration: "300ms", "&:hover": { - background: "#fff", + backgroundColor: "#fff !important", }, "&:active": { background: "#fff", From fecd4a7028334c691fead0a73c0c24869cc9181d Mon Sep 17 00:00:00 2001 From: ArtChaos189 Date: Thu, 28 Dec 2023 00:49:52 +0300 Subject: [PATCH 10/10] style --- src/pages/startPage/EditPage.tsx | 56 ++++++++++++++++++++++---------- 1 file changed, 39 insertions(+), 17 deletions(-) diff --git a/src/pages/startPage/EditPage.tsx b/src/pages/startPage/EditPage.tsx index ca361e6c..0199848c 100755 --- a/src/pages/startPage/EditPage.tsx +++ b/src/pages/startPage/EditPage.tsx @@ -100,6 +100,7 @@ export default function EditPage() { const isTablet = useMediaQuery(theme.breakpoints.down(1000)); const isBranchingLogic = useMediaQuery(theme.breakpoints.down(1100)); const isMobile = useMediaQuery(theme.breakpoints.down(660)); + const isLinkButton = useMediaQuery(theme.breakpoints.down(708)); const isMobileSm = useMediaQuery(theme.breakpoints.down(370)); const [mobileSidebar, setMobileSidebar] = useState(false); const [nextStep, setNextStep] = useState(0); @@ -556,23 +557,44 @@ export default function EditPage() { buttonText )} - {quiz?.status === "start" && ( - - https://hbpn.link/{quiz.qid} - - )} + {quiz?.status === "start" && + (!isLinkButton ? ( + + https://hbpn.link/{quiz.qid} + + ) : ( + + + + ))} {isMobile ? (