Skip to content

Commit

Permalink
fixed bug of not showing nickname
Browse files Browse the repository at this point in the history
  • Loading branch information
subru-37 committed Dec 2, 2024
1 parent 36dea62 commit e75c2c6
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 14 deletions.
1 change: 1 addition & 0 deletions apps/web-admin/src/components/ProtectedRoute.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export const ProtectedRoute = ({ children }) => {
...preValue,
role: response.data.data.role,
orgId: response.data.data.organizationId,
name: user.nickname,
}));
});
// const { mutate: postOrg } = usePostMutation('/core/organizations', {
Expand Down
14 changes: 10 additions & 4 deletions apps/web-admin/src/layouts/DashboardLayout.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useRouter } from 'next/router';
import { useState, useContext } from 'react';
import { useState, useContext, useEffect } from 'react';
import { Box, useMediaQuery, Flex, Text, Button, useDisclosure } from '@chakra-ui/react';
import { IoMdArrowRoundBack } from 'react-icons/io';
import { RxHamburgerMenu } from 'react-icons/rx';
Expand All @@ -17,7 +17,9 @@ export default function DashboardLayout({ headerButton, children }) {
const [isSidebarOpen, setSidebarOpen] = useState(isMobile);
const { user, isAuthenticated, isLoading } = useAuth0();
const { isOpen, onOpen, onClose } = useDisclosure(); // useDisclosure hook for modal

useEffect(() => {
console.log(router.asPath);
}, [router.asPath]);
if (isAuthenticated) {
return (
<Flex height="100vh" flexDirection="column">
Expand Down Expand Up @@ -66,7 +68,11 @@ export default function DashboardLayout({ headerButton, children }) {
<Flex width="100%" alignItems="center" gap={10}>
<IoMdArrowRoundBack
size={30}
style={{ cursor: 'pointer' }}
style={{
cursor: 'pointer',
display:
router.asPath === `/${accountDetails?.orgId}/events` ? 'none' : 'block',
}}
onClick={() => {
router.back();
}}
Expand All @@ -78,7 +84,7 @@ export default function DashboardLayout({ headerButton, children }) {
width={50}
style={{ cursor: 'pointer' }}
onClick={() => {
router.push(`/${accountDetails?.orgId}`);
router.push(`/${accountDetails?.orgId}/events`);
}}
/>
<Text fontSize="4xl" fontWeight="bold">
Expand Down
32 changes: 22 additions & 10 deletions packages/database/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ enum Role {
model Organization {
id String @id
name String
Logo String?
Tagline String?
Description String?
addressId String?
phoneNo String?
email String?
website String?
twitterLink String?
instagramLink String?
linkedInLink String?
Address Address? @relation(fields: [addressId], references: [id])
OrganizationUser OrganizationUser[]
Event Event[]
Participant Participant[]
Expand All @@ -52,15 +63,16 @@ model OrganizationUser {
user User @relation(fields: [userId], references: [id])
}

model Venue {
id String @id @default(uuid())
name String?
city String?
state String?
country String?
pinCode Int?
locationUrl String?
Event Event[]
model Address {
id String @id @default(uuid())
name String?
city String?
state String?
country String?
pinCode Int?
locationUrl String?
Organization Organization[]
Event Event[]
}

model Event {
Expand All @@ -75,7 +87,7 @@ model Event {
organizationId String
venueId String?
organization Organization @relation(fields: [organizationId], references: [id])
venue Venue? @relation(fields: [venueId], references: [id])
address Address? @relation(fields: [venueId], references: [id])
Participant Participant[]
ParticipantCheckin ParticipantCheckIn[]
attributes Attributes[]
Expand Down

0 comments on commit e75c2c6

Please sign in to comment.