fix: styles
This commit is contained in:
parent
d39039a458
commit
772397189f
@ -15,6 +15,7 @@ export const QUIZ_QUESTION_BASE: Omit<QuizQuestionBase, "id"> = {
|
||||
rule: {
|
||||
or: true,
|
||||
show: true,
|
||||
title: "",
|
||||
reqs: [
|
||||
{
|
||||
id: "",
|
||||
|
@ -10,7 +10,7 @@ export const QUIZ_QUESTION_NUMBER: Omit<QuizQuestionNumber, "id"> = {
|
||||
required: false,
|
||||
innerNameCheck: false,
|
||||
innerName: "",
|
||||
range: "",
|
||||
range: "1—100",
|
||||
defaultValue: 0,
|
||||
step: 1,
|
||||
steps: 5,
|
||||
|
@ -14,6 +14,7 @@ export interface QuestionBranchingRule {
|
||||
/** Радиокнопка "Все условия обязательны" */
|
||||
or: boolean;
|
||||
show: boolean;
|
||||
title: string;
|
||||
reqs: {
|
||||
id: string;
|
||||
/** Список выбранных вариантов */
|
||||
|
@ -17,7 +17,7 @@ import {
|
||||
import {
|
||||
questionStore,
|
||||
updateQuestionsList,
|
||||
removeQuestion,
|
||||
removeQuestionForce,
|
||||
createQuestion,
|
||||
} from "@root/questions";
|
||||
import { BUTTON_TYPE_QUESTIONS } from "../TypeQuestions";
|
||||
@ -131,7 +131,7 @@ export const ChooseAnswerModal = ({
|
||||
|
||||
const question = listQuestions[quizId][totalIndex];
|
||||
|
||||
removeQuestion(quizId, totalIndex);
|
||||
removeQuestionForce(quizId, totalIndex);
|
||||
createQuestion(quizId, selectedValue, totalIndex);
|
||||
updateQuestionsList<QuizQuestionBase>(quizId, totalIndex, {
|
||||
expanded: question.expanded,
|
||||
|
@ -156,20 +156,23 @@ export default function RatingOptions({ totalIndex }: Props) {
|
||||
</Box>
|
||||
{!question.content.ratingDescription && (
|
||||
<Box
|
||||
ref={negativeRef}
|
||||
sx={{
|
||||
position: "absolute",
|
||||
opacity: 0,
|
||||
zIndex: "-100",
|
||||
whiteSpace: "nowrap",
|
||||
fontSize: "16px",
|
||||
mb: "20px",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "space-between",
|
||||
maxWidth: isMobile ? "303px" : "290px",
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
<Typography
|
||||
ref={negativeRef}
|
||||
sx={{
|
||||
color: theme.palette.grey2.main,
|
||||
position: "absolute",
|
||||
opacity: 0,
|
||||
zIndex: "-100",
|
||||
whiteSpace: "nowrap",
|
||||
fontSize: "16px",
|
||||
fontWeight: 400,
|
||||
}}
|
||||
>
|
||||
{negativeText}
|
||||
|
@ -99,7 +99,7 @@ export default function UploadFile({ totalIndex }: Props) {
|
||||
<Select
|
||||
id="category-select"
|
||||
variant="outlined"
|
||||
value={question.type}
|
||||
value={question.content.type}
|
||||
displayEmpty
|
||||
onChange={handleChange}
|
||||
sx={{
|
||||
@ -181,7 +181,10 @@ export default function UploadFile({ totalIndex }: Props) {
|
||||
>
|
||||
Пользователь может загрузить любой собственный файл
|
||||
</Typography>
|
||||
<Tooltip title="Можно загрузить файл в желаемом формате." placement="top">
|
||||
<Tooltip
|
||||
title="Можно загрузить файл в желаемом формате."
|
||||
placement="top"
|
||||
>
|
||||
<Box>
|
||||
<InfoIcon />
|
||||
</Box>
|
||||
|
@ -40,6 +40,7 @@ export default function SettingsUpload({ totalIndex }: SettingsUploadProps) {
|
||||
pt: "20px",
|
||||
pb: "20px",
|
||||
pl: "20px",
|
||||
gap: "15px",
|
||||
}}
|
||||
>
|
||||
<Typography>Настройки вопроса</Typography>
|
||||
@ -84,7 +85,10 @@ export default function SettingsUpload({ totalIndex }: SettingsUploadProps) {
|
||||
});
|
||||
}}
|
||||
/>
|
||||
<Tooltip title="Будет отображаться как заголовок вопроса в приходящих заявках." placement="top">
|
||||
<Tooltip
|
||||
title="Будет отображаться как заголовок вопроса в приходящих заявках."
|
||||
placement="top"
|
||||
>
|
||||
<Box>
|
||||
<InfoIcon />
|
||||
</Box>
|
||||
@ -95,6 +99,10 @@ export default function SettingsUpload({ totalIndex }: SettingsUploadProps) {
|
||||
placeholder={"Развёрнутое описание вопроса"}
|
||||
text={question.content.innerName}
|
||||
onChange={({ target }) => debounced(target.value)}
|
||||
sx={{
|
||||
boxSizing: "border-box",
|
||||
paddingRight: "20px",
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</Box>
|
||||
|
@ -45,12 +45,12 @@ export default function BranchingQuestions({
|
||||
totalIndex,
|
||||
}: BranchingQuestionsProps) {
|
||||
const theme = useTheme();
|
||||
const [title, setTitle] = useState<string>("");
|
||||
const [titleInputWidth, setTitleInputWidth] = useState<number>(0);
|
||||
const quizId = Number(useParams().quizId);
|
||||
const { openedModalSettings, listQuestions } = questionStore();
|
||||
const titleRef = useRef<HTMLDivElement>(null);
|
||||
const question = listQuestions[quizId][totalIndex] as QuizQuestionBase;
|
||||
const [title, setTitle] = useState<string>(question.title);
|
||||
|
||||
useEffect(() => {
|
||||
setTitleInputWidth(titleRef.current?.offsetWidth || 0);
|
||||
|
Loading…
Reference in New Issue
Block a user