темы для публикации на стейтах(нужны доработки)

This commit is contained in:
Tamara 2023-12-21 03:08:58 +03:00
parent 494d750534
commit bfe19091ac
10 changed files with 94 additions and 26 deletions

@ -222,7 +222,7 @@ export const Footer = ({ setCurrentQuestion, question, setShowContactForm, setSh
alignItems: "center", alignItems: "center",
gap: "10px", gap: "10px",
marginRight: "auto", marginRight: "auto",
color: theme.palette.grey1.main, // color: theme.palette.grey1.main,
}} }}
> >
{/* <Typography>Шаг</Typography> {/* <Typography>Шаг</Typography>

@ -112,7 +112,7 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => {
<Typography sx={{ fontSize: "14px" }}>{quiz.config.info.orgname}</Typography> <Typography sx={{ fontSize: "14px" }}>{quiz.config.info.orgname}</Typography>
</Box> </Box>
<Link mb="16px" href={quiz.config.info.site}> <Link mb="16px" href={quiz.config.info.site}>
<Typography sx={{ fontSize: "16px", color: theme.palette.brightPurple.main }}> <Typography sx={{ fontSize: "16px", color: theme.palette.primary.main }}>
{quiz.config.info.site} {quiz.config.info.site}
</Typography> </Typography>
</Link> </Link>
@ -184,19 +184,19 @@ export const StartPageViewPublication = ({ setVisualStartPage }: Props) => {
{quiz.config.info.clickable ? ( {quiz.config.info.clickable ? (
isMobileDevice ? ( isMobileDevice ? (
<Link href={`tel:${quiz.config.info.phonenumber}`}> <Link href={`tel:${quiz.config.info.phonenumber}`}>
<Typography sx={{ fontSize: "16px", color: theme.palette.brightPurple.main }}> <Typography sx={{ fontSize: "16px", color: theme.palette.primary.main }}>
{quiz.config.info.phonenumber} {quiz.config.info.phonenumber}
</Typography> </Typography>
</Link> </Link>
) : ( ) : (
<ButtonBase onClick={handleCopyNumber}> <ButtonBase onClick={handleCopyNumber}>
<Typography sx={{ fontSize: "16px", color: theme.palette.brightPurple.main }}> <Typography sx={{ fontSize: "16px", color: theme.palette.primary.main }}>
{quiz.config.info.phonenumber} {quiz.config.info.phonenumber}
</Typography> </Typography>
</ButtonBase> </ButtonBase>
) )
) : ( ) : (
<Typography sx={{ fontSize: "16px", color: theme.palette.brightPurple.main }}> <Typography sx={{ fontSize: "16px", color: theme.palette.primary.main }}>
{quiz.config.info.phonenumber} {quiz.config.info.phonenumber}
</Typography> </Typography>
)} )}

@ -1,5 +1,5 @@
import { useEffect, useState } from "react"; import { useEffect, useState } from "react";
import { Box } from "@mui/material"; import {Box, Button, ThemeProvider} from "@mui/material";
import { StartPageViewPublication } from "./StartPageViewPublication"; import { StartPageViewPublication } from "./StartPageViewPublication";
import { Question } from "./Question"; import { Question } from "./Question";
@ -18,6 +18,9 @@ import { useQuestionsStore } from "@root/questions/store";
import { setQuestions } from "@root/questions/actions"; import { setQuestions } from "@root/questions/actions";
import { questionApi } from "@api/question"; import { questionApi } from "@api/question";
import { ApologyPage } from "./ApologyPage" import { ApologyPage } from "./ApologyPage"
import {themesPublication} from "../../utils/themes/themePublication";
type themePublic = "StandardTheme" | "PinkTheme"
export const ViewPage = () => { export const ViewPage = () => {
const quiz = useCurrentQuiz(); const quiz = useCurrentQuiz();
@ -55,15 +58,24 @@ export const ViewPage = () => {
console.log(questions) console.log(questions)
const [themeState, setThemeState] = useState<themePublic>("StandardTheme");
if (visualStartPage === undefined) return <></>; if (visualStartPage === undefined) return <></>;
if (questions.length === 0 || (questions.length === 1 && questions[0].type === "result")) return <ApologyPage message="Нет созданных вопросов"/> if (questions.length === 0 || (questions.length === 1 && questions[0].type === "result")) return <ApologyPage message="Нет созданных вопросов"/>
return ( return (
<Box> <ThemeProvider theme={themesPublication?.[themeState]}>
{!visualStartPage ? ( <Box>
<StartPageViewPublication setVisualStartPage={setVisualStartPage} /> {!visualStartPage ? (
) : ( <StartPageViewPublication setVisualStartPage={setVisualStartPage} />
<Question questions={filteredQuestions} /> ) : (
)} <Question questions={filteredQuestions} />
</Box> )}
<Box>
<Button onClick={() => {setThemeState("StandardTheme")}}>Standard</Button>
<Button onClick={() => {setThemeState("PinkTheme")}}>Pink</Button>
</Box>
</Box>
</ThemeProvider>
); );
}; };

@ -55,7 +55,8 @@ export const Emoji = ({ currentQuestion }: EmojiProps) => {
key={variant.id} key={variant.id}
sx={{ sx={{
borderRadius: "12px", borderRadius: "12px",
border: `1px solid ${theme.palette.grey2.main}`, // border: `1px solid ${theme.palette.grey2.main}`,
border: `1px solid #9A9AAF`,
overflow: "hidden", overflow: "hidden",
maxWidth: "317px", maxWidth: "317px",
width: "100%", width: "100%",

@ -72,7 +72,7 @@ export const File = ({ currentQuestion }: FileProps) => {
<Box <Box
sx={{ sx={{
padding: "5px 5px 5px 16px", padding: "5px 5px 5px 16px",
backgroundColor: theme.palette.brightPurple.main, backgroundColor: theme.palette.primary.main,
borderRadius: "8px", borderRadius: "8px",
color: "#FFFFFF", color: "#FFFFFF",
display: "flex", display: "flex",
@ -115,7 +115,8 @@ export const File = ({ currentQuestion }: FileProps) => {
alignItems: "center", alignItems: "center",
padding: "33px 44px 33px 55px", padding: "33px 44px 33px 55px",
backgroundColor: theme.palette.background.default, backgroundColor: theme.palette.background.default,
border: `1px solid ${theme.palette.grey2.main}`, border: `1px solid #9A9AAF`,
// border: `1px solid ${theme.palette.grey2.main}`,
borderRadius: "8px", borderRadius: "8px",
}} }}
> >
@ -123,7 +124,8 @@ export const File = ({ currentQuestion }: FileProps) => {
<Box> <Box>
<Typography <Typography
sx={{ sx={{
color: theme.palette.grey2.main, color: "#9A9AAF",
// color: theme.palette.grey2.main,
fontWeight: 500, fontWeight: 500,
}} }}
> >
@ -134,7 +136,8 @@ export const File = ({ currentQuestion }: FileProps) => {
</Typography> </Typography>
<Typography <Typography
sx={{ sx={{
color: theme.palette.grey2.main, color: "#9A9AAF",
// color: theme.palette.grey2.main,
fontSize: "16px", fontSize: "16px",
lineHeight: "19px", lineHeight: "19px",
}} }}

@ -62,7 +62,8 @@ export const Images = ({ currentQuestion }: ImagesProps) => {
sx={{ sx={{
cursor: "pointer", cursor: "pointer",
borderRadius: "5px", borderRadius: "5px",
border: `1px solid ${theme.palette.grey2.main}`, border: `1px solid #9A9AAF`,
// border: `1px solid ${theme.palette.grey2.main}`,
}} }}
onClick={(event) => { onClick={(event) => {
event.preventDefault(); event.preventDefault();
@ -98,7 +99,8 @@ export const Images = ({ currentQuestion }: ImagesProps) => {
sx={{ sx={{
display: "block", display: "block",
textAlign: "center", textAlign: "center",
color: theme.palette.grey2.main, color: "#9A9AAF",
// color: theme.palette.grey2.main,
marginTop: "10px", marginTop: "10px",
}} }}
value={index} value={index}

@ -74,7 +74,10 @@ export const Rating = ({ currentQuestion }: RatingProps) => {
marginTop: "20px", marginTop: "20px",
}} }}
> >
<Typography sx={{ color: theme.palette.grey2.main }}> <Typography sx={{
color: "#9A9AAF"
// color: theme.palette.grey2.main
}}>
{currentQuestion.content.ratingNegativeDescription} {currentQuestion.content.ratingNegativeDescription}
</Typography> </Typography>
<Box <Box
@ -90,11 +93,11 @@ export const Rating = ({ currentQuestion }: RatingProps) => {
} }
sx={{ height: "50px", gap: "15px" }} sx={{ height: "50px", gap: "15px" }}
max={currentQuestion.content.steps} max={currentQuestion.content.steps}
icon={form?.icon(theme.palette.brightPurple.main)} icon={form?.icon(theme.palette.primary.main)}
emptyIcon={form?.icon(theme.palette.grey2.main)} emptyIcon={form?.icon("#9A9AAF")}
/> />
</Box> </Box>
<Typography sx={{ color: theme.palette.grey2.main }}> <Typography sx={{ color: "#9A9AAF" }}>
{currentQuestion.content.ratingPositiveDescription} {currentQuestion.content.ratingPositiveDescription}
</Typography> </Typography>
</Box> </Box>

@ -134,7 +134,7 @@ const VariantItem = ({
margin: "0", margin: "0",
borderRadius: "12px", borderRadius: "12px",
padding: "15px", padding: "15px",
border: `1px solid ${theme.palette.grey2.main}`, border: `1px solid #9A9AAF`,
display: "flex", display: "flex",
maxWidth: "685px", maxWidth: "685px",
justifyContent: "space-between", justifyContent: "space-between",

@ -57,7 +57,7 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => {
borderRadius: "5px", borderRadius: "5px",
padding: "15px", padding: "15px",
color: "#4D4D4D", color: "#4D4D4D",
border: `1px solid ${theme.palette.grey2.main}`, border: `1px solid #9A9AAF`,
display: "flex", display: "flex",
}} }}
value={index} value={index}

@ -0,0 +1,47 @@
import { createTheme } from "@mui/material";
import theme from "./generic";
const StandardTheme = createTheme({
// ...theme,
palette: {
primary: {
main: "#7E2AEA",
},
secondary: {
main: "#252734"
},
text: {
primary: "#333647",
secondary: "#7E2AEA",
},
background: {
default: "#FFFFFF",
},
}
})
const PinkTheme = createTheme({
// ...theme,
palette: {
primary: {
main: "#D34085",
},
secondary: {
main: "#252734"
},
text: {
primary: "#333647",
secondary: "#D34085",
},
background: {
default: "#FFF9FC",
},
}
})
export const themesPublication = {
StandardTheme,
PinkTheme,
}