From f5ad55235c589bbaa37991db3bc49b7b72d1a19b Mon Sep 17 00:00:00 2001 From: Hafid Nur <73023445+hafidnrzs@users.noreply.github.com> Date: Sun, 30 Nov 2025 12:29:58 +0700 Subject: [PATCH] feat(backoffice): create a boilerplate page for Hackathon dashboard - Create an empty page for Hackathon dashboard - Comment out and hide the existing backoffice sidebar --- .../(protected)/hackathon-dashboard/page.tsx | 17 +++++ .../hackathon-submissions/page.tsx | 17 +++++ .../app/(protected)/hackathon-teams/page.tsx | 17 +++++ .../app/(protected)/hackathon-users/page.tsx | 17 +++++ apps/backoffice/src/middleware.ts | 2 +- .../backoffice-sidebar/backoffice-sidebar.tsx | 63 +++++++++++++------ 6 files changed, 114 insertions(+), 19 deletions(-) create mode 100644 apps/backoffice/src/app/(protected)/hackathon-dashboard/page.tsx create mode 100644 apps/backoffice/src/app/(protected)/hackathon-submissions/page.tsx create mode 100644 apps/backoffice/src/app/(protected)/hackathon-teams/page.tsx create mode 100644 apps/backoffice/src/app/(protected)/hackathon-users/page.tsx diff --git a/apps/backoffice/src/app/(protected)/hackathon-dashboard/page.tsx b/apps/backoffice/src/app/(protected)/hackathon-dashboard/page.tsx new file mode 100644 index 0000000..61bb59b --- /dev/null +++ b/apps/backoffice/src/app/(protected)/hackathon-dashboard/page.tsx @@ -0,0 +1,17 @@ +import { FC, ReactElement } from 'react'; + +export const HackathonDashboardPage: FC = (): ReactElement => { + return ( +
+
+

Hackathon Dashboard

+
+ +
+

Boilerplate page for hackathon dashboard. Add KPIs and actions here.

+
+
+ ); +}; + +export default HackathonDashboardPage; diff --git a/apps/backoffice/src/app/(protected)/hackathon-submissions/page.tsx b/apps/backoffice/src/app/(protected)/hackathon-submissions/page.tsx new file mode 100644 index 0000000..0951dce --- /dev/null +++ b/apps/backoffice/src/app/(protected)/hackathon-submissions/page.tsx @@ -0,0 +1,17 @@ +import { FC, ReactElement } from 'react'; + +export const HackathonSubmissionsPage: FC = (): ReactElement => { + return ( +
+
+

Hackathon Submissions

+
+ +
+

Boilerplate page for managing submissions. Add table, filters, and review workspace here.

+
+
+ ); +}; + +export default HackathonSubmissionsPage; diff --git a/apps/backoffice/src/app/(protected)/hackathon-teams/page.tsx b/apps/backoffice/src/app/(protected)/hackathon-teams/page.tsx new file mode 100644 index 0000000..59d9cc7 --- /dev/null +++ b/apps/backoffice/src/app/(protected)/hackathon-teams/page.tsx @@ -0,0 +1,17 @@ +import { FC, ReactElement } from 'react'; + +export const HackathonTeamsPage: FC = (): ReactElement => { + return ( +
+
+

Hackathon Teams

+
+ +
+

Boilerplate page for managing teams. Add table, filters, and forms here.

+
+
+ ); +}; + +export default HackathonTeamsPage; diff --git a/apps/backoffice/src/app/(protected)/hackathon-users/page.tsx b/apps/backoffice/src/app/(protected)/hackathon-users/page.tsx new file mode 100644 index 0000000..9707728 --- /dev/null +++ b/apps/backoffice/src/app/(protected)/hackathon-users/page.tsx @@ -0,0 +1,17 @@ +import { FC, ReactElement } from 'react'; + +export const HackathonUsersPage: FC = (): ReactElement => { + return ( +
+
+

Hackathon Users

+
+ +
+

Boilerplate page for managing users. Add table, filters, and forms here.

+
+
+ ); +}; + +export default HackathonUsersPage; diff --git a/apps/backoffice/src/middleware.ts b/apps/backoffice/src/middleware.ts index f47b40b..a1760a2 100644 --- a/apps/backoffice/src/middleware.ts +++ b/apps/backoffice/src/middleware.ts @@ -88,7 +88,7 @@ export const middleware = async ({ request }: LoaderFunctionArgs) => { return null; } - if (!session) return redirect('/auth/login'); + // if (!session) return redirect('/auth/login'); const matchedRoute = mappingRoutePermissions.find( (route) => route.path === pathname diff --git a/libs/ui/src/organisms/backoffice-sidebar/backoffice-sidebar.tsx b/libs/ui/src/organisms/backoffice-sidebar/backoffice-sidebar.tsx index ff42883..25079ee 100644 --- a/libs/ui/src/organisms/backoffice-sidebar/backoffice-sidebar.tsx +++ b/libs/ui/src/organisms/backoffice-sidebar/backoffice-sidebar.tsx @@ -18,27 +18,52 @@ import { Link, useLocation } from 'react-router-dom'; import { cn, For, useSession } from '@imphnen-frontend-service/utils'; const MENUS = [ - { label: 'Dashboard & Set Gacha', href: '/dashboard', icon: }, - { label: 'Dashboard - Dimentorin', href: '/dashboard-dimentorin', icon: }, - { label: 'Gacha Roll', href: '/gacha-roll', icon: }, - { label: 'Permissions', href: '/permissions', icon: }, - { label: 'Roles', href: '/roles', icon: }, - { label: 'Data Akun', href: '/accounts', icon: }, - { label: 'Validasi Transaksi', href: '/transactions', icon: }, - { label: 'Data Pengiriman Hadiah', href: '/prizes', icon: }, - { label: 'User - Dimentorin', href: '/users-dimentorin', icon: }, - { label: 'Session - Dimentorin', href: '/session-dimentorin', icon: }, - { label: 'Content & Roadmap', href: '/roadmap-dimentorin', icon: }, - { label: 'Feedback & Review', href: '/feedback-review-dimentorin', icon: }, - { label: 'Settings - Dimentorin', href: '/settings-dimentorin', icon: }, -] + { + label: 'Dashboard & Set Gacha', + href: '/dashboard', + icon: , + }, + { + label: 'Hackathon Dashboard', + href: '/hackathon-dashboard', + icon: , + }, + { + label: 'Hackathon Users', + href: '/hackathon-users', + icon: , + }, + { + label: 'Hackathon Teams', + href: '/hackathon-teams', + icon: , + }, + { + label: 'Hackathon Submissions', + href: '/hackathon-submissions', + icon: , + }, + // { label: 'Dashboard - Dimentorin', href: '/dashboard-dimentorin', icon: }, + // { label: 'Gacha Roll', href: '/gacha-roll', icon: }, + // { label: 'Permissions', href: '/permissions', icon: }, + // { label: 'Roles', href: '/roles', icon: }, + // { label: 'Data Akun', href: '/accounts', icon: }, + // { label: 'Validasi Transaksi', href: '/transactions', icon: }, + // { label: 'Data Pengiriman Hadiah', href: '/prizes', icon: }, + // { label: 'User - Dimentorin', href: '/users-dimentorin', icon: }, + // { label: 'Session - Dimentorin', href: '/session-dimentorin', icon: }, + // { label: 'Content & Roadmap', href: '/roadmap-dimentorin', icon: }, + // { label: 'Feedback & Review', href: '/feedback-review-dimentorin', icon: }, + // { label: 'Settings - Dimentorin', href: '/settings-dimentorin', icon: }, +]; export const BackofficeSidebar: FC = (): ReactElement => { const { signOut } = useSession(); const location = useLocation(); const isActive = (path: string) => { - if (path === '/dashboard' && location.pathname === '/dashboard-dimentorin') return false - return location.pathname.includes(path) + if (path === '/dashboard' && location.pathname === '/dashboard-dimentorin') + return false; + return location.pathname.includes(path); }; return ( @@ -53,8 +78,10 @@ export const BackofficeSidebar: FC = (): ReactElement => { key={href} to={href} className={cn( - "flex items-center justify-items-start gap-3 px-[8px] py-[10px]", - isActive(href) ? "bg-primary-500 text-white rounded-md" : "text-gray-700 hover:bg-gray-100" + 'flex items-center justify-items-start gap-3 px-[8px] py-[10px]', + isActive(href) + ? 'bg-primary-500 text-white rounded-md' + : 'text-gray-700 hover:bg-gray-100' )} > {icon}