diff --git a/lib/components/ViewPublicationPage/StartPageViewPublication/StartPageDesktop.tsx b/lib/components/ViewPublicationPage/StartPageViewPublication/StartPageDesktop.tsx index 317a73f..332340e 100644 --- a/lib/components/ViewPublicationPage/StartPageViewPublication/StartPageDesktop.tsx +++ b/lib/components/ViewPublicationPage/StartPageViewPublication/StartPageDesktop.tsx @@ -23,14 +23,14 @@ type StartPageDesktopProps = { type LayoutProps = Omit; const StandartLayout = ({ - alignType, - quizHeaderBlock, - quizMainBlock, - backgroundBlock, -}: LayoutProps) => { + alignType, + quizHeaderBlock, + quizMainBlock, + backgroundBlock, + }: LayoutProps) => { const size = useRootContainerSize(); const isTablet = size >= 700 && size < 1100; - const { settings } = useQuizData(); + const {settings} = useQuizData(); return ( - {quizHeaderBlock} - {quizMainBlock} - - {settings.cfg.startpage.background.desktop && ( - img": { width: "100%", borderRadius: "12px" }, + flexDirection: "column", + justifyContent: "space-between", + alignItems: "flex-start", + p: isTablet ? "25px" : alignType === 'left' ? "25px 25px 25px 35px" : "25px 35px 25px 25px", + overflowY: "auto", + scrollbarWidth: "none", + "&::-webkit-scrollbar": { + width: 0, + }, }} - >{backgroundBlock} - )} + > + {quizHeaderBlock} + {quizMainBlock} + + {settings.cfg.startpage.background.desktop && ( + img": {width: "100%", borderRadius: "12px"}, + }} + >{backgroundBlock} + )} + ); }; const ExpandedLayout = ({ - alignType, - quizHeaderBlock, - quizMainBlock, - backgroundBlock, -}: LayoutProps) => { + alignType, + quizHeaderBlock, + quizMainBlock, + backgroundBlock, + }: LayoutProps) => { const size = useRootContainerSize(); const isTablet = size >= 700 && size < 1100; return ( @@ -171,12 +182,12 @@ const ExpandedLayout = ({ } const CenteredLayout = ({ - quizHeaderBlock, - quizMainBlock, - backgroundBlock, -}: LayoutProps) => { + quizHeaderBlock, + quizMainBlock, + backgroundBlock, + }: LayoutProps) => { const isTablet = useRootContainerSize() < 1100; - const { settings } = useQuizData(); + const {settings} = useQuizData(); return ( img": { width: "100%", borderRadius: "12px" }, + "& > img": {width: "100%", borderRadius: "12px"}, }} > {backgroundBlock} @@ -219,12 +229,12 @@ const CenteredLayout = ({ }; export const StartPageDesktop = ({ - quizHeaderBlock, - quizMainBlock, - backgroundBlock, - startpageType, - alignType, -}: StartPageDesktopProps) => { + quizHeaderBlock, + quizMainBlock, + backgroundBlock, + startpageType, + alignType, + }: StartPageDesktopProps) => { switch (startpageType) { case null: case "standard": { diff --git a/lib/components/ViewPublicationPage/StartPageViewPublication/StartPageMobile.tsx b/lib/components/ViewPublicationPage/StartPageViewPublication/StartPageMobile.tsx index 797bced..7b11f30 100644 --- a/lib/components/ViewPublicationPage/StartPageViewPublication/StartPageMobile.tsx +++ b/lib/components/ViewPublicationPage/StartPageViewPublication/StartPageMobile.tsx @@ -9,171 +9,174 @@ import type {QuizStartpageType} from "@model/settingsData"; import {DESIGN_LIST} from "@/utils/designList"; type StartPageMobileProps = { - quizHeaderBlock: JSX.Element; - quizMainBlock: JSX.Element; - backgroundBlock: JSX.Element | null; - startpageType: QuizStartpageType; + quizHeaderBlock: JSX.Element; + quizMainBlock: JSX.Element; + backgroundBlock: JSX.Element | null; + startpageType: QuizStartpageType; }; type MobileLayoutProps = Omit; const StandartMobileLayout = ({ - quizHeaderBlock, - quizMainBlock, - backgroundBlock, -}: MobileLayoutProps) => { - const { settings } = useQuizData(); + quizHeaderBlock, + quizMainBlock, + backgroundBlock, + }: MobileLayoutProps) => { + const {settings} = useQuizData(); - return ( - - - - {quizHeaderBlock} - - {settings.cfg.startpage.background.desktop && ( - - img": { width: "100%", borderRadius: "12px" }, - }} - > - {backgroundBlock} - - - )} + return ( - {quizMainBlock} + + + {quizHeaderBlock} + + {settings.cfg.startpage.background.desktop && ( + + img": { + width: "100%", + borderRadius: "12px" + }, + }} + > + {backgroundBlock} + + + )} + + {quizMainBlock} + + - - - ); + ); }; const ExpandedMobileLayout = ({ - quizHeaderBlock, - quizMainBlock, - backgroundBlock, -}: MobileLayoutProps) => ( - + quizHeaderBlock, + quizMainBlock, + backgroundBlock, + }: MobileLayoutProps) => ( - - {quizHeaderBlock} - {quizMainBlock} - - - img": { - display: "block", - minHeight: "100%", - }, - }} > - {backgroundBlock} + + + {quizHeaderBlock} + {quizMainBlock} + + + img": { + display: "block", + minHeight: "100%", + }, + }} + > + {backgroundBlock} + - ); const CenteredMobileLayout = ({ - quizHeaderBlock, - quizMainBlock, - backgroundBlock, -}: MobileLayoutProps) => { + quizHeaderBlock, + quizMainBlock, + backgroundBlock, + }: MobileLayoutProps) => { const {settings} = useQuizData(); return ( @@ -211,11 +213,11 @@ const CenteredMobileLayout = ({ {quizHeaderBlock} {settings.cfg.startpage.background.desktop && ( img": {width: "100%", borderRadius: "12px"}, - }} + sx={{ + width: "100%", + overflow: "hidden", + "& > img": {width: "100%", borderRadius: "12px"}, + }} > {backgroundBlock} @@ -238,44 +240,44 @@ const CenteredMobileLayout = ({ } export const StartPageMobile = ({ - quizHeaderBlock, - quizMainBlock, - backgroundBlock, - startpageType, -}: StartPageMobileProps) => { - switch (startpageType) { - case null: - case "standard": { - return ( - - ); - } + quizHeaderBlock, + quizMainBlock, + backgroundBlock, + startpageType, + }: StartPageMobileProps) => { + switch (startpageType) { + case null: + case "standard": { + return ( + + ); + } - case "expanded": { - return ( - - ); - } + case "expanded": { + return ( + + ); + } - case "centered": { - return ( - - ); - } + case "centered": { + return ( + + ); + } - default: - notReachable(startpageType); - } + default: + notReachable(startpageType); + } };