Skip to content

Commit

Permalink
fix: specify fab conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
Donghyun Hwang committed Nov 3, 2024
1 parent 40202aa commit df6c277
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import './App.css';
import { Routes, Route, useLocation } from 'react-router-dom';
import { Routes, Route, useLocation, useMatch } from 'react-router-dom';
import Header from '@components/Header';
import Home from '@pages/Home/Home';
import Login from '@pages/Login/Login';
Expand All @@ -24,8 +24,9 @@ import CSRoutes from '@pages/CS/CSRoutes';
import { About } from '@pages/About';

function App() {
const location = useLocation();
const isInHome = location.pathname === '/';
//
const isInAttendanceList = useMatch('/attendance/list/generation/:generationId');
const isInHome = useMatch('/');

//
//
Expand All @@ -38,8 +39,6 @@ function App() {
}
}, [isInHome]);

const isAttendance = useLocation().pathname.includes('/attendance');

//
//
//
Expand Down Expand Up @@ -68,7 +67,7 @@ function App() {
<Route path="/signin" element={<Login />} />
<Route path="/*" element={<NotFound />} />
</Routes>
{isAttendance ? <AttendanceFab /> : <CotatoGlobalFab />}
{isInAttendanceList ? <AttendanceFab /> : <CotatoGlobalFab />}
</CotatoThemeProvider>
</div>
);
Expand Down

0 comments on commit df6c277

Please sign in to comment.