Merge branch 'dev' of penahub.gitlab.yandexcloud.net:frontend/squzanswerer into dev
This commit is contained in:
commit
2db1d45503
@ -18,6 +18,10 @@ import { sendAnswer } from "@api/quizRelase";
|
|||||||
import { enqueueSnackbar } from "notistack";
|
import { enqueueSnackbar } from "notistack";
|
||||||
import type { QuizQuestionEmoji } from "../../../model/questionTypes/emoji";
|
import type { QuizQuestionEmoji } from "../../../model/questionTypes/emoji";
|
||||||
import { useQuizData } from "@contexts/QuizDataContext";
|
import { useQuizData } from "@contexts/QuizDataContext";
|
||||||
|
import { polyfillCountryFlagEmojis } from "country-flag-emoji-polyfill";
|
||||||
|
|
||||||
|
|
||||||
|
polyfillCountryFlagEmojis();
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
|
|
||||||
type EmojiProps = {
|
type EmojiProps = {
|
||||||
@ -36,7 +40,11 @@ export const Emoji = ({ currentQuestion }: EmojiProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="h5" color={theme.palette.text.primary} sx={{ wordBreak: "break-word" }}>{currentQuestion.title}</Typography>
|
<Typography
|
||||||
|
variant="h5"
|
||||||
|
color={theme.palette.text.primary}
|
||||||
|
sx={{ wordBreak: "break-word" }}
|
||||||
|
>{currentQuestion.title}</Typography>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
name={currentQuestion.id}
|
name={currentQuestion.id}
|
||||||
value={currentQuestion.content.variants.findIndex(
|
value={currentQuestion.content.variants.findIndex(
|
||||||
@ -111,6 +119,12 @@ export const Emoji = ({ currentQuestion }: EmojiProps) => {
|
|||||||
height: variant.answer.length <= 60 ? undefined : "60px",
|
height: variant.answer.length <= 60 ? undefined : "60px",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
paddingLeft: "45px",
|
paddingLeft: "45px",
|
||||||
|
"&::-webkit-scrollbar": {
|
||||||
|
width: "4px",
|
||||||
|
},
|
||||||
|
"&::-webkit-scrollbar-thumb": {
|
||||||
|
backgroundColor: "#b8babf",
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
value={index}
|
value={index}
|
||||||
@ -172,5 +186,4 @@ export const Emoji = ({ currentQuestion }: EmojiProps) => {
|
|||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
</Box>
|
</Box>
|
||||||
);
|
);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@ -22,7 +22,7 @@ type ImagesProps = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const Images = ({ currentQuestion }: ImagesProps) => {
|
export const Images = ({ currentQuestion }: ImagesProps) => {
|
||||||
const { quizId } =useQuizData();
|
const { quizId } = useQuizData();
|
||||||
const { answers } = useQuizViewStore();
|
const { answers } = useQuizViewStore();
|
||||||
const theme = useTheme();
|
const theme = useTheme();
|
||||||
const answer = answers.find(({ questionId }) => questionId === currentQuestion.id)?.answer;
|
const answer = answers.find(({ questionId }) => questionId === currentQuestion.id)?.answer;
|
||||||
@ -31,7 +31,7 @@ export const Images = ({ currentQuestion }: ImagesProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="h5" color={theme.palette.text.primary} sx={{wordBreak: "break-word"}}>{currentQuestion.title}</Typography>
|
<Typography variant="h5" color={theme.palette.text.primary} sx={{ wordBreak: "break-word" }}>{currentQuestion.title}</Typography>
|
||||||
<RadioGroup
|
<RadioGroup
|
||||||
name={currentQuestion.id}
|
name={currentQuestion.id}
|
||||||
value={currentQuestion.content.variants.findIndex(
|
value={currentQuestion.content.variants.findIndex(
|
||||||
@ -69,8 +69,6 @@ export const Images = ({ currentQuestion }: ImagesProps) => {
|
|||||||
onClick={async (event) => {
|
onClick={async (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
console.log("пытаюсь передать qid")
|
|
||||||
console.log(quizId)
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
await sendAnswer({
|
await sendAnswer({
|
||||||
@ -94,8 +92,6 @@ export const Images = ({ currentQuestion }: ImagesProps) => {
|
|||||||
deleteAnswer(currentQuestion.id);
|
deleteAnswer(currentQuestion.id);
|
||||||
try {
|
try {
|
||||||
|
|
||||||
console.log("пытаюсь передать qid")
|
|
||||||
console.log(quizId)
|
|
||||||
await sendAnswer({
|
await sendAnswer({
|
||||||
questionId: currentQuestion.id,
|
questionId: currentQuestion.id,
|
||||||
body: "",
|
body: "",
|
||||||
@ -142,6 +138,12 @@ export const Images = ({ currentQuestion }: ImagesProps) => {
|
|||||||
height: variant.answer.length <= 60 ? undefined : "60px",
|
height: variant.answer.length <= 60 ? undefined : "60px",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
paddingLeft: "45px",
|
paddingLeft: "45px",
|
||||||
|
"&::-webkit-scrollbar": {
|
||||||
|
width: "4px",
|
||||||
|
},
|
||||||
|
"&::-webkit-scrollbar-thumb": {
|
||||||
|
backgroundColor: "#b8babf",
|
||||||
|
}
|
||||||
},
|
},
|
||||||
}}
|
}}
|
||||||
value={index}
|
value={index}
|
||||||
|
@ -71,7 +71,7 @@ export const Rating = ({ currentQuestion }: RatingProps) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Box>
|
<Box>
|
||||||
<Typography variant="h5" color={theme.palette.text.primary} sx={{wordBreak: "break-word"}}>{currentQuestion.title}</Typography>
|
<Typography variant="h5" color={theme.palette.text.primary} sx={{ wordBreak: "break-word" }}>{currentQuestion.title}</Typography>
|
||||||
<Box
|
<Box
|
||||||
sx={{
|
sx={{
|
||||||
display: "inline-flex",
|
display: "inline-flex",
|
||||||
|
@ -180,6 +180,12 @@ const VariantItem = ({
|
|||||||
wordBreak: "break-word",
|
wordBreak: "break-word",
|
||||||
height: variant.answer.length <= 60 ? undefined : "60px",
|
height: variant.answer.length <= 60 ? undefined : "60px",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
|
"&::-webkit-scrollbar": {
|
||||||
|
width: "4px",
|
||||||
|
},
|
||||||
|
"&::-webkit-scrollbar-thumb": {
|
||||||
|
backgroundColor: "#b8babf",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
value={index}
|
value={index}
|
||||||
|
@ -80,6 +80,12 @@ export const Varimg = ({ currentQuestion }: VarimgProps) => {
|
|||||||
height: variant.answer.length <= 60 ? undefined : "60px",
|
height: variant.answer.length <= 60 ? undefined : "60px",
|
||||||
overflow: "auto",
|
overflow: "auto",
|
||||||
paddingLeft: "45px",
|
paddingLeft: "45px",
|
||||||
|
"&::-webkit-scrollbar": {
|
||||||
|
width: "4px",
|
||||||
|
},
|
||||||
|
"&::-webkit-scrollbar-thumb": {
|
||||||
|
backgroundColor: "#b8babf",
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
value={index}
|
value={index}
|
||||||
|
@ -89,6 +89,7 @@ const theme = createTheme({
|
|||||||
fontWeight: 500,
|
fontWeight: 500,
|
||||||
},
|
},
|
||||||
fontFamily: [
|
fontFamily: [
|
||||||
|
"Twemoji Country Flags",
|
||||||
"Rubik",
|
"Rubik",
|
||||||
"-apple-system",
|
"-apple-system",
|
||||||
"BlinkMacSystemFont",
|
"BlinkMacSystemFont",
|
||||||
@ -134,4 +135,4 @@ theme.typography.infographic = {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export default theme;
|
export default theme;
|
||||||
|
13
package.json
13
package.json
@ -36,30 +36,30 @@
|
|||||||
"@mui/material": "^5.10.14",
|
"@mui/material": "^5.10.14",
|
||||||
"@mui/x-date-pickers": "^6.16.1",
|
"@mui/x-date-pickers": "^6.16.1",
|
||||||
"@types/node": "^16.7.13",
|
"@types/node": "^16.7.13",
|
||||||
"@types/react-dom": "^18.2.17",
|
|
||||||
"@types/react": "^18.2.43",
|
"@types/react": "^18.2.43",
|
||||||
|
"@types/react-dom": "^18.2.17",
|
||||||
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
"@typescript-eslint/eslint-plugin": "^6.14.0",
|
||||||
"@typescript-eslint/parser": "^6.14.0",
|
"@typescript-eslint/parser": "^6.14.0",
|
||||||
"@vitejs/plugin-react": "^4.2.1",
|
"@vitejs/plugin-react": "^4.2.1",
|
||||||
"axios": "^1.5.1",
|
"axios": "^1.5.1",
|
||||||
"cypress": "^13.6.1",
|
"cypress": "^13.6.1",
|
||||||
"emoji-mart": "^5.5.2",
|
"emoji-mart": "^5.5.2",
|
||||||
|
"eslint": "^8.55.0",
|
||||||
"eslint-plugin-react-hooks": "^4.6.0",
|
"eslint-plugin-react-hooks": "^4.6.0",
|
||||||
"eslint-plugin-react-refresh": "^0.4.5",
|
"eslint-plugin-react-refresh": "^0.4.5",
|
||||||
"eslint": "^8.55.0",
|
|
||||||
"immer": "^10.0.3",
|
"immer": "^10.0.3",
|
||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"nanoid": "^5.0.3",
|
"nanoid": "^5.0.3",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-error-boundary": "^4.0.12",
|
"react-error-boundary": "^4.0.12",
|
||||||
"react-router-dom": "^6.21.3",
|
"react-router-dom": "^6.21.3",
|
||||||
"react": "^18.2.0",
|
|
||||||
"swr": "^2.2.4",
|
"swr": "^2.2.4",
|
||||||
"typescript": "^5.2.2",
|
"typescript": "^5.2.2",
|
||||||
"use-debounce": "^9.0.4",
|
"use-debounce": "^9.0.4",
|
||||||
"vite-plugin-dts": "^3.7.2",
|
|
||||||
"vite": "^5.0.8",
|
"vite": "^5.0.8",
|
||||||
|
"vite-plugin-dts": "^3.7.2",
|
||||||
"zustand": "^4.3.8"
|
"zustand": "^4.3.8"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
@ -76,12 +76,15 @@
|
|||||||
"moment": "^2.30.1",
|
"moment": "^2.30.1",
|
||||||
"nanoid": "^5.0.3",
|
"nanoid": "^5.0.3",
|
||||||
"notistack": "^3.0.1",
|
"notistack": "^3.0.1",
|
||||||
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0",
|
"react-dom": "^18.2.0",
|
||||||
"react-error-boundary": "^4.0.12",
|
"react-error-boundary": "^4.0.12",
|
||||||
"react-router-dom": "^6.21.3",
|
"react-router-dom": "^6.21.3",
|
||||||
"react": "^18.2.0",
|
|
||||||
"swr": "^2.2.4",
|
"swr": "^2.2.4",
|
||||||
"use-debounce": "^9.0.4",
|
"use-debounce": "^9.0.4",
|
||||||
"zustand": "^4.3.8"
|
"zustand": "^4.3.8"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"country-flag-emoji-polyfill": "^0.1.8"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1574,6 +1574,11 @@ cosmiconfig@^7.0.0:
|
|||||||
path-type "^4.0.0"
|
path-type "^4.0.0"
|
||||||
yaml "^1.10.0"
|
yaml "^1.10.0"
|
||||||
|
|
||||||
|
country-flag-emoji-polyfill@^0.1.8:
|
||||||
|
version "0.1.8"
|
||||||
|
resolved "https://registry.yarnpkg.com/country-flag-emoji-polyfill/-/country-flag-emoji-polyfill-0.1.8.tgz#d2cfb23dd2f949b80d83eb9822b613bf62957173"
|
||||||
|
integrity sha512-Mbah52sADS3gshUYhK5142gtUuJpHYOXlXtLFI3Ly4RqgkmPMvhX9kMZSTqDM8P7UqtSW99eHKFphhQSGXA3Cg==
|
||||||
|
|
||||||
cross-spawn@^7.0.0, cross-spawn@^7.0.2:
|
cross-spawn@^7.0.0, cross-spawn@^7.0.2:
|
||||||
version "7.0.3"
|
version "7.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
|
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
|
||||||
|
Loading…
Reference in New Issue
Block a user