Skip to content

Commit

Permalink
Add link to logo & position fetched nav links before base links
Browse files Browse the repository at this point in the history
  • Loading branch information
camilovegag committed Aug 1, 2024
1 parent 635771a commit 6431e24
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions packages/berlin/src/components/header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,9 @@ import ZupassLoginButton from '../zupass-button';

export default function Header() {
const theme = useAppStore((state) => state.theme);
const { user } = useUser();
const [isMenuOpen, setIsMenuOpen] = useState(false);
const navigate = useNavigate();
const { user } = useUser();

return (
<header className="bg-primary border-secondary border-b text-sm">
Expand All @@ -49,7 +50,7 @@ export default function Header() {
</NavigationMenu>
)}
<section className="mx-auto flex min-h-16 w-[min(90%,1080px)] items-center justify-between">
<div className="flex items-center gap-2">
<div className="flex cursor-pointer items-center gap-2" onClick={() => navigate('/')}>
<img src={`/logos/lexicon-${theme}.svg`} alt="Lexicon Logo" height={32} width={32} />
<h1 className="text-2xl font-semibold leading-6">Lexicon</h1>
</div>
Expand Down Expand Up @@ -129,7 +130,7 @@ const HeaderLinks = ({ user }: { user: GetUserResponse }) => {

const fetchedEventNavLinks = eventNavLinks?.map(({ title, link }) => ({ title, link })) ?? [];

return approvedRegistration ? [...eventBaseLinks, ...fetchedEventNavLinks] : [];
return approvedRegistration ? [...fetchedEventNavLinks, ...eventBaseLinks] : [];
} else {
// User is outside of an event
const baseLinks = [
Expand All @@ -141,7 +142,7 @@ const HeaderLinks = ({ user }: { user: GetUserResponse }) => {

const fetchedNavLinks = navLinks?.map(({ title, link }) => ({ title, link })) ?? [];

return [...baseLinks, ...fetchedNavLinks];
return [...fetchedNavLinks, ...baseLinks];
}
}, [eventId, eventNavLinks, navLinks, registrationsData]);

Expand Down

0 comments on commit 6431e24

Please sign in to comment.