fix: styles

This commit is contained in:
IlyaDoronin 2023-10-06 11:34:44 +03:00
parent d39039a458
commit 772397189f
8 changed files with 31 additions and 15 deletions

@ -15,6 +15,7 @@ export const QUIZ_QUESTION_BASE: Omit<QuizQuestionBase, "id"> = {
rule: { rule: {
or: true, or: true,
show: true, show: true,
title: "",
reqs: [ reqs: [
{ {
id: "", id: "",

@ -10,7 +10,7 @@ export const QUIZ_QUESTION_NUMBER: Omit<QuizQuestionNumber, "id"> = {
required: false, required: false,
innerNameCheck: false, innerNameCheck: false,
innerName: "", innerName: "",
range: "", range: "1—100",
defaultValue: 0, defaultValue: 0,
step: 1, step: 1,
steps: 5, steps: 5,

@ -14,6 +14,7 @@ export interface QuestionBranchingRule {
/** Радиокнопка "Все условия обязательны" */ /** Радиокнопка "Все условия обязательны" */
or: boolean; or: boolean;
show: boolean; show: boolean;
title: string;
reqs: { reqs: {
id: string; id: string;
/** Список выбранных вариантов */ /** Список выбранных вариантов */

@ -17,7 +17,7 @@ import {
import { import {
questionStore, questionStore,
updateQuestionsList, updateQuestionsList,
removeQuestion, removeQuestionForce,
createQuestion, createQuestion,
} from "@root/questions"; } from "@root/questions";
import { BUTTON_TYPE_QUESTIONS } from "../TypeQuestions"; import { BUTTON_TYPE_QUESTIONS } from "../TypeQuestions";
@ -131,7 +131,7 @@ export const ChooseAnswerModal = ({
const question = listQuestions[quizId][totalIndex]; const question = listQuestions[quizId][totalIndex];
removeQuestion(quizId, totalIndex); removeQuestionForce(quizId, totalIndex);
createQuestion(quizId, selectedValue, totalIndex); createQuestion(quizId, selectedValue, totalIndex);
updateQuestionsList<QuizQuestionBase>(quizId, totalIndex, { updateQuestionsList<QuizQuestionBase>(quizId, totalIndex, {
expanded: question.expanded, expanded: question.expanded,

@ -156,20 +156,23 @@ export default function RatingOptions({ totalIndex }: Props) {
</Box> </Box>
{!question.content.ratingDescription && ( {!question.content.ratingDescription && (
<Box <Box
ref={negativeRef}
sx={{ sx={{
position: "absolute", mb: "20px",
opacity: 0, display: "flex",
zIndex: "-100", alignItems: "center",
whiteSpace: "nowrap", justifyContent: "space-between",
fontSize: "16px", maxWidth: isMobile ? "303px" : "290px",
width: "100%",
}} }}
> >
<Typography <Typography
ref={negativeRef}
sx={{ sx={{
color: theme.palette.grey2.main, position: "absolute",
opacity: 0,
zIndex: "-100",
whiteSpace: "nowrap",
fontSize: "16px", fontSize: "16px",
fontWeight: 400,
}} }}
> >
{negativeText} {negativeText}

@ -99,7 +99,7 @@ export default function UploadFile({ totalIndex }: Props) {
<Select <Select
id="category-select" id="category-select"
variant="outlined" variant="outlined"
value={question.type} value={question.content.type}
displayEmpty displayEmpty
onChange={handleChange} onChange={handleChange}
sx={{ sx={{
@ -181,7 +181,10 @@ export default function UploadFile({ totalIndex }: Props) {
> >
Пользователь может загрузить любой собственный файл Пользователь может загрузить любой собственный файл
</Typography> </Typography>
<Tooltip title="Можно загрузить файл в желаемом формате." placement="top"> <Tooltip
title="Можно загрузить файл в желаемом формате."
placement="top"
>
<Box> <Box>
<InfoIcon /> <InfoIcon />
</Box> </Box>

@ -40,6 +40,7 @@ export default function SettingsUpload({ totalIndex }: SettingsUploadProps) {
pt: "20px", pt: "20px",
pb: "20px", pb: "20px",
pl: "20px", pl: "20px",
gap: "15px",
}} }}
> >
<Typography>Настройки вопроса</Typography> <Typography>Настройки вопроса</Typography>
@ -84,7 +85,10 @@ export default function SettingsUpload({ totalIndex }: SettingsUploadProps) {
}); });
}} }}
/> />
<Tooltip title="Будет отображаться как заголовок вопроса в приходящих заявках." placement="top"> <Tooltip
title="Будет отображаться как заголовок вопроса в приходящих заявках."
placement="top"
>
<Box> <Box>
<InfoIcon /> <InfoIcon />
</Box> </Box>
@ -95,6 +99,10 @@ export default function SettingsUpload({ totalIndex }: SettingsUploadProps) {
placeholder={"Развёрнутое описание вопроса"} placeholder={"Развёрнутое описание вопроса"}
text={question.content.innerName} text={question.content.innerName}
onChange={({ target }) => debounced(target.value)} onChange={({ target }) => debounced(target.value)}
sx={{
boxSizing: "border-box",
paddingRight: "20px",
}}
/> />
)} )}
</Box> </Box>

@ -45,12 +45,12 @@ export default function BranchingQuestions({
totalIndex, totalIndex,
}: BranchingQuestionsProps) { }: BranchingQuestionsProps) {
const theme = useTheme(); const theme = useTheme();
const [title, setTitle] = useState<string>("");
const [titleInputWidth, setTitleInputWidth] = useState<number>(0); const [titleInputWidth, setTitleInputWidth] = useState<number>(0);
const quizId = Number(useParams().quizId); const quizId = Number(useParams().quizId);
const { openedModalSettings, listQuestions } = questionStore(); const { openedModalSettings, listQuestions } = questionStore();
const titleRef = useRef<HTMLDivElement>(null); const titleRef = useRef<HTMLDivElement>(null);
const question = listQuestions[quizId][totalIndex] as QuizQuestionBase; const question = listQuestions[quizId][totalIndex] as QuizQuestionBase;
const [title, setTitle] = useState<string>(question.title);
useEffect(() => { useEffect(() => {
setTitleInputWidth(titleRef.current?.offsetWidth || 0); setTitleInputWidth(titleRef.current?.offsetWidth || 0);