адаптация тарифов, увеличено огранчения для ввода ссылки на сайт пользователя, раскрытие результатов в заявке по клмлку на саму карточку
This commit is contained in:
parent
1579ea1dd4
commit
0eceb3a727
@ -63,10 +63,37 @@ export const CardAnswer = ({
|
|||||||
const { editQuizId } = useQuizStore();
|
const { editQuizId } = useQuizStore();
|
||||||
const { questions } = useQuestionsStore();
|
const { questions } = useQuestionsStore();
|
||||||
|
|
||||||
|
const openResults = async () => {
|
||||||
|
setIsOpen(!isOpen);
|
||||||
|
if (!isOpen) {
|
||||||
|
try {
|
||||||
|
let resAnswer = await resultApi.getAnswerList(Number(idResult));
|
||||||
|
|
||||||
|
let resAnswerOnly = resAnswer.filter((res) => res.Result !== true);
|
||||||
|
let resQuiz = resAnswer.filter((res) => res.Result === true);
|
||||||
|
setResultQuiz(resQuiz);
|
||||||
|
setResultsAnswer(resAnswerOnly);
|
||||||
|
let idResults = resQuiz[0].question_id;
|
||||||
|
let questionsResult = questions.filter(
|
||||||
|
(q) => q.backendId === idResults,
|
||||||
|
);
|
||||||
|
setQuestionsResultState(questionsResult);
|
||||||
|
console.log("тут хранятся ответы", resAnswerOnly);
|
||||||
|
} catch (nativeError) {
|
||||||
|
const error = nativeError as AxiosError;
|
||||||
|
|
||||||
|
if (error.response?.statusText === "Payment Required") {
|
||||||
|
openPrePaymentModal();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
obsolescenceResult(idResult, editQuizId);
|
obsolescenceResult(idResult, editQuizId);
|
||||||
|
openResults();
|
||||||
}}
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
borderRadius: "12px",
|
borderRadius: "12px",
|
||||||
@ -129,39 +156,7 @@ export const CardAnswer = ({
|
|||||||
>
|
>
|
||||||
{idResult}
|
{idResult}
|
||||||
</Box>
|
</Box>
|
||||||
<IconButton
|
<IconButton onClick={openResults}>
|
||||||
onClick={async () => {
|
|
||||||
setIsOpen(!isOpen);
|
|
||||||
if (!isOpen) {
|
|
||||||
try {
|
|
||||||
let resAnswer = await resultApi.getAnswerList(
|
|
||||||
Number(idResult),
|
|
||||||
);
|
|
||||||
|
|
||||||
let resAnswerOnly = resAnswer.filter(
|
|
||||||
(res) => res.Result !== true,
|
|
||||||
);
|
|
||||||
let resQuiz = resAnswer.filter(
|
|
||||||
(res) => res.Result === true,
|
|
||||||
);
|
|
||||||
setResultQuiz(resQuiz);
|
|
||||||
setResultsAnswer(resAnswerOnly);
|
|
||||||
let idResults = resQuiz[0].question_id;
|
|
||||||
let questionsResult = questions.filter(
|
|
||||||
(q) => q.backendId === idResults,
|
|
||||||
);
|
|
||||||
setQuestionsResultState(questionsResult);
|
|
||||||
console.log("тут хранятся ответы", resAnswerOnly);
|
|
||||||
} catch (nativeError) {
|
|
||||||
const error = nativeError as AxiosError;
|
|
||||||
|
|
||||||
if (error.response?.statusText === "Payment Required") {
|
|
||||||
openPrePaymentModal();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<ArrowDownIcon
|
<ArrowDownIcon
|
||||||
style={{
|
style={{
|
||||||
transform: isOpen ? "rotate(180deg)" : "rotate(360deg)",
|
transform: isOpen ? "rotate(180deg)" : "rotate(360deg)",
|
||||||
|
@ -41,6 +41,7 @@ function TariffPage() {
|
|||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const token = useToken();
|
const token = useToken();
|
||||||
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
const isTablet = useMediaQuery(theme.breakpoints.down(1000));
|
||||||
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
||||||
const userId = useUserStore((state) => state.userId);
|
const userId = useUserStore((state) => state.userId);
|
||||||
const location = useLocation();
|
const location = useLocation();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -175,7 +176,7 @@ function TariffPage() {
|
|||||||
display: "flex",
|
display: "flex",
|
||||||
height: "80px",
|
height: "80px",
|
||||||
alignItems: "center",
|
alignItems: "center",
|
||||||
gap: isTablet ? "20px" : "60px",
|
gap: isMobile ? "7px" : isTablet ? "20px" : "60px",
|
||||||
flexDirection: "row",
|
flexDirection: "row",
|
||||||
justifyContent: "space-between",
|
justifyContent: "space-between",
|
||||||
bgcolor: "white",
|
bgcolor: "white",
|
||||||
@ -189,7 +190,7 @@ function TariffPage() {
|
|||||||
<ArrowLeft color="black" />
|
<ArrowLeft color="black" />
|
||||||
</IconButton>
|
</IconButton>
|
||||||
<Box sx={{ display: "flex", ml: "auto" }}>
|
<Box sx={{ display: "flex", ml: "auto" }}>
|
||||||
<Box sx={{ whiteSpace: "nowrap" }}>
|
<Box sx={{ whiteSpace: "nowrap" }} onClick={() => console.log(cash)}>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{
|
sx={{
|
||||||
fontSize: "12px",
|
fontSize: "12px",
|
||||||
@ -199,7 +200,11 @@ function TariffPage() {
|
|||||||
>
|
>
|
||||||
Мой баланс
|
Мой баланс
|
||||||
</Typography>
|
</Typography>
|
||||||
<Typography variant="body2" color={"#7e2aea"}>
|
<Typography
|
||||||
|
variant="body2"
|
||||||
|
color={"#7e2aea"}
|
||||||
|
fontSize={isMobile ? (cash.length > 9 ? "13px" : "16px") : "16px"}
|
||||||
|
>
|
||||||
{cash}
|
{cash}
|
||||||
</Typography>
|
</Typography>
|
||||||
</Box>
|
</Box>
|
||||||
|
@ -6,6 +6,8 @@ import {
|
|||||||
Theme,
|
Theme,
|
||||||
Button,
|
Button,
|
||||||
Badge,
|
Badge,
|
||||||
|
useTheme,
|
||||||
|
useMediaQuery,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { MouseEventHandler, ReactNode } from "react";
|
import { MouseEventHandler, ReactNode } from "react";
|
||||||
|
|
||||||
@ -33,7 +35,8 @@ export default function TariffCard({
|
|||||||
discount,
|
discount,
|
||||||
}: Props) {
|
}: Props) {
|
||||||
text = Array.isArray(text) ? text : [text];
|
text = Array.isArray(text) ? text : [text];
|
||||||
|
const theme = useTheme();
|
||||||
|
const isMobile = useMediaQuery(theme.breakpoints.down(600));
|
||||||
return (
|
return (
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
@ -68,6 +71,7 @@ export default function TariffCard({
|
|||||||
flexWrap: "wrap",
|
flexWrap: "wrap",
|
||||||
columnGap: "10px",
|
columnGap: "10px",
|
||||||
rowGap: 0,
|
rowGap: 0,
|
||||||
|
flexDirection: isMobile ? "column-reverse" : undefined,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{price}
|
{price}
|
||||||
|
@ -817,7 +817,7 @@ export default function StartPageSettings() {
|
|||||||
quiz.config.info.site = e.target.value;
|
quiz.config.info.site = e.target.value;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
maxLength={100}
|
maxLength={2000}
|
||||||
/>
|
/>
|
||||||
<Typography
|
<Typography
|
||||||
sx={{
|
sx={{
|
||||||
|
Loading…
Reference in New Issue
Block a user