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(three_order_form): implement 3 forms and add some types
- Loading branch information
Showing
66 changed files
with
1,542 additions
and
155 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
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 |
---|---|---|
|
@@ -9,4 +9,4 @@ | |
"scripts": { | ||
"start": "node server.js" | ||
} | ||
} | ||
} |
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,5 @@ | ||
/** | ||
* @file Automatically generated by barrelsby. | ||
*/ | ||
|
||
export * from './index'; |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,17 +1,47 @@ | ||
import { useMemo, useState } from 'react'; | ||
import { AppDrawer } from './AppDrawer'; | ||
//import { ToggleSidebarBtn } from "./ToggleSidebarBtn"; | ||
import { UserCircleIcon } from '@heroicons/react/24/solid'; | ||
import coin from '@assets/coin.png'; | ||
import { AppDrawer, DesktopNavbar, ToggleSidebarBtn, useSidebarMenu } from '@components/common'; | ||
import { ScreenSize } from '@constants'; | ||
import { useScreenSize } from '@hooks'; | ||
import { useMenuBarStore } from '@states/common'; | ||
import { useUserInfoStore } from '@states/home'; | ||
|
||
// 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(() => <></>, []); | ||
export const AppNavigation: Component<{ mainMenu: RouteMenu; subMenu: RouteMenu }> = ({ | ||
mainMenu, | ||
subMenu | ||
}) => { | ||
const { screenSize } = useScreenSize(); | ||
const { openSidebar, handleOpenSidebar, SidebarMenu } = useSidebarMenu(); | ||
const { selectedMenu } = useMenuBarStore(); | ||
const { userInfoData } = useUserInfoStore(); | ||
|
||
return ( | ||
<AppDrawer open={openSidebar} onClose={() => setOpenSidebar(false)}> | ||
{SideMenu} | ||
</AppDrawer> | ||
<div className='w-full max-h-[768px] px-6 lg:px-9 py-3 lg:py-3 shadow-md lg:sticky my-3 lg:my-0'> | ||
<div className='flex items-center justify-between h-full'> | ||
<div className='flex items-center lg:hidden'> | ||
<div | ||
className='cursor-pointer opacity-40 focus:opacity-100 active:opacity-100 mr-4' | ||
onClick={handleOpenSidebar} | ||
> | ||
<ToggleSidebarBtn open={openSidebar} /> | ||
</div> | ||
<div className='text-2xl font-semibold'>{selectedMenu}</div> | ||
</div> | ||
{screenSize < ScreenSize.LG ? ( | ||
<AppDrawer open={openSidebar} onClose={handleOpenSidebar}> | ||
<SidebarMenu mainMenu={mainMenu} subMenu={subMenu} /> | ||
</AppDrawer> | ||
) : ( | ||
<DesktopNavbar mainMenu={mainMenu} /> | ||
)} | ||
<div className='flex items-center'> | ||
<div className='flex items-center w-18.25 lg:w-26 h-6 lg:h-9 bg-[#FEECDC] pl-4 pr-6 lg:pl-6 lg:pr-9 rounded-lg -mr-5 font-bold text-[#9F580A] lg:font-semibold lg:text-2xl select-none text-base'> | ||
{userInfoData.coins} | ||
</div> | ||
<img className='w-7 h-7 lg:w-10 lg:h-10' src={coin}></img> | ||
<UserCircleIcon className='w-10 h-10 hidden lg:block lg:opacity-40 lg:ml-6 lg:cursor-pointer' /> | ||
</div> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Link } from 'react-router-dom'; | ||
import { List, ListItem } from '@material-tailwind/react'; | ||
import logo from '@assets/logobk.png'; | ||
import ticklab from '@assets/ticklab.png'; | ||
import { useMenuBarStore } from '@states/common'; | ||
|
||
export const DesktopNavbar: Component<{ mainMenu: RouteMenu }> = ({ mainMenu }) => { | ||
const { selectedMenu, setSelectedMenu } = useMenuBarStore(); | ||
|
||
return ( | ||
<div className='flex'> | ||
<div className='max-w-[60px] max-h-[60px] ml-0 mr-3 object-cover'> | ||
<img className='w-full h-full' src={logo}></img> | ||
</div> | ||
<div className='max-w-[60px] max-h-[60px] ml-0 mr-3 object-cover'> | ||
<img className='w-full h-full' src={ticklab}></img> | ||
</div> | ||
<List className='p-0 flex-row -ml-3 max-w-[calc(100%-36px)]'> | ||
{mainMenu.map((menuItem, idx) => ( | ||
<Link key={idx} to='#'> | ||
<ListItem | ||
className={ | ||
'hover:bg-gray/1 focus:bg-blue-100 active:bg-blue-100 focus:text-blue/1 active:text-blue/1 focus:font-bold active:font-bold px-6 py-3 text-gray/4 font-medium rounded-lg text-2xl leading-9 ml-6 w-fit text-center' + | ||
(selectedMenu === menuItem.name | ||
? ' bg-blue-100 text-blue/1 font-bold pointer-events-none' | ||
: '') | ||
} | ||
onClick={() => setSelectedMenu(menuItem.name)} | ||
> | ||
{menuItem.name} | ||
</ListItem> | ||
</Link> | ||
))} | ||
</List> | ||
</div> | ||
); | ||
}; |
Oops, something went wrong.