diff --git a/app/javascript/pages/dashboard/Filters.tsx b/app/javascript/pages/dashboard/Filters.tsx index 3ba3ea2..92fabf4 100644 --- a/app/javascript/pages/dashboard/Filters.tsx +++ b/app/javascript/pages/dashboard/Filters.tsx @@ -1,12 +1,12 @@ -import React, {FC, Fragment} from 'react' -import {Disclosure, Transition} from "@headlessui/react" -import {ChevronDownIcon, XIcon} from "@heroicons/react/outline" -import {useForm} from "react-hook-form" +import React, { FC, Fragment } from 'react' +import { Disclosure, Transition } from "@headlessui/react" +import { ChevronDownIcon, XIcon } from "@heroicons/react/outline" +import { useForm } from "react-hook-form" -import {QuestionWhereInput} from "../../__generated__/graphql-schema" -import {useDashboardContext, whereDefaultState} from "./DashboardContext" -import {useCurrentUser} from "../../contexts" -import {Button, Input} from "../../components" +import { QuestionWhereInput } from "../../__generated__/graphql-schema" +import { useDashboardContext, whereDefaultState } from "./DashboardContext" +import { useCurrentUser } from "../../contexts" +import { Button, Input } from "../../components" type FilterBarForm = { fromOtherUsers?: boolean @@ -36,12 +36,12 @@ const mapFilter = (values: FilterBarForm, userId?: string): QuestionWhereInput = }) const FiltersForm: FC = () => { - const {register, handleSubmit, reset, getValues, formState} = useForm({ + const { register, handleSubmit, reset, getValues, formState } = useForm({ defaultValues: formDefaultValues, }) - const {setWhere} = useDashboardContext() + const { setWhere } = useDashboardContext() const userContext = useCurrentUser() - const {user, isOnlyTeacher} = userContext + const { user, isOnlyTeacher } = userContext const onSubmit = (values: FilterBarForm) => { reset(getValues()) @@ -58,50 +58,50 @@ const FiltersForm: FC = () => { onSubmit={handleSubmit(onSubmit)} className={"flex justify-between"} > - - -
- - -
-
+ + +
+ + +
+
{!isOnlyTeacher && ( - +