diff --git a/codegen.yml b/codegen.yml
index 9e3af2d..bee28c3 100644
--- a/codegen.yml
+++ b/codegen.yml
@@ -9,3 +9,4 @@ generates:
skipTypename: true
scalars:
ID: number
+ Time: Date | string
diff --git a/src/common/AppLayout/components/Sidebar/Sidebar.tsx b/src/common/AppLayout/components/Sidebar/Sidebar.tsx
index 4b8e7e3..2a76837 100644
--- a/src/common/AppLayout/components/Sidebar/Sidebar.tsx
+++ b/src/common/AppLayout/components/Sidebar/Sidebar.tsx
@@ -16,6 +16,7 @@ import {
Group as GroupIcon,
Work as WorkIcon,
Description as DescriptionIcon,
+ QuestionAnswer as QuestionAnswerIcon,
} from '@material-ui/icons';
import Nav from './components/Nav/Nav';
import CurrentUser from './components/CurrentUser/CurrentUser';
@@ -51,6 +52,12 @@ const Sidebar = ({ className, open, variant, onClose, onOpen }: Props) => {
exact: true,
Icon: ,
},
+ {
+ name: 'Pytania',
+ to: Route.QuestionsPage,
+ exact: true,
+ Icon: ,
+ },
];
useEffect(() => {
diff --git a/src/features/QuestionsPage/components/FormDialog/FormDialog.tsx b/src/features/QuestionsPage/components/FormDialog/FormDialog.tsx
index db3ba03..28a57f0 100644
--- a/src/features/QuestionsPage/components/FormDialog/FormDialog.tsx
+++ b/src/features/QuestionsPage/components/FormDialog/FormDialog.tsx
@@ -1,7 +1,6 @@
-import { useForm } from 'react-hook-form';
+import { useForm, Controller } from 'react-hook-form';
import { pick } from 'lodash';
-import { MAX_NAME_LENGTH } from './constants';
-import { QuestionInput, Question } from 'libs/graphql/types';
+import { QuestionInput, Question, Maybe, Answer } from 'libs/graphql/types';
import { makeStyles } from '@material-ui/core/styles';
import {
@@ -11,9 +10,11 @@ import {
DialogContent,
DialogProps,
DialogTitle,
+ MenuItem,
TextField,
} from '@material-ui/core';
-import { Maybe } from 'graphql/jsutils/Maybe';
+
+const ANSWERS = Object.keys(Answer);
export interface FormDialogProps extends Pick {
question?: Maybe;
@@ -27,6 +28,7 @@ const FormDialog = ({ open, onClose, question, onSubmit }: FormDialogProps) => {
register,
handleSubmit,
errors,
+ control,
formState: { isSubmitting },
} = useForm({});
const classes = useStyles();
@@ -59,18 +61,73 @@ const FormDialog = ({ open, onClose, question, onSubmit }: FormDialogProps) => {
+
+
+
+ {ANSWERS.map(answer => (
+
+ ))}
+
+ }
+ />
+ {ANSWERS.map(answer => {
+ const upper = answer.toUpperCase();
+ return (
+ //(question as any)[`answer${upper}`]
+
+ );
+ })}