fix visual overtime

This commit is contained in:
Nastya 2025-10-28 01:02:25 +03:00
parent f2ac428bcb
commit 872fd8ad72
2 changed files with 28 additions and 14 deletions

@ -171,6 +171,10 @@ const ExpandedLayout = ({ alignType, quizHeaderBlock, quizMainBlock, backgroundB
const CenteredLayout = ({ quizHeaderBlock, quizMainBlock, backgroundBlock }: LayoutProps) => {
const isTablet = useRootContainerSize() < 1100;
const { settings } = useQuizStore();
// Проверяем наличие overTime
const overTimeConfig = settings?.cfg?.overTime;
const isOverTimeEnabled = overTimeConfig?.enabled;
return (
<Box
sx={{
@ -201,7 +205,7 @@ const CenteredLayout = ({ quizHeaderBlock, quizMainBlock, backgroundBlock }: Lay
sx={{
width: "100%",
maxWidth: "844px",
height: isTablet ? "530px" : "306px",
maxHeight: isTablet ? (isOverTimeEnabled ? "400px" : "530px") : "306px",
display: "flex",
justifyContent: "center",
"& > img": { width: "100%", borderRadius: "12px" },

@ -159,6 +159,8 @@ export const StartPageViewPublication = () => {
</Box>
{((settings.cfg.startpageType === "expanded" && settings.cfg.startpage.position !== "center") ||
(isMobile && settings.cfg.startpageType === "expanded")) && <OverTime />}
{settings.cfg.startpageType === "standard" && !isMobile && <OverTime />}
</Box>
);
@ -231,9 +233,19 @@ export const StartPageViewPublication = () => {
: theme.palette.background.default,
color: settings.cfg.startpageType === "expanded" ? "white" : "black",
position: "relative",
}}
onClick={(event) => event.preventDefault()}
>
{!isMobile && settings.cfg.startpageType === "expanded" && settings.cfg.startpage.position === "center" && (
<OverTime
sx={{
position: "absolute",
right: "20px",
top: "20px",
}}
/>
)}
<QuizPreviewLayoutByType
quizHeaderBlock={quizHeaderBlock}
quizMainBlock={
@ -342,6 +354,7 @@ export const StartPageViewPublication = () => {
? "wrap-reverse"
: "nowrap"
: "wrap",
marginTop: settings.cfg.startpageType === "standard" && isMobile ? "15px" : "0",
}}
>
{settings.cfg.startpageType === "expanded" &&
@ -367,15 +380,15 @@ export const StartPageViewPublication = () => {
justifySelf: "end",
}}
>
{((isMobile && settings.cfg.startpageType === "centered") ||
settings.cfg.startpageType === "standard") && (
<OverTime
sx={{
m: isMobile && settings.cfg.startpageType === "centered" ? "54px 0 20px" : "0",
ml: settings.cfg.startpageType === "standard" && !isMobile ? "100%" : "0",
}}
/>
)}
{isMobile &&
(settings.cfg.startpageType === "centered" || settings.cfg.startpageType === "standard") && (
<OverTime
sx={{
m: isMobile && settings.cfg.startpageType === "centered" ? "54px 0 20px" : "0",
ml: settings.cfg.startpageType === "standard" && !isMobile ? "100%" : "0",
}}
/>
)}
{settings.cfg.info.site && (
<ButtonBase
onClick={onSiteClick}
@ -519,10 +532,7 @@ export const StartPageViewPublication = () => {
: "end",
}}
>
{((!isMobile && settings.cfg.startpageType === "centered") ||
(!isMobile &&
settings.cfg.startpageType === "expanded" &&
settings.cfg.startpage.position === "center")) && <OverTime />}
{!isMobile && settings.cfg.startpageType === "centered" && <OverTime />}
{show_badge && PenaBadge}
</Box>