diff --git a/packages/api/src/index.ts b/packages/api/src/index.ts index 382499e9..b54797fb 100644 --- a/packages/api/src/index.ts +++ b/packages/api/src/index.ts @@ -1,5 +1,6 @@ export { default as deleteComment } from './deleteComment'; export { default as deleteLike } from './deleteLike'; +export { default as fetchAlerts } from './fetchAlerts'; export { default as fetchCommentLikes } from './fetchCommentLikes'; export { default as fetchComments } from './fetchComments'; export { default as fetchCycle } from './fetchCycle'; @@ -17,6 +18,7 @@ export { default as fetchRegistrations } from './fetchRegistrations'; export { default as fetchUserAttributes } from './fetchUserAttributes'; export { default as fetchUserData } from './fetchUserData'; export { default as fetchUserGroups } from './fetchUserGroups'; +export { default as fetchUserRegistrations } from './fetchUserRegistrations'; export { default as fetchUserVotes } from './fetchUserVotes'; export { default as logout } from './logout'; export { default as postComment } from './postComment'; @@ -28,5 +30,4 @@ export { default as postUserToGroups } from './postUserToGroups'; export { default as postVotes } from './postVotes'; export { default as putRegistration } from './putRegistration'; export { default as updateUserData } from './updateUserData'; -export { default as fetchAlerts } from './fetchAlerts'; export * from './types'; diff --git a/packages/berlin/src/components/header/Header.tsx b/packages/berlin/src/components/header/Header.tsx index 248865b6..1a6e73c4 100644 --- a/packages/berlin/src/components/header/Header.tsx +++ b/packages/berlin/src/components/header/Header.tsx @@ -10,7 +10,7 @@ import { useAppStore } from '../../store'; import header from '../../data/header'; // API -import { fetchAlerts, logout } from 'api'; +import { fetchAlerts, fetchEvents, fetchUserRegistrations, logout } from 'api'; // Hooks import useUser from '../../hooks/useUser'; @@ -38,7 +38,6 @@ import { LogoTextContainer, ThemeButton, } from './Header.styled'; -import fetchUserRegistrations from 'api/src/fetchUserRegistrations'; function Header() { const queryClient = useQueryClient(); @@ -69,6 +68,12 @@ function Header() { enabled: !!user, }); + const { data: events } = useQuery({ + queryKey: ['events'], + queryFn: () => fetchEvents(), + enabled: !!user, + }); + const [isBurgerMenuOpen, setIsBurgerMenuOpen] = useState(false); return ( @@ -96,13 +101,18 @@ function Header() { return ( alert.link && alert.title && ( - + {alert.title} ) ); })} - + Agenda @@ -141,13 +151,13 @@ function Header() { return ( alert.link && alert.title && ( - + {alert.title} ) ); })} - + Agenda diff --git a/packages/berlin/src/components/nav-button/NavButton.tsx b/packages/berlin/src/components/nav-button/NavButton.tsx index fcb26ef4..d1aec6e6 100644 --- a/packages/berlin/src/components/nav-button/NavButton.tsx +++ b/packages/berlin/src/components/nav-button/NavButton.tsx @@ -6,11 +6,12 @@ type NavButtonProps = { $color?: 'primary' | 'secondary'; children: React.ReactNode; onClick?: () => void; + end?: boolean; }; -function NavButton({ to, children, $color = 'primary', onClick }: NavButtonProps) { +function NavButton({ to, children, end, $color = 'primary', onClick }: NavButtonProps) { return ( - +