From 45eba50509d3b76378e3887dd0fc6f0549641fbf Mon Sep 17 00:00:00 2001 From: Loi Phan Date: Thu, 30 Nov 2023 14:13:03 +0700 Subject: [PATCH 1/2] Add edit information account page --- hotel-management/src/App.tsx | 3 + .../src/components/Sidebar/index.tsx | 5 +- .../src/components/Sidebar/styled.ts | 2 + .../hooks/authentication/useUpdateAccount.ts | 25 +++++ .../src/pages/Account/AccountInforForm.tsx | 59 ++++++++++++ .../src/pages/Account/AccountPasswordForm.tsx | 93 +++++++++++++++++++ hotel-management/src/pages/Account/index.tsx | 26 ++++++ hotel-management/src/pages/Account/styled.ts | 36 +++++++ .../src/services/authenticationService.ts | 27 +++++- 9 files changed, 274 insertions(+), 2 deletions(-) create mode 100644 hotel-management/src/hooks/authentication/useUpdateAccount.ts create mode 100644 hotel-management/src/pages/Account/AccountInforForm.tsx create mode 100644 hotel-management/src/pages/Account/AccountPasswordForm.tsx create mode 100644 hotel-management/src/pages/Account/index.tsx create mode 100644 hotel-management/src/pages/Account/styled.ts diff --git a/hotel-management/src/App.tsx b/hotel-management/src/App.tsx index e6edaa6..3f2c121 100644 --- a/hotel-management/src/App.tsx +++ b/hotel-management/src/App.tsx @@ -16,6 +16,7 @@ import Booking from './pages/Booking'; import Room from './pages/Room'; import NotFound from './pages/NotFound'; import Login from '@page/Login'; +import Account from '@page/Account'; // Constants import * as PATH from './constants/path'; @@ -74,6 +75,7 @@ function App() { return ( + {/* */} @@ -93,6 +95,7 @@ function App() { } /> } /> } /> + } /> } /> } /> diff --git a/hotel-management/src/components/Sidebar/index.tsx b/hotel-management/src/components/Sidebar/index.tsx index b393109..7d97768 100644 --- a/hotel-management/src/components/Sidebar/index.tsx +++ b/hotel-management/src/components/Sidebar/index.tsx @@ -3,15 +3,18 @@ import Nav from '@component/Nav'; // Styled import { Heading, StyledSidebar } from './styled'; +import { useNavigate } from 'react-router-dom'; interface ISidebar { heading: string; } const Sidebar = ({ heading }: ISidebar) => { + const navigate = useNavigate(); + return ( - {heading} + navigate('/')}>{heading}