diff --git a/hotel-management/src/App.tsx b/hotel-management/src/App.tsx index 4c4e178..73442b3 100644 --- a/hotel-management/src/App.tsx +++ b/hotel-management/src/App.tsx @@ -1,22 +1,27 @@ import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'; + +// Components import AppLayout from './ui/AppLayout'; import User from './pages/User'; import Dashboard from './pages/Dashboard'; import Room from './pages/Room'; import NotFound from './pages/NotFound'; +// Constants +import * as PATH from './constants/path'; + function App() { return ( <> }> - } /> - } /> - } /> - } /> + } /> + } /> + } /> + } /> - } /> + } /> diff --git a/hotel-management/src/constants/path.ts b/hotel-management/src/constants/path.ts new file mode 100644 index 0000000..98c28d3 --- /dev/null +++ b/hotel-management/src/constants/path.ts @@ -0,0 +1,4 @@ +export const DASHBOARD: string = '/dashboard'; +export const USER: string = '/user'; +export const ROOM: string = '/room'; +export const OTHER_PATH: string = '*'; diff --git a/hotel-management/src/ui/AppLayout.tsx b/hotel-management/src/ui/AppLayout.tsx index f5ed854..85e3c80 100644 --- a/hotel-management/src/ui/AppLayout.tsx +++ b/hotel-management/src/ui/AppLayout.tsx @@ -1,7 +1,9 @@ import styled from 'styled-components'; +import { Outlet } from 'react-router-dom'; + +// Components import Header from './Header'; import Sidebar from './Sidebar'; -import { Outlet } from 'react-router-dom'; const StyledAppLayout = styled.div` display: grid; diff --git a/hotel-management/src/ui/Header.tsx b/hotel-management/src/ui/Header.tsx index 271827c..f5f794c 100644 --- a/hotel-management/src/ui/Header.tsx +++ b/hotel-management/src/ui/Header.tsx @@ -1,4 +1,6 @@ import styled from 'styled-components'; + +// Components import HeaderMenu from './HeaderMenu'; const StyledHeader = styled.header` diff --git a/hotel-management/src/ui/HeaderMenu.tsx b/hotel-management/src/ui/HeaderMenu.tsx index d9615ba..8c2efc3 100644 --- a/hotel-management/src/ui/HeaderMenu.tsx +++ b/hotel-management/src/ui/HeaderMenu.tsx @@ -1,8 +1,10 @@ import styled from 'styled-components'; -import ButtonIcon from './ButtonIcon'; import { IoPersonCircleOutline } from 'react-icons/io5'; import { HiOutlineLogout } from 'react-icons/hi'; +// Components +import ButtonIcon from './ButtonIcon'; + const StyledHeaderMenu = styled.ul` display: flex; gap: 10px; diff --git a/hotel-management/src/ui/Nav.tsx b/hotel-management/src/ui/Nav.tsx index 40cbf8d..818ac9c 100644 --- a/hotel-management/src/ui/Nav.tsx +++ b/hotel-management/src/ui/Nav.tsx @@ -4,7 +4,7 @@ import { MdSpaceDashboard } from 'react-icons/md'; import { HiUsers } from 'react-icons/hi2'; import { BsHouseDoorFill } from 'react-icons/bs'; -const StyledNav = styled.div` +const StyledNav = styled.nav` margin-top: 70px; display: flex; flex-direction: column; diff --git a/hotel-management/src/ui/Sidebar.tsx b/hotel-management/src/ui/Sidebar.tsx index 1ee16eb..518a9f9 100644 --- a/hotel-management/src/ui/Sidebar.tsx +++ b/hotel-management/src/ui/Sidebar.tsx @@ -1,4 +1,6 @@ import styled from 'styled-components'; + +// Components import Nav from './Nav'; const StyledSidebar = styled.aside`