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

Add leaderboard to staff/admin dashboard #485

Merged
merged 5 commits into from
Nov 6, 2023
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 2 additions & 2 deletions components/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ const roleNavigations = {
"vault",
"identifier",
],
admin: ["scanner", "visitors", "badges", "users", "events"],
manager: ["badges", "prizes", "identifier"],
admin: ["scanner", "visitors", "badges", "leaderboard", "users", "events"],
manager: ["badges", "leaderboard", "prizes", "identifier"],
};

type LayoutProps = {
Expand Down
1 change: 1 addition & 0 deletions context/Auth/withAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export function withAuth(WrappedComponent) {
"/manager/prizes",
"/manager/prizes/[uuid]",
"/manager/identifier",
"/manager/leaderboard",
"/attendees/[uuid]",
].includes(router.pathname)
) {
Expand Down
9 changes: 1 addition & 8 deletions layout/Manager/Badges/Badges.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import ErrorMessage from "@components/ErrorMessage";
import Filter from "@components/BadgeFilter";
import QRScanner, { FEEDBACK } from "@components/QRScanner";

const navigation = ["badges", "prizes", "identifier"];

function Badges() {
const [allBadges, updateAllBadges] = useState([]);
const [filter, updateFilter] = useState(null);
Expand Down Expand Up @@ -71,12 +69,7 @@ function Badges() {
};

return (
<Layout
title="Badges"
description="Award a badge"
navigation={navigation}
basePath="manager"
>
<Layout title="Badges" description="Award a badge" basePath="manager">
{showScanner ? (
<div className="mt-5">
<QRScanner
Expand Down
3 changes: 0 additions & 3 deletions layout/Manager/Identifier/Identifier.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ import { withAuth } from "@context/Auth";
import Layout from "@components/Layout";
import QRScanner, { FEEDBACK } from "@components/QRScanner";

const navigation = ["badges", "prizes", "identifier"];

function Identifier() {
const pauseRef = useRef(false);
const [text, setText] = useState("None");
Expand Down Expand Up @@ -54,7 +52,6 @@ function Identifier() {
<Layout
title="Identifier"
description="Identify an attendee"
navigation={navigation}
basePath="manager"
>
<div className="mt-5">
Expand Down
3 changes: 0 additions & 3 deletions layout/Manager/Prize/Prize.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ import { withAuth } from "@context/Auth";
import Layout from "@components/Layout";
import Button from "@components/Button";

const navigation = ["badges", "prizes", "identifier"];

function Prize() {
const router = useRouter();
const { uuid } = router.query;
Expand Down Expand Up @@ -61,7 +59,6 @@ function Prize() {
<Layout
title="Prizes"
description="Mark a prize as redeemed"
navigation={navigation}
basePath="manager"
>
<div className="my-5">
Expand Down
3 changes: 0 additions & 3 deletions layout/Manager/Prizes/Prizes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ import { withAuth, useAuth } from "@context/Auth";
import Layout from "@components/Layout";
import QRScanner, { FEEDBACK } from "@components/QRScanner";

const navigation = ["badges", "prizes", "identifier"];

function Prizes() {
const { user } = useAuth();
const router = useRouter();
Expand All @@ -23,7 +21,6 @@ function Prizes() {
<Layout
title="Prizes"
description="Mark a prize as redeemed"
navigation={navigation}
basePath="manager"
>
<div className="mt-5">
Expand Down
2 changes: 1 addition & 1 deletion pages/attendee/leaderboard.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { default } from "@layout/Attendee/Leaderboard";
export { default } from "@layout/shared/Leaderboard";
1 change: 1 addition & 0 deletions pages/manager/leaderboard.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { default } from "@layout/shared/Leaderboard";
Loading