fix: conflicts resolved

This commit is contained in:
IlyaDoronin 2024-05-10 13:15:53 +03:00
commit 30006f4f4f
8 changed files with 190 additions and 134 deletions

@ -5,6 +5,7 @@ import { enqueueSnackbar } from "notistack";
import CustomCheckbox from "@ui_kit/CustomCheckbox";
import { Inputs } from "@/components/ViewPublicationPage/ContactForm/Inputs/Inputs";
import { ContactTextBlock } from "./ContactTextBlock";
import { useRootContainerSize } from "@contexts/RootContainerWidthContext";
import { useQuizData } from "@contexts/QuizDataContext";
@ -208,130 +209,90 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
: theme.palette.background.default,
}}
>
<ContactTextBlock settings={settings} />
<Box
sx={{
width: isMobile ? undefined : "100%",
flexGrow: 0,
display: "flex",
flexDirection: "column",
alignItems: "center",
justifyContent: "center",
borderRight: isMobile ? undefined : "1px solid #9A9AAF80",
margin: isMobile ? 0 : "40px 0",
padding: isMobile ? "0" : "0 40px",
justifyContent: "space-between",
flexDirection: "column",
backgroundColor: theme.palette.background.default,
height: "auto",
}}
>
<Box
sx={{
maxWidth: "630px",
width: "100%",
display: "flex",
flexDirection: "column",
alignItems: "flex-start",
alignItems: isMobile ? undefined : "center",
justifyContent: "center",
padding: isMobile ? "40px 20px 0 20px" : "0",
mt: isMobile ? 0 : isTablet ? "-180px" : "-47px",
flexDirection: "column",
p: isMobile
? "0 20px"
: isTablet
? "0px 40px 30px 60px"
: "125px 60px 30px 60px",
}}
>
<Typography
<Box
sx={{
textAlign: isTablet ? undefined : "center",
fontSize: "24px",
lineHeight: "normal",
fontWeight: 501,
color: theme.palette.text.primary,
wordBreak: "break-word",
display: "flex",
flexDirection: "column",
mt: isMobile ? "10px" : "20px",
mb: "20px",
}}
>
{settings.cfg.formContact.title ||
"Заполните форму, чтобы получить результаты теста"}
</Typography>
{settings.cfg.formContact.desc && (
<Inputs
name={name}
setName={setName}
email={email}
setEmail={setEmail}
phone={phone}
setPhone={setPhone}
text={text}
setText={setText}
adress={adress}
setAdress={setAdress}
/>
</Box>
<Box
sx={{
display: "flex",
width: isMobile ? "300px" : "390px",
}}
>
<CustomCheckbox
label=""
handleChange={({ target }) => {
setReady(target.checked);
}}
checked={ready}
colorIcon={theme.palette.primary.main}
sx={{ marginRight: "0" }}
/>
<Typography
sx={{
color: theme.palette.text.primary,
m: "20px 0",
fontSize: "18px",
wordBreak: "break-word",
lineHeight: "18.96px",
}}
fontSize={"16px"}
>
{settings.cfg.formContact.desc}
С&ensp;
<Link href={"https://shub.pena.digital/ppdd"} target="_blank">
Положением об обработке персональных данных{" "}
</Link>
&ensp;и&ensp;
<Link
href={"https://shub.pena.digital/docs/privacy"}
target="_blank"
>
{" "}
Политикой конфиденциальности{" "}
</Link>
&ensp;ознакомлен
</Typography>
)}
</Box>
</Box>
</Box>
<Box
sx={{
display: "flex",
alignItems: isMobile ? undefined : "center",
justifyContent: "center",
flexDirection: "column",
backgroundColor: theme.palette.background.default,
p: isMobile
? "0 20px"
: isTablet
? "0px 40px 30px 60px"
: "125px 60px 30px 60px",
}}
>
<Box
sx={{
display: "flex",
flexDirection: "column",
mt: isMobile ? "10px" : "20px",
mb: "20px",
}}
>
<Inputs
name={name}
setName={setName}
email={email}
setEmail={setEmail}
phone={phone}
setPhone={setPhone}
text={text}
setText={setText}
adress={adress}
setAdress={setAdress}
/>
</Box>
<Box
sx={{
display: "flex",
width: isMobile ? "300px" : "390px",
}}
>
<CustomCheckbox
label=""
handleChange={({ target }) => {
setReady(target.checked);
}}
checked={ready}
colorIcon={theme.palette.primary.main}
sx={{ marginRight: "0" }}
/>
<Typography
sx={{ color: theme.palette.text.primary, lineHeight: "18.96px" }}
fontSize={"16px"}
>
С&ensp;
<Link href={"https://shub.pena.digital/ppdd"} target="_blank">
Положением об обработке персональных данных{" "}
</Link>
&ensp;и&ensp;
<Link
href={"https://shub.pena.digital/docs/privacy"}
target="_blank"
>
{" "}
Политикой конфиденциальности{" "}
</Link>
&ensp;ознакомлен
</Typography>
</Box>
{
// resultQuestion &&
// settings.cfg.resultInfo.when === "after" &&
<Button
disabled={!(ready && !fire)}
variant="contained"
@ -349,7 +310,7 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
>
{settings.cfg.formContact?.button || "Получить результаты"}
</Button>
}
</Box>
{show_badge && (
<Box
component={Link}
@ -361,12 +322,9 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
display: "flex",
alignItems: "center",
mt: "55px",
mb: "40px",
mb: isMobile ? "30px" : isTablet ? "40px" : "50px",
gap: "10px",
textDecoration: "none",
position: "absolute",
bottom: 0,
left: isMobile ? "28%" : undefined,
}}
>
<NameplateLogo
@ -377,17 +335,6 @@ export const ContactForm = ({ currentQuestion, onShowResult }: Props) => {
: "#FFFFFF",
}}
/>
{/*<Typography*/}
{/* sx={{*/}
{/* fontSize: "14px",*/}
{/* color: quizThemes[settings.cfg.theme].isLight*/}
{/* ? "#4D4D4D"*/}
{/* : "#F5F7FF",*/}
{/* whiteSpace: "nowrap",*/}
{/* }}*/}
{/*>*/}
{/* Сделано на PenaQuiz*/}
{/*</Typography>*/}
</Box>
)}
</Box>

