Skip to content

Commit

Permalink
Add link to /cms in global nav if user is admin
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa committed Feb 9, 2024
1 parent 4c71b3e commit da9ef36
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/locales/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export default {
bookmarks: "Bookmarks",
tutorials: "Tutorials",
glossary: "Glossary",
cms: "Dashboard",
sponsor: "Sponsor me on GitHub",
login: "Access",
logout: "Sign Out",
Expand Down
4 changes: 3 additions & 1 deletion app/routes/_/route.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@ function Header() {
{ name: t("tutorials"), to: "/tutorials" },
{ name: t("bookmarks"), to: "/bookmarks" },
{ name: t("glossary"), to: "/glossary" },
] as const;
];

if (user?.role === "admin") navigation.push({ name: t("cms"), to: "/cms" });

let query = searchParams.get("q") ?? "";

Expand Down

0 comments on commit da9ef36

Please sign in to comment.