Skip to content

Commit

Permalink
feat(web-admin): Update participants, organizations and events page (#…
Browse files Browse the repository at this point in the history
…261)

* Updated Organizations

* Updated events

* Updated participants

* Updated participant format
  • Loading branch information
adilmp1 authored Feb 3, 2024
1 parent 19cc985 commit 84d4bfd
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,42 @@ export default function Events() {
</Text>
</Box>
<Box width="100%" height="100%">
{JSON.stringify(participant)}
<Table variant="striped" colorScheme="">
<Tbody>
<Tr>
<Td>id</Td>
<Td>{participant.id}</Td>
</Tr>
<Tr>
<Td>createdAt</Td>
<Td>{participant.createdAt}</Td>
</Tr>
<Tr>
<Td>firstName</Td>
<Td>{participant.firstName}</Td>
</Tr>
<Tr>
<Td>lastName</Td>
<Td>{participant.lastName}</Td>
</Tr>
<Tr>
<Td>eventId</Td>
<Td>{participant.eventId}</Td>
</Tr>
<Tr>
<Td>organizationId</Td>
<Td>{participant.organizationId}</Td>
</Tr>
<Tr>
<Td>participantCheckIn</Td>
<Td>{JSON.stringify(participant.participantCheckIn)}</Td>
</Tr>
<Tr>
<Td>updatedAt</Td>
<Td>{participant.updatedAt}</Td>
</Tr>
</Tbody>
</Table>
</Box>
</Flex>
</DashboardLayout>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Tr,
TableContainer,
Text,
Button,
} from '@chakra-ui/react';

import { useFetch } from '@/hooks/useFetch';
Expand All @@ -28,6 +29,9 @@ export default function Events() {
const { loading, get } = useFetch();

const [participants, setParticipants] = useState([]);
const handleClick = () => {
router.push(`/organizations/${orgId}/events/${eventId}/participants/new/`);
};

useEffect(() => {
const fetchParticipants = async () => {
Expand All @@ -50,10 +54,20 @@ export default function Events() {
justifyContent="center"
gap={8}
>
<Box width="100%" p={8}>
<Box width="100%" p={8} display="flex" justifyContent="space-between">
<Text fontSize="4xl" fontWeight="bold">
Participants
</Text>
<Button
padding="4"
minWidth="-moz-initial"
bgColor="rgb(128, 90, 213)"
color="white"
_hover={{ bgColor: 'rgb(100, 70, 183)' }}
onClick={handleClick}
>
Add Participant
</Button>
</Box>
<Box width="100%" height="100%">
<TableContainer width="100%" height="100%">
Expand Down
17 changes: 15 additions & 2 deletions apps/web-admin/src/pages/organizations/[orgId]/events/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
Tr,
TableContainer,
Text,
Button,
} from '@chakra-ui/react';

import { useFetch } from '@/hooks/useFetch';
Expand All @@ -28,7 +29,9 @@ export default function Events() {
const { loading, get } = useFetch();

const [events, setEvents] = useState([]);

const handleClick = () => {
router.push(`/organizations/${orgId}/events/new/`);
};
useEffect(() => {
const fetchEvents = async () => {
const { data, status } = await get(`/core/organizations/${orgId}/events`);
Expand All @@ -48,10 +51,20 @@ export default function Events() {
justifyContent="center"
gap={8}
>
<Box width="100%" p={8}>
<Box width="100%" p={8} display="flex" justifyContent="space-between">
<Text fontSize="4xl" fontWeight="bold">
Events
</Text>
<Button
padding="4"
minWidth="-moz-initial"
bgColor="rgb(128, 90, 213)"
color="white"
_hover={{ bgColor: 'rgb(100, 70, 183)' }}
onClick={handleClick}
>
Add Event
</Button>
</Box>
<Box width="100%" height="100%">
<TableContainer width="100%" height="100%">
Expand Down
18 changes: 15 additions & 3 deletions apps/web-admin/src/pages/organizations/index.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { useRouter } from 'next/router';

import {
Box,
Flex,
Expand All @@ -13,6 +12,7 @@ import {
Tr,
TableContainer,
Text,
Button,
} from '@chakra-ui/react';

import { useFetch } from '@/hooks/useFetch';
Expand All @@ -36,7 +36,9 @@ export default function Organizations() {
};
fetchOrganizations();
}, []);

const handleClick = () => {
router.push('organizations/new');
};
return (
<DashboardLayout>
<Flex
Expand All @@ -47,10 +49,20 @@ export default function Organizations() {
justifyContent="center"
gap={8}
>
<Box width="100%" p={8}>
<Box width="100%" p={8} display="flex" justifyContent="space-between">
<Text fontSize="4xl" fontWeight="bold">
Organizations
</Text>
<Button
padding="4"
minWidth="-moz-initial"
bgColor="rgb(128, 90, 213)"
color="white"
_hover={{ bgColor: 'rgb(100, 70, 183)' }}
onClick={handleClick}
>
Add Organization
</Button>
</Box>
<Box width="100%" height="100%">
<TableContainer width="100%" height="100%">
Expand Down

0 comments on commit 84d4bfd

Please sign in to comment.