Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add icbd button in navbar #102

Merged
merged 1 commit into from
Feb 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion directus
36 changes: 36 additions & 0 deletions src/components/NavigationBar.tsx
Original file line number Diff line number Diff line change
@@ -51,6 +51,34 @@ function MenuLink({
</Link>
);
}

function ICBDLink({
side = false,
toggle,
}: {
side?: boolean;
toggle?: () => void;
}) {
const router = useRouter();
console.log(router.asPath);
return (
<Link
className={`${styles.icbdEntry} ${side ? "" : styles.menuItem} ${
router.asPath.startsWith("/icbd") ? styles.icbdEntryHidden : ""
}`}
href="/icbd"
onClick={() => {
if (toggle) {
toggle();
}
router.push("/icbd");
}}
>
<img src="https://clic.epfl.ch/directus/assets/a1c7b3b0-cfb0-441e-b03e-1772d7df56b9?width=150" />
</Link>
);
}

function SubsonicLink({
side = false,
toggle,
@@ -170,6 +198,13 @@ export default function NavigationBar(props: {
text={capitalize(translations["news"])}
toggle={toggleMenu}
/>,
<MenuLink
key={3}
side={true}
path="/icbd"
text="ICBD"
toggle={toggleMenu}
/>,
];

let className;
@@ -192,6 +227,7 @@ export default function NavigationBar(props: {
</Link>

<div className={styles.navigationMenu}>
<ICBDLink />
<MenuLink
path="/association"
text={capitalize(translations["association"])}
16 changes: 16 additions & 0 deletions src/styles/NavigationBar.module.scss
Original file line number Diff line number Diff line change
@@ -61,6 +61,22 @@
background-color: #000000aa;
}

.icbdEntry {
display: flex;
align-content: center;
background: variables.$icbd-gradient;
border-radius: 1rem;
padding: 0.25rem;
border: 2px solid orange;
img {
width: 100px;
height: 100%;
}
}
.icbdEntryHidden {
display: none;
}

.navigationMenu {
display: flex;
flex-direction: row;
Loading