diff --git a/hotel-management/README.md b/hotel-management/README.md index 462f6a9..f857acd 100644 --- a/hotel-management/README.md +++ b/hotel-management/README.md @@ -6,7 +6,7 @@ - Introduce: Build a hotel management web application using HTML5, CSS3, Typescript, json-server, React and compile by Vite. - Plan: [Link](https://docs.google.com/document/d/1t2kx17iGCceEe3EbaKO6-3g70ejOJ1PAu9u3KXSKWi4/edit?usp=sharing) -- Deploy: _Update later_ +- Deploy: [Link](https://hotel-management.loiphan.com/) ## Requirements @@ -31,7 +31,7 @@ ## Technical -- [HTML5](https://www.tutorialspoint.com/html5/html5_overview.htm): CSS (Cascading Style Sheets) consist of a group of formatting rules that you use to control the layout and appearance of the content on a web page. +- [HTML5](https://www.tutorialspoint.com/html5/html5_overview.htm): HTML5 is the latest standard of Hypertext Markup Language, the code that describes the structure and presentation of web pages. - [CSS3](https://www.htmlgoodies.com/html5/an-overview-of-css3/): Cascading Style Sheets (CSS) is a language used to illustrate a document’s look, style, and format in any markup language. In simple words, it is used to style and organize the layout of Web pages. CSS3 is the latest version of an earlier CSS version, CSS2. - [Typescript](https://www.typescriptlang.org/): TypeScript is a strongly typed programming language that builds on JavaScript, giving you better tooling at any scale. - [React](https://react.dev/): React is a framework that employs Webpack to automatically compile React, JSX, and ES6 code while handling CSS file prefixes. React is a JavaScript-based UI development library. Although React is a library rather than a language, it is widely used in web development. @@ -42,7 +42,7 @@ - Timeline: - Estimate: 11 days - - Actual: -- days. + - Actual: 13 days. - Calendar: - Start: 2023/10/16 - End: 2023/10/30 diff --git a/hotel-management/src/components/AppLayout/index.tsx b/hotel-management/src/components/AppLayout/index.tsx index 49b39e7..f2f96cd 100644 --- a/hotel-management/src/components/AppLayout/index.tsx +++ b/hotel-management/src/components/AppLayout/index.tsx @@ -10,8 +10,8 @@ import { Main, StyledAppLayout } from './styled'; const AppLayout = () => { return ( -
- +
+
diff --git a/hotel-management/src/components/Dialog/index.tsx b/hotel-management/src/components/Dialog/index.tsx index 1bedac9..d3b010d 100644 --- a/hotel-management/src/components/Dialog/index.tsx +++ b/hotel-management/src/components/Dialog/index.tsx @@ -1,11 +1,19 @@ import { forwardRef } from 'react'; -// Components -import { IDialogProps } from '../../globals/interfaces'; - // Styled import { StyledBody, StyledDialog, StyledTitle } from './styled'; +export interface IDialogProps { + title?: string; + children?: JSX.Element[] | JSX.Element; + onClose?: () => void; + reload?: boolean; + setReload?: React.Dispatch>; + ref?: React.MutableRefObject; + data?: T | null; + isAdd?: boolean; +} + const Dialog = forwardRef((props, ref) => { const { title, children, onClose } = props as IDialogProps; return ( diff --git a/hotel-management/src/components/Header/index.tsx b/hotel-management/src/components/Header/index.tsx index 2d20917..c329fe0 100644 --- a/hotel-management/src/components/Header/index.tsx +++ b/hotel-management/src/components/Header/index.tsx @@ -4,10 +4,14 @@ import HeaderMenu from '../HeaderMenu'; // Styled import { StyledHeader } from './styled'; -const Header = () => { +interface IHeader { + accountName: string +} + +const Header = ({accountName}: IHeader) => { return ( -

Hi, Admin!

+

Hi, {accountName}!

); diff --git a/hotel-management/src/components/FormRow/index.tsx b/hotel-management/src/components/LabelControl/index.tsx similarity index 100% rename from hotel-management/src/components/FormRow/index.tsx rename to hotel-management/src/components/LabelControl/index.tsx diff --git a/hotel-management/src/components/FormRow/styled.ts b/hotel-management/src/components/LabelControl/styled.ts similarity index 100% rename from hotel-management/src/components/FormRow/styled.ts rename to hotel-management/src/components/LabelControl/styled.ts diff --git a/hotel-management/src/components/Menus/Menus.tsx b/hotel-management/src/components/Menus/index.tsx similarity index 95% rename from hotel-management/src/components/Menus/Menus.tsx rename to hotel-management/src/components/Menus/index.tsx index feb529a..b4ef286 100644 --- a/hotel-management/src/components/Menus/Menus.tsx +++ b/hotel-management/src/components/Menus/index.tsx @@ -5,12 +5,15 @@ import { HiEllipsisVertical } from 'react-icons/hi2'; import { useOutsideClick } from '../../hooks/useOutsideClick'; import { StyledMenu, StyledButton, StyledList, StyledToggle } from './styled'; -// Interfaces -import { IButton } from '../../globals/interfaces'; - // Contexts import MenusContext from '../../contexts/MenuContext'; +interface IButton { + children?: string; + icon?: JSX.Element; + onClick?: () => void; +} + const Menus = ({ children }: { children: JSX.Element }) => { const [openId, setOpenId] = useState(''); @@ -30,7 +33,6 @@ const Toggle = ({ id }: { id: string }): React.JSX.Element => { const handleClick = (e: React.MouseEvent) => { e.stopPropagation(); - // prettier-ignore openId === '' || openId !== id ? open!(id) : close!(); diff --git a/hotel-management/src/components/Nav/index.tsx b/hotel-management/src/components/Nav/index.tsx index 4de47fa..6ce3f2a 100644 --- a/hotel-management/src/components/Nav/index.tsx +++ b/hotel-management/src/components/Nav/index.tsx @@ -6,18 +6,21 @@ import { BsHouseDoorFill } from 'react-icons/bs'; // Styled import { StyledNav, StyledNavLink } from './styled'; +// Constants +import { DASHBOARD, ROOM, USER } from '../../constants/path'; + const Nav = () => { return ( - + Dashboard - + User - + Room diff --git a/hotel-management/src/components/Select/index.tsx b/hotel-management/src/components/Select/index.tsx index 448c2be..4f5ee25 100644 --- a/hotel-management/src/components/Select/index.tsx +++ b/hotel-management/src/components/Select/index.tsx @@ -1,6 +1,9 @@ -import { ISelectOptions } from '../../globals/interfaces'; import { StyledSelect } from './styled'; +export interface ISelectOptions { + value: string; + label: string; +} interface ISelect { options: ISelectOptions[]; value: string; diff --git a/hotel-management/src/components/Sidebar/index.tsx b/hotel-management/src/components/Sidebar/index.tsx index 3b0c4d2..3792fe6 100644 --- a/hotel-management/src/components/Sidebar/index.tsx +++ b/hotel-management/src/components/Sidebar/index.tsx @@ -4,10 +4,14 @@ import Nav from '../Nav'; // Styled import { Heading, StyledSidebar } from './styled'; -const Sidebar = () => { +interface ISidebar { + heading: string; +} + +const Sidebar = ({heading}: ISidebar) => { return ( - Hotel Management + {heading}