* feat(ui): some design mocks * fix(ui): some fixes for stuff * feat(ui): test overview page layout * feat(ui): fix placeholder * feat(ui): answers table modal * feat(tracker): user testing module in tracker * fix(tracker): add "thank you" section, refactor file to make it readable * fix(tracker): naming * fix(tracker): naming * fix(tracker): some refactorings for user testing modd * feat(tracker): export assist vers to window obj, add recorder manager for user testing * feat(tracker): refactor UT file * feat(tracker): add recording delay for UT module * feat(tracker): dnd for UT widget * fix(tracker): changelog for assist * fix(tracker): cover ut with tests * fix(tracker): update package scripts to include testing before releasing packages * fix(UI): fix uxt routes * feat(ui): uxt store * feat(ui): uxt store connection * feat(ui): some api connections for utx * feat(ui): some api connections for utx * feat(ui): some api connections for utx * feat(ui): api connections * feat(ui): api connections * feat(ui): api connections * feat(ui): api connections * feat(ui): utx components for replay * feat(ui): utx components for replay * feat(ui): make events shared * feat(ui): final fixes
63 lines
No EOL
2 KiB
TypeScript
63 lines
No EOL
2 KiB
TypeScript
import { UxTask } from "App/services/UxtestingService";
|
|
import React from 'react'
|
|
import { Button, Input, Switch, Typography } from 'antd'
|
|
|
|
function StepsModal({ onAdd, onHide }: { onAdd: (step: UxTask) => void; onHide: () => void }) {
|
|
const [title, setTitle] = React.useState('');
|
|
const [description, setDescription] = React.useState('');
|
|
const [isAnswerEnabled, setIsAnswerEnabled] = React.useState(false);
|
|
|
|
const save = () => {
|
|
onAdd({
|
|
title: title,
|
|
description: description || '',
|
|
allowTyping: isAnswerEnabled,
|
|
});
|
|
onHide();
|
|
};
|
|
return (
|
|
<div className={'h-screen p-4 bg-white flex flex-col gap-4'}>
|
|
<Typography.Title style={{ marginBottom: 0 }} level={4}>
|
|
Add a task or question
|
|
</Typography.Title>
|
|
<div className={'flex flex-col gap-1 items-start'}>
|
|
<Typography.Title level={5} style={{ marginBottom: 4 }}>
|
|
Title/Question
|
|
</Typography.Title>
|
|
<Input
|
|
value={title}
|
|
onChange={(e) => setTitle(e.target.value)}
|
|
placeholder={'Task title'}
|
|
/>
|
|
<Typography.Title level={5} style={{ marginBottom: 4 }}>
|
|
Instructions
|
|
</Typography.Title>
|
|
<Input.TextArea
|
|
value={description}
|
|
onChange={(e) => setDescription(e.target.value)}
|
|
placeholder={'Task instructions'}
|
|
/>
|
|
<Typography.Title level={5} style={{ marginBottom: 4 }}>
|
|
Allow participants to type an answer
|
|
</Typography.Title>
|
|
<Switch
|
|
checked={isAnswerEnabled}
|
|
onChange={(checked) => setIsAnswerEnabled(checked)}
|
|
checkedChildren="Yes"
|
|
unCheckedChildren="No"
|
|
/>
|
|
<div className={'text-disabled-text'}>
|
|
Enabling this option will show a text field for participants to type their answer.
|
|
</div>
|
|
</div>
|
|
<div className={'flex gap-2'}>
|
|
<Button type={'primary'} onClick={save}>
|
|
Add
|
|
</Button>
|
|
<Button onClick={onHide}>Cancel</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default StepsModal; |