fix: sandart layout background
This commit is contained in:
parent
211754fd9d
commit
eb6c0fbd26
@ -1,8 +1,11 @@
|
|||||||
import { Box } from "@mui/material";
|
import { Box } from "@mui/material";
|
||||||
|
|
||||||
import { useRootContainerSize } from "@contexts/RootContainerWidthContext";
|
import { useRootContainerSize } from "@contexts/RootContainerWidthContext";
|
||||||
|
import { useQuizData } from "@contexts/QuizDataContext";
|
||||||
|
|
||||||
import { notReachable } from "@utils/notReachable";
|
import { notReachable } from "@utils/notReachable";
|
||||||
|
import { quizThemes } from "@utils/themes/Publication/themePublication";
|
||||||
|
import { DESIGN_LIST } from "@/components/ViewPublicationPage/Question";
|
||||||
|
|
||||||
import type {
|
import type {
|
||||||
QuizStartpageAlignType,
|
QuizStartpageAlignType,
|
||||||
@ -24,16 +27,21 @@ const StandartLayout = ({
|
|||||||
quizHeaderBlock,
|
quizHeaderBlock,
|
||||||
quizMainBlock,
|
quizMainBlock,
|
||||||
backgroundBlock,
|
backgroundBlock,
|
||||||
}: LayoutProps) => (
|
}: LayoutProps) => {
|
||||||
|
const { settings } = useQuizData();
|
||||||
|
|
||||||
|
return (
|
||||||
<Box
|
<Box
|
||||||
id="pain"
|
id="pain"
|
||||||
sx={{
|
sx={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
flexDirection: alignType === "left" ? "row" : "row-reverse",
|
flexDirection: alignType === "left" ? "row" : "row-reverse",
|
||||||
flexGrow: 1,
|
|
||||||
minHeight: "100vh",
|
minHeight: "100vh",
|
||||||
"&::-webkit-scrollbar": { width: 0 },
|
backgroundPosition: "center",
|
||||||
overflow: "auto",
|
backgroundSize: "cover",
|
||||||
|
backgroundImage: settings.cfg.design
|
||||||
|
? `url(${DESIGN_LIST[settings.cfg.theme]})`
|
||||||
|
: null,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
@ -44,15 +52,21 @@ const StandartLayout = ({
|
|||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
alignItems: "flex-start",
|
alignItems: "flex-start",
|
||||||
p: "25px",
|
p: "25px",
|
||||||
|
background:
|
||||||
|
settings.cfg.design && !quizThemes[settings.cfg.theme].isLight
|
||||||
|
? "linear-gradient(90deg,#272626,transparent)"
|
||||||
|
: null,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{quizHeaderBlock}
|
{quizHeaderBlock}
|
||||||
{quizMainBlock}
|
{quizMainBlock}
|
||||||
</Box>
|
</Box>
|
||||||
|
{settings.cfg.startpage.background.desktop && (
|
||||||
<Box sx={{ width: "60%", overflow: "hidden" }}>{backgroundBlock}</Box>
|
<Box sx={{ width: "60%", overflow: "hidden" }}>{backgroundBlock}</Box>
|
||||||
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const ExpandedLayout = ({
|
const ExpandedLayout = ({
|
||||||
alignType,
|
alignType,
|
||||||
|
@ -1,6 +1,10 @@
|
|||||||
import { Box } from "@mui/material";
|
import { Box } from "@mui/material";
|
||||||
|
|
||||||
|
import { useQuizData } from "@contexts/QuizDataContext";
|
||||||
|
|
||||||
import { notReachable } from "@utils/notReachable";
|
import { notReachable } from "@utils/notReachable";
|
||||||
|
import { quizThemes } from "@utils/themes/Publication/themePublication";
|
||||||
|
import { DESIGN_LIST } from "@/components/ViewPublicationPage/Question";
|
||||||
|
|
||||||
import type { QuizStartpageType } from "@model/settingsData";
|
import type { QuizStartpageType } from "@model/settingsData";
|
||||||
|
|
||||||
@ -17,7 +21,10 @@ const StandartMobileLayout = ({
|
|||||||
quizHeaderBlock,
|
quizHeaderBlock,
|
||||||
quizMainBlock,
|
quizMainBlock,
|
||||||
backgroundBlock,
|
backgroundBlock,
|
||||||
}: MobileLayoutProps) => (
|
}: MobileLayoutProps) => {
|
||||||
|
const { settings } = useQuizData();
|
||||||
|
|
||||||
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: "flex",
|
display: "flex",
|
||||||
@ -27,6 +34,11 @@ const StandartMobileLayout = ({
|
|||||||
minHeight: "100vh",
|
minHeight: "100vh",
|
||||||
height: "100%",
|
height: "100%",
|
||||||
"&::-webkit-scrollbar": { width: 0 },
|
"&::-webkit-scrollbar": { width: 0 },
|
||||||
|
backgroundPosition: "center",
|
||||||
|
backgroundSize: "cover",
|
||||||
|
backgroundImage: settings.cfg.design
|
||||||
|
? `url(${DESIGN_LIST[settings.cfg.theme]})`
|
||||||
|
: null,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Box
|
<Box
|
||||||
@ -41,6 +53,10 @@ const StandartMobileLayout = ({
|
|||||||
height: "100%",
|
height: "100%",
|
||||||
overflowY: "auto",
|
overflowY: "auto",
|
||||||
overflowX: "hidden",
|
overflowX: "hidden",
|
||||||
|
background:
|
||||||
|
settings.cfg.design && !quizThemes[settings.cfg.theme].isLight
|
||||||
|
? "linear-gradient(90deg,#272626,transparent)"
|
||||||
|
: null,
|
||||||
"&::-webkit-scrollbar": {
|
"&::-webkit-scrollbar": {
|
||||||
width: "4px",
|
width: "4px",
|
||||||
},
|
},
|
||||||
@ -63,16 +79,12 @@ const StandartMobileLayout = ({
|
|||||||
{quizMainBlock}
|
{quizMainBlock}
|
||||||
</Box>
|
</Box>
|
||||||
</Box>
|
</Box>
|
||||||
<Box
|
{settings.cfg.startpage.background.desktop && (
|
||||||
sx={{
|
<Box sx={{ width: "100%", overflow: "hidden" }}>{backgroundBlock}</Box>
|
||||||
width: "100%",
|
)}
|
||||||
overflow: "hidden",
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{backgroundBlock}
|
|
||||||
</Box>
|
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
};
|
||||||
|
|
||||||
const ExpandedMobileLayout = ({
|
const ExpandedMobileLayout = ({
|
||||||
quizHeaderBlock,
|
quizHeaderBlock,
|
||||||
|
@ -20,6 +20,9 @@
|
|||||||
"strict": true,
|
"strict": true,
|
||||||
"noFallthroughCasesInSwitch": true,
|
"noFallthroughCasesInSwitch": true,
|
||||||
"paths": {
|
"paths": {
|
||||||
|
"@/*": [
|
||||||
|
"./lib/*"
|
||||||
|
],
|
||||||
"@ui_kit/*": [
|
"@ui_kit/*": [
|
||||||
"./lib/ui_kit/*"
|
"./lib/ui_kit/*"
|
||||||
],
|
],
|
||||||
|
@ -3,6 +3,7 @@ import { resolve } from "path";
|
|||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
|
|
||||||
export const alias = {
|
export const alias = {
|
||||||
|
"@": resolve(__dirname, "./lib/"),
|
||||||
"@ui_kit": resolve(__dirname, "./lib/ui_kit"),
|
"@ui_kit": resolve(__dirname, "./lib/ui_kit"),
|
||||||
"@icons": resolve(__dirname, "./lib/assets/icons"),
|
"@icons": resolve(__dirname, "./lib/assets/icons"),
|
||||||
"@stores": resolve(__dirname, "./lib/stores"),
|
"@stores": resolve(__dirname, "./lib/stores"),
|
||||||
|
Loading…
Reference in New Issue
Block a user