From e2a2ee343bc694a0bcc3e683f28ad4a9689e3648 Mon Sep 17 00:00:00 2001 From: Ahmed Elsakaan Date: Mon, 31 Jul 2023 19:51:52 +0100 Subject: [PATCH] feat(web): feedback dialog default to user email --- apps/web/src/components/ActiveLink.tsx | 2 +- apps/web/src/layouts/dashboard/feedback.tsx | 139 ++++++++++---------- apps/web/src/layouts/dashboard/index.tsx | 66 +++++++++- apps/web/src/pages/_app.tsx | 40 +++++- apps/web/src/pages/app/modules.tsx | 23 ++++ apps/web/src/utils/api.ts | 4 + packages/config/eslint/base.js | 8 ++ packages/ui/src/button.tsx | 5 +- 8 files changed, 209 insertions(+), 78 deletions(-) create mode 100644 apps/web/src/pages/app/modules.tsx diff --git a/apps/web/src/components/ActiveLink.tsx b/apps/web/src/components/ActiveLink.tsx index a8b91704..d3dfa72c 100644 --- a/apps/web/src/components/ActiveLink.tsx +++ b/apps/web/src/components/ActiveLink.tsx @@ -14,7 +14,7 @@ type ActiveLinkProps = LinkProps & const ActiveLink = forwardRef( ({ className, activeClassName, href, ...props }, ref) => { const router = useRouter(); - const active = router.pathname.startsWith(href); + const active = href === router.pathname; return ( { +const FeedbackForm: FC<{ email?: string | undefined }> = ({ email }) => { const { mutateAsync, isLoading, isSuccess } = api.feedback.add.useMutation(); const form = useForm>({ resolver: zodResolver(formSchema), defaultValues: { - email: '', + email: email ?? '', message: '', }, }); @@ -56,10 +58,75 @@ export const FeedbackDialog = () => { } }; + return ( +
+ +
+ ( + + Email Address + + + + + + )} + /> + + ( + + Message + +