@ -0,0 +1,66 @@
import {Box, Typography, useTheme} from "@mui/material";
import {useRootContainerSize} from "@contexts/RootContainerWidthContext.ts";
import {QuizSettingsConfig} from "@model/settingsData.ts";
import {FC} from "react";
type ContactTextBlockProps = {
settings: QuizSettingsConfig;
}
export const ContactTextBlock: FC<ContactTextBlockProps> = ({settings}) => {
const theme = useTheme();
const isMobile = useRootContainerSize() < 850;
const isTablet = useRootContainerSize() < 1000;
return (
<Box
sx={{
flexGrow: 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",
}}
>
{settings.cfg.formContact.title ||
"Заполните форму, чтобы получить результаты теста"}
</Typography>
{settings.cfg.formContact.desc && (
<Typography
sx={{
color: theme.palette.text.primary,
m: "20px 0",
fontSize: "18px",
wordBreak: "break-word",
}}
>
{settings.cfg.formContact.desc}
</Typography>
)}
</Box>
</Box>
)
}

@ -20,6 +20,13 @@ export const CountrySelector:FC<CountrySelectorProps> = ({setMask}) => {
value={country}
onChange={handleChange}
renderValue={(value) => value}
MenuProps={{
PaperProps: {
style: {
backgroundColor: theme.palette.background.default,
},
},
}}
sx={{
minWidth: 50,
backgroundColor: theme.palette.background.default,

@ -407,7 +407,19 @@ export const StartPageViewPublication = () => {
}}
>
{settings.cfg.info.site && (
<ButtonBase onClick={onSiteClick}>
<ButtonBase
onClick={onSiteClick}
sx={{
display: "block",
marginTop: "10px",
marginLeft:
settings.cfg.startpageType === "expanded" &&
settings.cfg.startpage.position === "center" &&
!isMobile
? "auto"
: undefined,
}}
>
<Typography
sx={{
lineHeight: "19px",
@ -450,7 +462,19 @@ export const StartPageViewPublication = () => {
</Typography>
</Link>
) : (
<ButtonBase onClick={handleCopyNumber}>
<ButtonBase
onClick={handleCopyNumber}
sx={{
display: "block",
marginTop: "10px",
marginLeft:
settings.cfg.startpageType === "expanded" &&
settings.cfg.startpage.position === "center" &&
!isMobile
? "auto"
: undefined,
}}
>
<Typography
sx={{
textAlign:
@ -490,6 +514,7 @@ export const StartPageViewPublication = () => {
{settings.cfg.info.phonenumber}
</Typography>
)}
<Typography
sx={{
lineHeight: "14px",
@ -498,8 +523,15 @@ export const StartPageViewPublication = () => {
fontSize: "12px",
textAlign:
settings.cfg.startpageType === "expanded" &&
settings.cfg.startpage.position === "center"
settings.cfg.startpage.position === "center" &&
!isMobile
? "end"
: (settings.cfg.startpageType === "expanded" &&
settings.cfg.startpage.position === "center" &&
isMobile) ||
(settings.cfg.startpageType === "centered" &&
isMobile)
? "center"
: "none",
maxHeight: "120px",
overflow: "auto",

@ -87,6 +87,7 @@ export default function ViewPublicationPage() {
quizStepElement = (
<Question
key={currentQuestion.id}
currentQuestion={currentQuestion}
currentQuestionStepNumber={currentQuestionStepNumber}
prevButton={

@ -100,7 +100,8 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => {
{answer ? (
variant?.extendedText ? (
<img
src={variant?.extendedText}
key={variant.extendedText}
src={variant.extendedText}
style={{ width: "100%", height: "100%", objectFit: "cover" }}
alt=""
/>

@ -1,4 +1,4 @@
import { AnyTypedQuizQuestion } from "./questionTypes/shared";
import {AnyTypedQuizQuestion} from "./questionTypes/shared";
export type QuizStartpageType = "standard" | "expanded" | "centered" | null;
@ -41,18 +41,20 @@ export type FCField = {
used: boolean;
};
export type QuizSettingsConfig = {
fp: boolean;
rep: boolean;
name: string;
lim: number;
due: number;
delay: number;
pausable: boolean;
cfg: QuizConfig;
}
export type QuizSettings = {
questions: AnyTypedQuizQuestion[];
settings: {
fp: boolean;
rep: boolean;
name: string;
lim: number;
due: number;
delay: number;
pausable: boolean;
cfg: QuizConfig;
};
settings: QuizSettingsConfig;
cnt: number;
recentlyCompleted: boolean;
show_badge: boolean;

@ -1,6 +1,6 @@
{
"name": "@frontend/squzanswerer",
"version": "1.0.36",
"version": "1.0.38",
"type": "module",
"main": "./dist-package/index.js",
"module": "./dist-package/index.js",