-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: basic dashboard layout setup done
- Loading branch information
1 parent
812fc2b
commit 2bfd2b9
Showing
16 changed files
with
523 additions
and
140 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,3 @@ | ||
# Ecommerce Admin Dashboard With Mantin UI | ||
|
||
![EcommHub Dashboard](/src/assets/dashboard.png) |
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.
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,30 @@ | ||
import { Footer, Paper, Text, UnstyledButton } from '@mantine/core' | ||
import { IconBrandGithub } from '@tabler/icons' | ||
import React from 'react' | ||
|
||
import { COLORS } from '@/utils/constants' | ||
|
||
const FooterBar = () => { | ||
return ( | ||
<Footer height={60} p="md"> | ||
<Paper> | ||
Copywright © 2023,{' '} | ||
<IconBrandGithub style={{ display: 'inline' }} size={16} />{' '} | ||
<UnstyledButton> | ||
<Text | ||
variant="gradient" | ||
weight={600} | ||
component="a" | ||
target="_blank" | ||
href="https://github.com/shubhamwebdesign" | ||
gradient={{ from: COLORS.primary, to: COLORS.secondary }} | ||
> | ||
shubhamwebdesign | ||
</Text> | ||
</UnstyledButton> | ||
</Paper> | ||
</Footer> | ||
) | ||
} | ||
|
||
export default FooterBar |
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,56 @@ | ||
import { | ||
Burger, | ||
Header, | ||
MediaQuery, | ||
useMantineColorScheme, | ||
useMantineTheme | ||
} from '@mantine/core' | ||
import React from 'react' | ||
|
||
import EcommHub from '@/assets/ecommhub.svg' | ||
import { ToggleButton } from '@/components/common' | ||
|
||
import NavAction from '../NavAction/NavAction' | ||
|
||
type HeaderBarType = { | ||
opened: boolean | ||
setOpened: React.Dispatch<React.SetStateAction<boolean>> | ||
} | ||
|
||
const HeaderBar: React.FC<HeaderBarType> = ({ opened, setOpened }) => { | ||
const { colorScheme } = useMantineColorScheme() | ||
const theme = useMantineTheme() | ||
return ( | ||
<Header | ||
height={60} | ||
p="xs" | ||
display="flex" | ||
style={{ justifyContent: 'space-between', alignItems: 'center' }} | ||
> | ||
<img | ||
style={{ | ||
mixBlendMode: colorScheme === 'light' ? 'darken' : 'exclusion' | ||
}} | ||
src={EcommHub} | ||
/> | ||
<MediaQuery largerThan="sm" styles={{ display: 'none' }}> | ||
<Burger | ||
opened={opened} | ||
onClick={() => setOpened((o) => !o)} | ||
size="sm" | ||
color={theme.colors.gray[7]} | ||
mx="xl" | ||
/> | ||
</MediaQuery> | ||
<div className="mr-6 hidden w-full justify-end md:flex"> | ||
<NavAction /> | ||
</div> | ||
|
||
<div className="hidden md:block"> | ||
<ToggleButton /> | ||
</div> | ||
</Header> | ||
) | ||
} | ||
|
||
export default HeaderBar |
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,32 +1,43 @@ | ||
import { Stack, Title } from '@mantine/core' | ||
import React from 'react' | ||
import { AppShell, Navbar, useMantineTheme } from '@mantine/core' | ||
import { useState } from 'react' | ||
|
||
import { ToggleButton } from '@/components/common' | ||
|
||
import Navbar from './Navbar/Navbar' | ||
import FooterBar from './Footer/Footer' | ||
import HeaderBar from './Header/Header' | ||
import NavigationBar from './Navbar/Navbar' | ||
|
||
type LayoutType = { | ||
children: React.ReactNode | ||
} | ||
|
||
const Layout: React.FC<LayoutType> = ({ children }) => { | ||
export default function Layout({ children }: LayoutType) { | ||
const theme = useMantineTheme() | ||
const [opened, setOpened] = useState(false) | ||
return ( | ||
<div className="relative flex"> | ||
<div className="fixed top-0"> | ||
<Navbar /> | ||
</div> | ||
<div className="m-8 ml-[100px] flex-1"> | ||
<div className="flex items-center justify-between"> | ||
<Stack ml="xl" spacing="xs"> | ||
<Title order={2}>EcommHub</Title> | ||
<p>Your Online Shopping Destination, Now</p> | ||
</Stack> | ||
<ToggleButton /> | ||
</div> | ||
<div>{children}</div> | ||
</div> | ||
</div> | ||
<AppShell | ||
styles={{ | ||
main: { | ||
background: | ||
theme.colorScheme === 'dark' | ||
? theme.colors.dark[8] | ||
: theme.colors.gray[0] | ||
} | ||
}} | ||
navbarOffsetBreakpoint="sm" | ||
asideOffsetBreakpoint="sm" | ||
navbar={ | ||
<Navbar | ||
p="md" | ||
hiddenBreakpoint="sm" | ||
hidden={!opened} | ||
width={{ sm: 200, lg: 300 }} | ||
> | ||
<NavigationBar /> | ||
</Navbar> | ||
} | ||
footer={<FooterBar />} | ||
header={<HeaderBar opened={opened} setOpened={setOpened} />} | ||
> | ||
{children} | ||
</AppShell> | ||
) | ||
} | ||
|
||
export default Layout |
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,21 @@ | ||
import { ActionIcon, Group } from '@mantine/core' | ||
import { IconBellRinging, IconListCheck, IconMessage } from '@tabler/icons' | ||
import React from 'react' | ||
|
||
const NavAction = () => { | ||
return ( | ||
<Group spacing="lg"> | ||
<ActionIcon title="Notifications" variant="outline"> | ||
<IconBellRinging size={20} /> | ||
</ActionIcon> | ||
<ActionIcon title="List" variant="outline"> | ||
<IconListCheck size={20} /> | ||
</ActionIcon> | ||
<ActionIcon title="Messages" variant="outline"> | ||
<IconMessage size={18} /> | ||
</ActionIcon> | ||
</Group> | ||
) | ||
} | ||
|
||
export default NavAction |
Oops, something went wrong.