отображение на всех типах стартовой

This commit is contained in:
Nastya 2025-10-21 22:58:23 +03:00
parent 1bb7ceb750
commit b8bd3c0b70
2 changed files with 52 additions and 8 deletions

@ -1,10 +1,14 @@
import { Box, Typography, useTheme } from "@mui/material";
import { Box, Typography, useTheme, SxProps, Theme } from "@mui/material";
import { useQuizStore } from "@stores/useQuizStore";
import moment from "moment";
import React from "react";
import { useTranslation } from "react-i18next";
export const OverTime = () => {
type OverTimeProps = {
sx?: SxProps<Theme>;
};
export const OverTime = ({ sx }: OverTimeProps) => {
const theme = useTheme();
const { settings } = useQuizStore();
const { t } = useTranslation();
@ -52,13 +56,13 @@ export const OverTime = () => {
return (
<Box
id="here"
sx={{
width: "225px",
backgroundColor: (theme.palette as any).paperBackground,
boxShadow: "1px 1px 4px 0px rgba(51, 54, 71, 0.29)",
borderRadius: "8px",
p: "10px",
...sx,
}}
>
<Typography

@ -99,6 +99,12 @@ export const StartPageViewPublication = () => {
<Box
sx={{
margin: settings.cfg.startpageType === "centered" ? "0 auto" : null,
display:
isMobile && settings.cfg.startpage.position === "center" && settings.cfg.startpageType === "expanded"
? "flex"
: "block",
flexDirection: "column",
alignItems: "center",
}}
>
<Box
@ -148,8 +154,9 @@ export const StartPageViewPublication = () => {
>
{settings.cfg.info.orgname}
</Typography>
<OverTime />
</Box>
{((settings.cfg.startpageType === "expanded" && settings.cfg.startpage.position !== "center") ||
(isMobile && settings.cfg.startpageType === "expanded")) && <OverTime />}
</Box>
);
@ -163,12 +170,12 @@ export const StartPageViewPublication = () => {
alignItems: "center",
gap: "7px",
textDecoration: "none",
marginLeft:
mr:
settings.cfg.startpageType === "expanded" &&
settings.cfg.startpage.position === "center" &&
!isTablet &&
!isMobile
? "61px"
? "27px"
: undefined,
}}
>
@ -359,6 +366,15 @@ export const StartPageViewPublication = () => {
: "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}
@ -489,8 +505,32 @@ export const StartPageViewPublication = () => {
{settings.cfg.info.law}
</Typography>
</Box>
{show_badge && PenaBadge}
здравствуй
<Box
sx={{
display: "flex",
flexDirection: "column",
gap: "16px",
alignItems: isMobile ? "center" : "end",
}}
>
{((!isMobile && settings.cfg.startpageType === "centered") ||
(!isMobile &&
settings.cfg.startpageType === "expanded" &&
settings.cfg.startpage.position === "center")) && (
<OverTime
sx={{
ml:
!isMobile &&
settings.cfg.startpageType === "expanded" &&
settings.cfg.startpage.position === "center"
? "91px"
: "0",
}}
/>
)}
{show_badge && PenaBadge}
</Box>
</Box>
</>
}