import { Button, Input, Switch, Typography } from 'antd'; import React from 'react'; import { UxTask } from 'App/services/UxtestingService'; function StepsModal({ onAdd, onHide, editTask, typingEnabled, }: { onAdd: (step: UxTask) => void; onHide: () => void; editTask?: UxTask; typingEnabled?: boolean; }) { const [title, setTitle] = React.useState(editTask?.title ?? ''); const [description, setDescription] = React.useState( editTask?.description ?? '' ); const [isAnswerEnabled, setIsAnswerEnabled] = React.useState( editTask?.allowTyping ?? typingEnabled ); const save = () => { onAdd({ title: title, description: description || '', allowTyping: Boolean(isAnswerEnabled), }); onHide(); }; return (
Add a task or question
Title/Question setTitle(e.target.value)} placeholder={'Task title'} />
Example:
  • Task: Finding a specific product on shopping.com
  • Question: Find a specific product on shopping.com?
Instructions setDescription(e.target.value)} placeholder={'Task instructions'} />
Example:
  1. Search for "Sustainable T-shirt".
  2. Pick a product from the results.
  3. Note/Callout the ease of finding it.
Allow participants to type an answer setIsAnswerEnabled(checked)} checkedChildren="Yes" unCheckedChildren="No" />
Enabling this option will show a text field for participants to type their answer.
); } export default StepsModal;