-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Added new features to the sidebar (#445)
* added new features in taskbar * added coming soon page
- Loading branch information
Showing
6 changed files
with
222 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Heading } from '@chakra-ui/react'; | ||
import { Highlight } from '@chakra-ui/react'; | ||
import { color } from 'framer-motion'; | ||
import React from 'react'; | ||
|
||
const ComingSoon = () => { | ||
return ( | ||
<div | ||
style={{ | ||
display: 'flex', | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
flexDirection: 'column', | ||
gap: '2rem', | ||
height: '75%', | ||
}} | ||
> | ||
<Heading as="h1" size="4xl"> | ||
<Highlight | ||
query="Coming Soon !" | ||
styles={{ | ||
px: '6', | ||
py: '1', | ||
rounded: 'full', | ||
bg: '#319795', | ||
color: 'whiteAlpha.900', | ||
}} | ||
> | ||
Coming Soon ! | ||
</Highlight> | ||
</Heading> | ||
<Heading as="h3" size="lg"> | ||
Check back soon for updates. | ||
</Heading> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ComingSoon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import { useState, useEffect } from 'react'; | ||
import { useFetch } from '@/hooks/useFetch'; | ||
import { useAlert } from '@/hooks/useAlert'; | ||
import { | ||
Box, | ||
UnorderedList, | ||
ListItem, | ||
Link, | ||
Text, | ||
Accordion, | ||
AccordionItem, | ||
AccordionButton, | ||
AccordionPanel, | ||
AccordionIcon, | ||
SkeletonText, | ||
} from '@chakra-ui/react'; | ||
|
||
import NextLink from 'next/link'; | ||
import { MdOutlineEvent } from 'react-icons/md'; | ||
import { useRouter } from 'next/router'; | ||
|
||
const EventsDisplay = () => { | ||
const [events, setEvents] = useState([]); | ||
|
||
const router = useRouter(); | ||
const { orgId } = router.query; | ||
|
||
const showAlert = useAlert(); | ||
const { loading, get } = useFetch(); | ||
|
||
useEffect(() => { | ||
if (orgId) { | ||
const fetchEvents = async () => { | ||
const { data, status } = await get(`/core/organizations/${orgId}/events`); | ||
if (status === 200) { | ||
setEvents(data.events || []); | ||
} else { | ||
showAlert({ | ||
title: 'Error', | ||
description: data.error, | ||
status: 'error', | ||
}); | ||
} | ||
}; | ||
fetchEvents(); | ||
} | ||
}, [orgId]); | ||
|
||
if (!orgId || loading) { | ||
return ( | ||
<div> | ||
<SkeletonText m={[4, 2, 4, 2]} noOfLines={2} spacing="4" skeletonHeight="2" /> | ||
</div> | ||
); | ||
} | ||
|
||
if (events.length === 0) { | ||
return <div>No events found for this organization.</div>; | ||
} | ||
|
||
return ( | ||
<Accordion allowToggle> | ||
<AccordionItem border="none"> | ||
<AccordionButton | ||
_hover={{ color: 'black.400', backgroundColor: 'gray.100', cursor: 'pointer' }} | ||
transition="outline 0.2s" | ||
borderRadius="md" | ||
padding="2" | ||
display="flex" | ||
flexDirection="row" | ||
alignItems="center" | ||
> | ||
<Box mr={2}> | ||
<MdOutlineEvent /> | ||
</Box> | ||
<Text fontSize="lg">Events</Text> | ||
<AccordionIcon /> | ||
</AccordionButton> | ||
<AccordionPanel pb={4}> | ||
<UnorderedList> | ||
{events.map((event) => ( | ||
<ListItem key={event.id}> | ||
<Link as={NextLink} href={`/${orgId}/events/${event.id}`} passHref> | ||
{event.name} | ||
</Link> | ||
</ListItem> | ||
))} | ||
</UnorderedList> | ||
</AccordionPanel> | ||
</AccordionItem> | ||
</Accordion> | ||
); | ||
}; | ||
|
||
export default EventsDisplay; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { useRouter } from 'next/router'; | ||
import DashboardLayout from '@/layouts/DashboardLayout'; | ||
import ComingSoon from '@/components/ComingSoon'; | ||
|
||
const EmailSettings = () => { | ||
const router = useRouter(); | ||
const { orgId } = router.query; | ||
return ( | ||
<DashboardLayout pageTitle="Email Settings" previousPage={`${orgId}`}> | ||
<ComingSoon /> | ||
</DashboardLayout> | ||
); | ||
}; | ||
|
||
export default EmailSettings; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { useRouter } from 'next/router'; | ||
import DashboardLayout from '@/layouts/DashboardLayout'; | ||
import ComingSoon from '@/components/ComingSoon'; | ||
|
||
const MyCertificates = () => { | ||
const router = useRouter(); | ||
const { orgId } = router.query; | ||
return ( | ||
<DashboardLayout pageTitle="My Certificates" previousPage={`${orgId}`}> | ||
<ComingSoon /> | ||
</DashboardLayout> | ||
); | ||
}; | ||
|
||
export default MyCertificates; |