From f149873b904de1b09935beddf2a680aaada4c6b0 Mon Sep 17 00:00:00 2001 From: JOZEF ANTONY NEELAMKAVIL <67110139+jzf21@users.noreply.github.com> Date: Fri, 9 Feb 2024 23:23:49 +0530 Subject: [PATCH] fix(web-client): Make row clickable in datagrid (#287) * feat(web-admin) add Datagrid to particpants * fix(web-admin):make links clickable --- apps/web-admin/src/components/ProtectedRoute.jsx | 1 + .../[orgId]/events/[eventId]/participants/index.jsx | 3 +++ 2 files changed, 4 insertions(+) diff --git a/apps/web-admin/src/components/ProtectedRoute.jsx b/apps/web-admin/src/components/ProtectedRoute.jsx index 08d14f4e..c91c1b45 100644 --- a/apps/web-admin/src/components/ProtectedRoute.jsx +++ b/apps/web-admin/src/components/ProtectedRoute.jsx @@ -2,6 +2,7 @@ import { useEffect } from 'react'; import { useRouter } from 'next/router'; import { useAuth0 } from '@auth0/auth0-react'; import { Spinner, VStack, AbsoluteCenter } from '@chakra-ui/react'; + export const ProtectedRoute = ({ children }) => { const router = useRouter(); const { user, isAuthenticated, isLoading, loginWithRedirect } = useAuth0(); diff --git a/apps/web-admin/src/pages/organizations/[orgId]/events/[eventId]/participants/index.jsx b/apps/web-admin/src/pages/organizations/[orgId]/events/[eventId]/participants/index.jsx index 44354616..1bafeae4 100644 --- a/apps/web-admin/src/pages/organizations/[orgId]/events/[eventId]/participants/index.jsx +++ b/apps/web-admin/src/pages/organizations/[orgId]/events/[eventId]/participants/index.jsx @@ -43,6 +43,9 @@ export default function Events() { const handleClick1 = () => { router.push(`/organizations/${orgId}/events/${eventId}/participants/new/upload-csv`); }; + const handleRowClick = (row) => { + router.push(`/organizations/${orgId}/events/${eventId}/participants/${row.id}`); + }; const handleRowClick = (row) => { router.push(`/organizations/${orgId}/events/${eventId}/participants/${row.id}`);