отображение на всех типах стартовой
This commit is contained in:
parent
1bb7ceb750
commit
b8bd3c0b70
@ -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 { useQuizStore } from "@stores/useQuizStore";
|
||||||
import moment from "moment";
|
import moment from "moment";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
export const OverTime = () => {
|
type OverTimeProps = {
|
||||||
|
sx?: SxProps<Theme>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const OverTime = ({ sx }: OverTimeProps) => {
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const { settings } = useQuizStore();
|
const { settings } = useQuizStore();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
@ -52,13 +56,13 @@ export const OverTime = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
id="here"
|
|
||||||
sx={{
|
sx={{
|
||||||
width: "225px",
|
width: "225px",
|
||||||
backgroundColor: (theme.palette as any).paperBackground,
|
backgroundColor: (theme.palette as any).paperBackground,
|
||||||
boxShadow: "1px 1px 4px 0px rgba(51, 54, 71, 0.29)",
|
boxShadow: "1px 1px 4px 0px rgba(51, 54, 71, 0.29)",
|
||||||
borderRadius: "8px",
|
borderRadius: "8px",
|
||||||
p: "10px",
|
p: "10px",
|
||||||
|
...sx,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Typography
|
<Typography
|
||||||
|
|||||||
@ -99,6 +99,12 @@ export const StartPageViewPublication = () => {
|
|||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
margin: settings.cfg.startpageType === "centered" ? "0 auto" : null,
|
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
|
<Box
|
||||||
@ -148,8 +154,9 @@ export const StartPageViewPublication = () => {
|
|||||||
>
|
>
|
||||||
{settings.cfg.info.orgname}
|
{settings.cfg.info.orgname}
|
||||||
</Typography>
|
</Typography>
|
||||||
<OverTime />
|
|
||||||
</Box>
|
</Box>
|
||||||
|
{((settings.cfg.startpageType === "expanded" && settings.cfg.startpage.position !== "center") ||
|
||||||
|
(isMobile && settings.cfg.startpageType === "expanded")) && <OverTime />}
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -163,12 +170,12 @@ export const StartPageViewPublication = () => {
|
|||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
gap: "7px",
|
gap: "7px",
|
||||||
textDecoration: "none",
|
textDecoration: "none",
|
||||||
marginLeft:
|
mr:
|
||||||
settings.cfg.startpageType === "expanded" &&
|
settings.cfg.startpageType === "expanded" &&
|
||||||
settings.cfg.startpage.position === "center" &&
|
settings.cfg.startpage.position === "center" &&
|
||||||
!isTablet &&
|
!isTablet &&
|
||||||
!isMobile
|
!isMobile
|
||||||
? "61px"
|
? "27px"
|
||||||
: undefined,
|
: undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -359,6 +366,15 @@ export const StartPageViewPublication = () => {
|
|||||||
: "0",
|
: "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 && (
|
{settings.cfg.info.site && (
|
||||||
<ButtonBase
|
<ButtonBase
|
||||||
onClick={onSiteClick}
|
onClick={onSiteClick}
|
||||||
@ -489,8 +505,32 @@ export const StartPageViewPublication = () => {
|
|||||||
{settings.cfg.info.law}
|
{settings.cfg.info.law}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</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>
|
</Box>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user