diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx index 1cbe74b..db732fe 100644 --- a/src/frontend/src/App.tsx +++ b/src/frontend/src/App.tsx @@ -40,7 +40,7 @@ export default function App() { } /> : } + element={auth.isAdmin ? : } /> } /> diff --git a/src/frontend/src/pages/AdminPage.tsx b/src/frontend/src/pages/AdminPage.tsx index ae3fce1..07661b0 100644 --- a/src/frontend/src/pages/AdminPage.tsx +++ b/src/frontend/src/pages/AdminPage.tsx @@ -1,7 +1,7 @@ import { useEffect, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { api } from '../api/client'; -import type { AdminUser, AuthResponse } from '../api/types'; +import type { AdminUser } from '../api/types'; const PURPLE = '#5b4fc7'; const PURPLE_DEEP = '#3f33a8'; @@ -10,7 +10,6 @@ const SAGE_DEEP = '#a9bb96'; const PAPER = '#f4f3ee'; interface AdminPageProps { - auth: AuthResponse; onLogout: () => void; } @@ -18,7 +17,7 @@ function monogram(name: string): string { return name.split(' ').map((n) => n[0]).join('').slice(0, 2).toUpperCase(); } -export function AdminPage({ auth, onLogout }: AdminPageProps) { +export function AdminPage({ onLogout }: AdminPageProps) { const navigate = useNavigate(); const [users, setUsers] = useState([]); const [loading, setLoading] = useState(true); diff --git a/src/frontend/src/pages/PlannerPage.tsx b/src/frontend/src/pages/PlannerPage.tsx index 036f77b..c24a7a0 100644 --- a/src/frontend/src/pages/PlannerPage.tsx +++ b/src/frontend/src/pages/PlannerPage.tsx @@ -84,7 +84,6 @@ export function PlannerPage({ auth, onLogout }: PlannerPageProps) { const today = toIsoDate(new Date()); const MAX_OFFSET = 13; - const maxDate = offsetDate(today, MAX_OFFSET); const [selectedDate, setSelectedDate] = useState(today); const [schedule, setSchedule] = useState([]);