Skip to content

Commit

Permalink
feat: 質問への回答を必須にするボタンを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
rito528 committed May 1, 2024
1 parent 9bcc121 commit 2dc1864
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/app/(authed)/admin/forms/create/_components/Question.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@ import { Add } from '@mui/icons-material';
import DeleteIcon from '@mui/icons-material/Delete';
import {
Button,
FormControlLabel,
IconButton,
MenuItem,
Stack,
TextField,
Typography,
} from '@mui/material';
import Checkbox from '@mui/material/Checkbox';
import { useCallback } from 'react';
import { useController, useFieldArray, useWatch } from 'react-hook-form';
import type { Form } from '../_schema/createFormSchema';
Expand Down Expand Up @@ -103,6 +105,13 @@ const QuestionComponent = ({
<MenuItem value="SINGLE">単一選択</MenuItem>
<MenuItem value="MULTIPLE">複数選択</MenuItem>
</TextField>
<FormControlLabel
label="この質問への回答を必須にする"
control={
<Checkbox {...register(`questions.${questionId}.is_required`)} />
}
required
/>
<Button
variant="outlined"
startIcon={<Add />}
Expand Down

0 comments on commit 2dc1864

Please sign in to comment.