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

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