-
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.
- Loading branch information
Showing
6 changed files
with
108 additions
and
4 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
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
91 changes: 91 additions & 0 deletions
91
apps/web-admin/src/pages/[orgId]/events/[eventId]/navigationmenu.jsx
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,91 @@ | ||
/* | ||
// the idea with menu | ||
import { Menu, MenuButton, MenuList, MenuItem, Button } from '@chakra-ui/react'; | ||
import { ChevronDownIcon } from '@chakra-ui/icons'; | ||
import { useRouter } from 'next/router'; | ||
const NavigationMenu = ({ orgId, eventId }) => { | ||
const router = useRouter(); | ||
const menuLabels = ['Participants', 'Participants Check In', 'Attributes', 'Extras']; | ||
console.log("navigation menu loaded") | ||
return ( | ||
<> | ||
<Menu> | ||
<MenuButton as={Button} rightIcon={<ChevronDownIcon />}> | ||
Go to ... | ||
</MenuButton> | ||
<MenuList> | ||
{menuLabels.map((label) => { | ||
const path = `/${orgId}/events/${eventId}/${ | ||
label === 'Participants Check In' ? 'participants/check-in' : label.toLowerCase() | ||
}`; | ||
return ( | ||
<MenuItem key={label} onClick={() => router.push(path)}> | ||
{label} | ||
</MenuItem> | ||
); | ||
})} | ||
</MenuList> | ||
</Menu> | ||
</> | ||
); | ||
};*/ | ||
|
||
|
||
const NavigationMenu = ({orgId, eventId}) => { | ||
return ( | ||
<Box | ||
width="100%" | ||
backgroundColor="#e6f7f5" | ||
py={2} | ||
px={2} | ||
borderRadius="8px" | ||
display={{ base: 'block', md: 'flex' }} | ||
> | ||
<VStack spacing={2} align="stretch" display={{ base: 'flex', md: 'none' }}> | ||
{['participants', 'check-in', 'attributes', 'extras'].map((tab) => ( | ||
<Button | ||
key={tab} | ||
style={tabStyle(activeTab === tab)} | ||
onClick={() => { | ||
setActiveTab(tab); | ||
const element = tab === 'check-in' ? 'participants/check-in' : tab; | ||
router.push(`/${orgId}/events/${eventId}/${element}`); | ||
}} | ||
> | ||
{tab === 'check-in' | ||
? 'Participant Check In' | ||
: tab.replace(/(^\w|\s\w)/g, (m) => m.toUpperCase())} | ||
</Button> | ||
))} | ||
</VStack> | ||
|
||
<Flex | ||
justifyContent="space-evenly" | ||
alignItems="center" | ||
width="100%" | ||
display={{ base: 'none', md: 'flex' }} // Horizontal layout on desktop | ||
> | ||
{['participants', 'check-in', 'attributes', 'extras'].map((tab) => ( | ||
<Button | ||
key={tab} | ||
style={tabStyle(activeTab === tab)} | ||
onClick={() => { | ||
setActiveTab(tab); | ||
const element = tab === 'check-in' ? 'participants/check-in' : tab; | ||
router.push( | ||
`/${orgId}/events/${eventId}/${element} | ||
`, | ||
); | ||
}} | ||
> | ||
{tab === 'check-in' | ||
? 'Participant Check In' | ||
: tab.replace(/(^\w|\s\w)/g, (m) => m.toUpperCase())} | ||
</Button> | ||
))} | ||
</Flex> | ||
</Box> | ||
) | ||
} | ||
export default NavigationMenu; |
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