Skip to content

Commit

Permalink
chore: change managers to staffs (#568)
Browse files Browse the repository at this point in the history
  • Loading branch information
MarioRodrigues10 authored Nov 9, 2023
1 parent a74b6b4 commit 41dc6ab
Show file tree
Hide file tree
Showing 27 changed files with 25 additions and 25 deletions.
4 changes: 2 additions & 2 deletions components/Base/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ const MobileNavbar = ({
{navigation.map((item) => (
<Link
key={item}
href={`/manager/${item}`}
href={`/staff/${item}`}
className={classNames(
item == href
? "bg-primary text-quinary"
Expand Down Expand Up @@ -105,7 +105,7 @@ const MobileNavbar = ({
export default function Dashboard({
title,
href,
baseHref = "/manager",
baseHref = "/staff",
description,
navigation,
children,
Expand Down
2 changes: 1 addition & 1 deletion components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const roleNavigations = {
"identifier",
],
admin: ["scanner", "visitors", "badges", "leaderboard", "users", "events"],
manager: ["badges", "leaderboard", "prizes", "identifier"],
staff: ["badges", "leaderboard", "prizes", "identifier"],
};

type LayoutProps = {
Expand Down
8 changes: 4 additions & 4 deletions components/Navbar/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ const userNavigation = (type) => {
switch (type) {
case USER.ROLES.ATTENDEE:
return [{ name: "Dashboard", slug: "/attendee/profile" }];
case USER.ROLES.MANAGER:
case USER.ROLES.STAFF:
return [
{ name: "Leaderboard", slug: "/manager/leaderboard" },
{ name: "Give Badges", slug: "/manager/badges" },
{ name: "Give Prizes", slug: "/manager/prizes" },
{ name: "Leaderboard", slug: "/staff/leaderboard" },
{ name: "Give Badges", slug: "/staff/badges" },
{ name: "Give Prizes", slug: "/staff/prizes" },
];
case USER.ROLES.SPONSOR:
return [
Expand Down
8 changes: 4 additions & 4 deletions context/Auth/AuthProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ export function AuthProvider({ children }) {
case USER.ROLES.SPONSOR:
router.push("/sponsor/scanner");
break;
case USER.ROLES.MANAGER:
router.push("/manager/badges");
case USER.ROLES.STAFF:
router.push("/staff/badges");
break;
default:
throw new Error(`Unknown USER TYPE: ${response.type}`);
Expand Down Expand Up @@ -98,8 +98,8 @@ export function AuthProvider({ children }) {
case USER.ROLES.SPONSOR:
router.push("/sponsor/scanner");
break;
case USER.ROLES.MANAGER:
router.push("/manager/badges");
case USER.ROLES.STAFF:
router.push("/staff/badges");
break;
default:
throw new Error(`Unknown USER TYPE: ${response.type}`);
Expand Down
14 changes: 7 additions & 7 deletions context/Auth/withAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ export function withAuth(WrappedComponent) {
return router.replace("/404");
}
break;
case USER.ROLES.MANAGER:
case USER.ROLES.STAFF:
if (
![
"/manager/badges",
"/manager/prizes",
"/manager/prizes/[uuid]",
"/manager/identifier",
"/manager/leaderboard",
"/staff/badges",
"/staff/prizes",
"/staff/prizes/[uuid]",
"/staff/identifier",
"/staff/leaderboard",
"/attendees/[uuid]",
].includes(router.pathname)
) {
Expand All @@ -51,7 +51,7 @@ export function withAuth(WrappedComponent) {
![
"/sponsor/scanner",
"/attendees/[uuid]",
"/manager/badges",
"/staff/badges",
"/sponsor/visitors",
].includes(router.pathname)
) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function Prizes() {
const [showScanner, setScanner] = useState(true);

const handleUUID = (uuid) => {
router.push(`/manager/prizes/${uuid}`);
router.push(`/staff/prizes/${uuid}`);
};

return (
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ export async function getCurrentUser() {
} = await API.get(`/api/attendees/${attendee.id}`);

return { ...attendee, ...extras, type };
case USER.ROLES.MANAGER:
case USER.ROLES.STAFF:
return response.data;
case USER.ROLES.SPONSOR:
const { data: company } = await API.get("/api/company");
Expand Down
2 changes: 1 addition & 1 deletion lib/user.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export const ROLES = {
ATTENDEE: "attendee",
SPONSOR: "company",
MANAGER: "manager",
STAFF: "staff",
};
1 change: 0 additions & 1 deletion pages/manager/badges.js

This file was deleted.

1 change: 0 additions & 1 deletion pages/manager/identifier.js

This file was deleted.

1 change: 0 additions & 1 deletion pages/manager/prizes/[uuid].js

This file was deleted.

1 change: 0 additions & 1 deletion pages/manager/prizes/index.js

This file was deleted.

1 change: 1 addition & 0 deletions pages/staff/badges.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "@layout/Staff/Badges";
1 change: 1 addition & 0 deletions pages/staff/identifier.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "@layout/Staff/Identifier";
File renamed without changes.
1 change: 1 addition & 0 deletions pages/staff/prizes/[uuid].js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "@layout/Staff/Prize";
1 change: 1 addition & 0 deletions pages/staff/prizes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "@layout/Staff/Prizes";

0 comments on commit 41dc6ab

Please sign in to comment.