frontAnswerer/lib/components/ViewPublicationPage/ContactForm/ContactTextBlock/index.tsx

68 lines
2.0 KiB
TypeScript
Raw Normal View History

2024-05-31 16:41:18 +00:00
import { Box, Typography, useTheme } from "@mui/material";
import { useRootContainerSize } from "@contexts/RootContainerWidthContext.ts";
import { QuizSettingsConfig } from "@model/settingsData.ts";
import { FC } from "react";
2025-04-20 15:16:22 +00:00
import { useTranslation } from "react-i18next";
2024-05-07 15:25:44 +00:00
type ContactTextBlockProps = {
2024-05-31 16:41:18 +00:00
settings: QuizSettingsConfig;
};
2024-05-07 15:25:44 +00:00
2024-05-31 16:41:18 +00:00
export const ContactTextBlock: FC<ContactTextBlockProps> = ({ settings }) => {
const theme = useTheme();
const isMobile = useRootContainerSize() < 850;
const isTablet = useRootContainerSize() < 1000;
2025-04-20 15:16:22 +00:00
const { t } = useTranslation();
2024-05-31 16:41:18 +00:00
return (
<Box
sx={{
flexGrow: isMobile ? 0 : 1,
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
borderRight: isMobile ? undefined : "1px solid #9A9AAF80",
margin: isMobile ? 0 : "40px 0",
padding: isMobile ? "0" : "0 40px",
}}
>
<Box
sx={{
maxWidth: isMobile ? "100%" : isTablet ? "410px" : "630px",
display: "flex",
flexDirection: "column",
alignItems: "flex-start",
justifyContent: "center",
padding: isMobile ? "40px 20px 0 20px" : "0",
mt: isMobile ? 0 : isTablet ? "-180px" : "-47px",
}}
>
<Typography
sx={{
textAlign: isTablet ? undefined : "center",
fontSize: "24px",
lineHeight: "normal",
fontWeight: 501,
color: theme.palette.text.primary,
wordBreak: "break-word",
}}
>
2025-04-20 15:16:22 +00:00
{settings.cfg.formContact.title || t("Fill out the form to receive your test results")}
2024-05-31 16:41:18 +00:00
</Typography>
{settings.cfg.formContact.desc && (
<Typography
2024-05-07 15:25:44 +00:00
sx={{
2024-05-31 16:41:18 +00:00
color: theme.palette.text.primary,
m: "20px 0",
fontSize: "18px",
wordBreak: "break-word",
2024-05-07 15:25:44 +00:00
}}
2024-05-31 16:41:18 +00:00
>
{settings.cfg.formContact.desc}
</Typography>
)}
</Box>
</Box>
);
};