some edit parseerror crutch design theme
This commit is contained in:
parent
05ffc45c18
commit
ff57344ee7
@ -7,7 +7,7 @@
|
|||||||
"@emotion/react": "^11.10.5",
|
"@emotion/react": "^11.10.5",
|
||||||
"@emotion/styled": "^11.10.5",
|
"@emotion/styled": "^11.10.5",
|
||||||
"@frontend/kitui": "^1.0.86",
|
"@frontend/kitui": "^1.0.86",
|
||||||
"@frontend/squzanswerer": "^1.0.60",
|
"@frontend/squzanswerer": "^1.0.61",
|
||||||
"@mui/icons-material": "^5.10.14",
|
"@mui/icons-material": "^5.10.14",
|
||||||
"@mui/material": "^5.10.14",
|
"@mui/material": "^5.10.14",
|
||||||
"@mui/x-charts": "^6.19.5",
|
"@mui/x-charts": "^6.19.5",
|
||||||
|
@ -99,7 +99,10 @@ export const DesignFilling = ({
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const isMobile = useMediaQuery(theme.breakpoints.down(830));
|
const isMobile = useMediaQuery(theme.breakpoints.down(830));
|
||||||
const heightBar = heightSidebar + 51 + 88 + 36;
|
const heightBar = heightSidebar + 51 + 88 + 36;
|
||||||
|
|
||||||
|
const CONST_QUIZ_THEME = quiz?.config.theme !== undefined && quiz?.config.theme === "crutch_FurnitureABC" ? "" : quiz?.config.theme || "";
|
||||||
|
console.log("CONST_QUIZ_THEME")
|
||||||
|
console.log(CONST_QUIZ_THEME)
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@ -144,7 +147,7 @@ export const DesignFilling = ({
|
|||||||
<Box sx={{ display: "flex", gap: "20px", flexWrap: "wrap" }}>
|
<Box sx={{ display: "flex", gap: "20px", flexWrap: "wrap" }}>
|
||||||
<DesignGroup
|
<DesignGroup
|
||||||
title="Со светлым фоном"
|
title="Со светлым фоном"
|
||||||
value={quiz?.config.design ? "" : quiz?.config.theme || ""}
|
value={CONST_QUIZ_THEME ? "" : quiz?.config.theme || ""}
|
||||||
list={LIGHT_THEME_BUTTONS}
|
list={LIGHT_THEME_BUTTONS}
|
||||||
onChange={(name) =>
|
onChange={(name) =>
|
||||||
updateQuiz(quiz?.id, (quiz) => {
|
updateQuiz(quiz?.id, (quiz) => {
|
||||||
@ -155,7 +158,7 @@ export const DesignFilling = ({
|
|||||||
/>
|
/>
|
||||||
<DesignGroup
|
<DesignGroup
|
||||||
title="С тёмным фоном"
|
title="С тёмным фоном"
|
||||||
value={quiz?.config.design ? "" : quiz?.config.theme || ""}
|
value={CONST_QUIZ_THEME ? "" : quiz?.config.theme || ""}
|
||||||
list={DARK_THEME_BUTTONS}
|
list={DARK_THEME_BUTTONS}
|
||||||
onChange={(name) =>
|
onChange={(name) =>
|
||||||
updateQuiz(quiz?.id, (quiz) => {
|
updateQuiz(quiz?.id, (quiz) => {
|
||||||
|
@ -55,8 +55,9 @@ export default function QuizPreview() {
|
|||||||
[isPreviewShown]
|
[isPreviewShown]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const CONST_QUIZ_THEME = quiz?.config.theme !== undefined && quiz?.config.theme === "crutch_FurnitureABC" ? "" : quiz?.config.theme || "";
|
||||||
return (
|
return (
|
||||||
<ThemeProvider theme={themesPublication?.[quiz?.config.theme || "StandardTheme"]}>
|
<ThemeProvider theme={themesPublication?.[CONST_QUIZ_THEME || "StandardTheme"]}>
|
||||||
<Box
|
<Box
|
||||||
ref={rndParentRef}
|
ref={rndParentRef}
|
||||||
data-cy="quiz-preview-container"
|
data-cy="quiz-preview-container"
|
||||||
|
@ -29,6 +29,7 @@ export default function QuizPreviewLayout() {
|
|||||||
navigator.clipboard.writeText(quiz.config.info.phonenumber);
|
navigator.clipboard.writeText(quiz.config.info.phonenumber);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const CONST_QUIZ_THEME = quiz?.config.theme !== undefined && quiz?.config.theme === "crutch_FurnitureABC" ? "" : quiz?.config.theme || "";
|
||||||
const background =
|
const background =
|
||||||
quiz.config.startpage.background.type === "image" ? (
|
quiz.config.startpage.background.type === "image" ? (
|
||||||
quiz.config.startpage.background.desktop ? (
|
quiz.config.startpage.background.desktop ? (
|
||||||
@ -219,7 +220,7 @@ export default function QuizPreviewLayout() {
|
|||||||
color:
|
color:
|
||||||
quiz.config.startpageType === "expanded"
|
quiz.config.startpageType === "expanded"
|
||||||
? "#FFFFFF"
|
? "#FFFFFF"
|
||||||
: mode[quiz?.config.theme || "StandardTheme"]
|
: mode[CONST_QUIZ_THEME || "StandardTheme"]
|
||||||
? "#151515"
|
? "#151515"
|
||||||
: "#FFFFFF",
|
: "#FFFFFF",
|
||||||
}}
|
}}
|
||||||
@ -230,7 +231,7 @@ export default function QuizPreviewLayout() {
|
|||||||
color:
|
color:
|
||||||
quiz.config.startpageType === "expanded"
|
quiz.config.startpageType === "expanded"
|
||||||
? "#F5F7FF"
|
? "#F5F7FF"
|
||||||
: mode[quiz?.config.theme || "StandardTheme"]
|
: mode[CONST_QUIZ_THEME || "StandardTheme"]
|
||||||
? "#4D4D4D"
|
? "#4D4D4D"
|
||||||
: "#F5F7FF",
|
: "#F5F7FF",
|
||||||
whiteSpace: "nowrap",
|
whiteSpace: "nowrap",
|
||||||
|
@ -66,9 +66,10 @@ export const StartPagePreview = () => {
|
|||||||
[isPreviewShown],
|
[isPreviewShown],
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const CONST_QUIZ_THEME = quiz?.config.theme !== undefined && quiz?.config.theme === "crutch_FurnitureABC" ? "" : quiz?.config.theme || "";
|
||||||
return (
|
return (
|
||||||
<ThemeProvider
|
<ThemeProvider
|
||||||
theme={themesPublication?.[quiz?.config.theme || "StandardTheme"]}
|
theme={themesPublication?.[CONST_QUIZ_THEME || "StandardTheme"]}
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
ref={rndParentRef}
|
ref={rndParentRef}
|
||||||
|
@ -38,7 +38,8 @@ export const parseAxiosError = (nativeError: unknown): [string, number?] => {
|
|||||||
const serverError = error.response.data as ServerError;
|
const serverError = error.response.data as ServerError;
|
||||||
let SEMessage;
|
let SEMessage;
|
||||||
|
|
||||||
if(error.response.status === 409) {
|
const status = error.response.status;
|
||||||
|
if(status === 409 || status === 401 || status === 404) {
|
||||||
const serverErrorMessage = error.response.data.message
|
const serverErrorMessage = error.response.data.message
|
||||||
const translatedMessage = translateMessage[serverErrorMessage.toLowerCase() || ""]
|
const translatedMessage = translateMessage[serverErrorMessage.toLowerCase() || ""]
|
||||||
return [translatedMessage || "", serverError.statusCode];
|
return [translatedMessage || "", serverError.statusCode];
|
||||||
|
@ -1521,10 +1521,10 @@
|
|||||||
immer "^10.0.2"
|
immer "^10.0.2"
|
||||||
reconnecting-eventsource "^1.6.2"
|
reconnecting-eventsource "^1.6.2"
|
||||||
|
|
||||||
"@frontend/squzanswerer@^1.0.60":
|
"@frontend/squzanswerer@^1.0.61":
|
||||||
version "1.0.60"
|
version "1.0.61"
|
||||||
resolved "https://penahub.gitlab.yandexcloud.net/api/v4/projects/43/packages/npm/@frontend/squzanswerer/-/@frontend/squzanswerer-1.0.60.tgz#b8609b5274d10123f7585b1731945b884fee71d4"
|
resolved "https://penahub.gitlab.yandexcloud.net/api/v4/projects/43/packages/npm/@frontend/squzanswerer/-/@frontend/squzanswerer-1.0.61.tgz#28d55161617d0b7846f41f74b5cb61bc7f710e7d"
|
||||||
integrity sha1-uGCbUnTRASP3WFsXMZRbiE/ucdQ=
|
integrity sha1-KNVRYWF9C3hG9B90tcthvH9xDn0=
|
||||||
dependencies:
|
dependencies:
|
||||||
bowser "1.9.4"
|
bowser "1.9.4"
|
||||||
country-flag-emoji-polyfill "^0.1.8"
|
country-flag-emoji-polyfill "^0.1.8"
|
||||||
|
Loading…
Reference in New Issue
Block a user