Skip to content

Commit

Permalink
fix: commissions links
Browse files Browse the repository at this point in the history
  • Loading branch information
Thechi2000 committed Mar 16, 2024
1 parent 425b1a8 commit 1a2c75a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default function Card(
props.commission,
router.locale
).small_description;
link = `/commission/${props.commission.slug}`;
link = `/commissions/${props.commission.slug}`;
} else {
img = props.img;
title = props.title;
Expand Down
15 changes: 9 additions & 6 deletions app/src/components/NavigationBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import styles from "@/styles/NavigationBar.module.scss";
import { Commission } from "@/types/aliases";
import { Schema } from "@/types/schema";
import Link from "next/link";
import { useRouter } from "next/router";

type LinkRef = {
title: string;
Expand All @@ -29,7 +30,8 @@ export default function NavigationBar(props: {
commissions?: Commission[];
langs: Schema["languages"];
}) {
console.log(props.langs);
const router = useRouter();

return (
<div className={styles.navigationBar}>
<Link href="/" className={styles.corner}>
Expand All @@ -55,7 +57,7 @@ export default function NavigationBar(props: {
return (
<Link
key={c.slug}
href={`/${c.slug}`}
href={`/commissions/${c.slug}`}
className={styles.menuItem}
>
{c.name}
Expand Down Expand Up @@ -84,14 +86,15 @@ export default function NavigationBar(props: {
head={<Lang className={styles.lang + " " + styles.dropdownHead} />}
>
{props.langs.map((l) => (
<Link
href=""
locale={l.code}
<div
key={l.code}
className={styles.menuItem}
onClick={() =>
router.push(router.asPath, undefined, { locale: l.code })
}
>
{l.name}
</Link>
</div>
))}
</DropdownMenu>
) : (
Expand Down

0 comments on commit 1a2c75a

Please sign in to comment.