generated from ngyngcphu/react-template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(navigation): create template for navigation bar
- Loading branch information
Showing
8 changed files
with
62 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React, { ReactNode } from 'react'; | ||
import { Drawer } from '@material-tailwind/react'; | ||
|
||
export const AppDrawer: Component<{ | ||
open: boolean; | ||
children: ReactNode; | ||
onClose: () => void; | ||
}> = ({ open, children, onClose }) => { | ||
return ( | ||
<React.Fragment> | ||
<Drawer open={open} className='p-0' onClose={onClose} size={256}> | ||
{children} | ||
</Drawer> | ||
</React.Fragment> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import { useMemo, useState } from 'react'; | ||
import { AppDrawer } from './AppDrawer'; | ||
//import { ToggleSidebarBtn } from "./ToggleSidebarBtn"; | ||
|
||
// Tue's task in here. Feel free to be creative, not strict, you can do anything. | ||
export const AppNavigation: Component<{ menu: RouteMenu }> = ({ menu }) => { | ||
const [openSidebar, setOpenSidebar] = useState<boolean>(true); | ||
console.log(menu); // Do somthing with menu??? | ||
|
||
const SideMenu = useMemo(() => <></>, []); | ||
|
||
return ( | ||
<AppDrawer open={openSidebar} onClose={() => setOpenSidebar(false)}> | ||
{SideMenu} | ||
</AppDrawer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
// Tan's task in here | ||
|
||
export function HomePage() { | ||
return <div>Đăng nhập thành công</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters