UI progress!
This commit is contained in:
parent
2725e366a2
commit
76cbd10a6f
8 changed files with 137 additions and 56 deletions
1
frontend/public/img/icon/oc.svg
Normal file
1
frontend/public/img/icon/oc.svg
Normal file
|
|
@ -0,0 +1 @@
|
|||
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0.02603912353515625 -0.019503116607666016 108.4056396484375 108.71894836425781"><title>OpenCommerce</title><path d="M18.49 14.21A48.45 48.45 0 0 1 45.44.76a52.45 52.45 0 0 1 33.67 5.38c16.36 8.61 19.7 29 7.06 42.5-1.17 1.25-2.25 2.57-3.79 4.36-3.61-3.78-6.79-7.2-10.08-10.53-6.71-6.81-13.49-13.56-20.23-20.35-9.2-9.28-19.94-12.34-32.5-8.15-.35.09-.72.15-1.08.24z" fill="#fbb355"></path><path d="M26.36 55.58c2.12 2.43 3.83 4.62 5.77 6.59 7.25 7.36 14.77 14.47 21.81 22C64 95 75.61 99.55 90.31 94.62a24.55 24.55 0 0 1-1.9 1.78c-18.14 13.78-37.71 16.07-58.27 6.42-17-7.95-20.7-28.83-8.07-42.66 1.15-1.26 2.34-2.5 4.29-4.58z" fill="#8a56c2"></path><path d="M14.43 91.13a54.29 54.29 0 0 1-9.12-60.19c8.48-17.94 29.56-21.76 43.85-8 1 1 2.14 1.89 3.77 3.32-5.06 4.87-9.75 9.34-14.37 13.88Q30 48.56 21.49 57.1c-9.18 9.23-11.69 20-7.42 32.35.09.25.12.55.36 1.68z" fill="#53b0fb"></path><path d="M94.24 18.43a49.59 49.59 0 0 1 13.67 28.51 53.73 53.73 0 0 1-5.66 32.49 26.7 26.7 0 0 1-41.93 7.29c-1.39-1.3-2.9-2.48-4.55-3.87 1.18-1.25 1.87-2 2.59-2.73q14.19-14.19 28.39-28.37c9.2-9.18 11.92-19.9 7.74-32.28a9.26 9.26 0 0 1-.25-1.04z" fill="#fa6663"></path></svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
|
|
@ -3,11 +3,11 @@
|
|||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
|
||||
<link rel="icon" href="%PUBLIC_URL%/img/icon/oc.svg" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="theme-color" content="#000000" />
|
||||
<meta name="description" content="Web site created using create-react-app" />
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo192.png" />
|
||||
<link rel="apple-touch-icon" href="%PUBLIC_URL%/img/icon/oc.svg" />
|
||||
<!--
|
||||
manifest.json provides metadata used when your web app is installed on a
|
||||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
#root {
|
||||
width: 100vw;
|
||||
max-width: 85%;
|
||||
margin: auto;
|
||||
}
|
||||
|
||||
/* body.chakra-ui-dark nav.main {
|
||||
background-color: var(--chakra-colors-whiteAlpha-300) !important;
|
||||
border: 2px solid var(--chakra-colors-whiteAlpha-100) !important;
|
||||
}
|
||||
|
||||
nav.main {
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
|
||||
border-radius: 8px;
|
||||
background-color: var(--chakra-colors-blackAlpha-300);
|
||||
border: 2px solid var(--chakra-colors-blackAlpha-100);
|
||||
|
||||
margin: auto;
|
||||
padding: 0.35rem 0.5rem;
|
||||
|
||||
width: 100%;
|
||||
max-width: 768px;
|
||||
}
|
||||
|
||||
nav.main .item {
|
||||
transition: background-color ease-in-out 250ms;
|
||||
background-color: transparent;
|
||||
}
|
||||
nav.main .item:hover {
|
||||
background-color: var(--chakra-colors-blackAlpha-500);
|
||||
} */
|
||||
|
|
@ -2,7 +2,7 @@ import React from 'react';
|
|||
import { ChakraProvider, theme } from '@chakra-ui/react';
|
||||
import { BrowserRouter, Routes, Route } from 'react-router-dom';
|
||||
import { Provider } from 'react-redux';
|
||||
import NavBar from './global/components/Navbar';
|
||||
import NavBar from './global/components/Nav/Bar';
|
||||
import store from './redux/store';
|
||||
|
||||
// Pages
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
import React from 'react';
|
||||
import { useColorMode, useColorModeValue, IconButton } from '@chakra-ui/react';
|
||||
import { FaMoon, FaSun } from 'react-icons/fa';
|
||||
|
||||
export default (props) => {
|
||||
const { toggleColorMode } = useColorMode();
|
||||
const text = useColorModeValue('dark', 'light');
|
||||
const SwitchIcon = useColorModeValue(FaMoon, FaSun);
|
||||
|
||||
return (
|
||||
<IconButton
|
||||
size="md"
|
||||
fontSize="lg"
|
||||
aria-label={`Switch to ${text} mode`}
|
||||
variant="ghost"
|
||||
color="current"
|
||||
marginLeft="2"
|
||||
onClick={toggleColorMode}
|
||||
icon={<SwitchIcon />}
|
||||
{...props}
|
||||
/>
|
||||
);
|
||||
};
|
||||
82
frontend/src/global/components/Nav/Bar.jsx
Normal file
82
frontend/src/global/components/Nav/Bar.jsx
Normal file
|
|
@ -0,0 +1,82 @@
|
|||
import React from 'react';
|
||||
import {
|
||||
Avatar, Box,
|
||||
Flex,
|
||||
HStack,
|
||||
IconButton, Stack, useColorModeValue, useDisclosure,
|
||||
} from '@chakra-ui/react';
|
||||
import { AiOutlineClose } from 'react-icons/ai';
|
||||
import { FaHamburger } from 'react-icons/fa';
|
||||
import Item from './Item';
|
||||
|
||||
export const Pages = [
|
||||
{
|
||||
name: 'Home',
|
||||
path: '/',
|
||||
icon: null,
|
||||
},
|
||||
];
|
||||
|
||||
export default function Simple() {
|
||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||
|
||||
return (
|
||||
<Box bg={useColorModeValue('gray.100', 'gray.900')} px={4}>
|
||||
<Flex h={16} alignItems="center" justifyContent="space-between">
|
||||
<IconButton
|
||||
size="md"
|
||||
icon={isOpen ? <AiOutlineClose /> : <FaHamburger />}
|
||||
aria-label="Open Menu"
|
||||
display={{ md: 'none' }}
|
||||
onClick={isOpen ? onClose : onOpen}
|
||||
/>
|
||||
<HStack spacing={8} alignItems="center">
|
||||
<Box><Avatar backgroundColor="transparent" size="sm" src="/img/icon/oc.svg" /></Box>
|
||||
<HStack
|
||||
as="nav"
|
||||
spacing={4}
|
||||
display={{ base: 'none', md: 'flex' }}
|
||||
>
|
||||
|
||||
{Pages.map(({ icon, name, path }) => (
|
||||
<Item icon={icon} name={name} to={path} />
|
||||
))}
|
||||
</HStack>
|
||||
</HStack>
|
||||
{/* This chunk handles the dropdown menu */}
|
||||
{/* <Flex alignItems="center">
|
||||
<Menu>
|
||||
<MenuButton
|
||||
as={Button}
|
||||
rounded="full"
|
||||
variant="link"
|
||||
cursor="pointer"
|
||||
minW={0}
|
||||
>
|
||||
<Avatar
|
||||
size="sm"
|
||||
src="https://images.unsplash.com/photo-1493666438817-866a91353ca9?ixlib=rb-0.3.5&q=80&fm=jpg&crop=faces&fit=crop&h=200&w=200&s=b616b2c5b373a80ffc9636ba24f7a4a9"
|
||||
/>
|
||||
</MenuButton>
|
||||
<MenuList>
|
||||
<MenuItem>Link 1</MenuItem>
|
||||
<MenuItem>Link 2</MenuItem>
|
||||
<MenuDivider />
|
||||
<MenuItem>Link 3</MenuItem>
|
||||
</MenuList>
|
||||
</Menu>
|
||||
</Flex> */}
|
||||
</Flex>
|
||||
|
||||
{isOpen ? (
|
||||
<Box pb={4} display={{ md: 'none' }}>
|
||||
<Stack as="nav" spacing={4}>
|
||||
{Pages.map(({ icon, name, path }) => (
|
||||
<Item icon={icon} name={name} to={path} />
|
||||
))}
|
||||
</Stack>
|
||||
</Box>
|
||||
) : null}
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
16
frontend/src/global/components/Nav/Item.jsx
Normal file
16
frontend/src/global/components/Nav/Item.jsx
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
import { Button, Icon } from '@chakra-ui/react';
|
||||
import React from 'react';
|
||||
import { NavLink } from 'react-router-dom';
|
||||
|
||||
export default ({
|
||||
to, name, icon,
|
||||
}) => (
|
||||
<NavLink exact activeClassName="active" to={to}>
|
||||
<Button>
|
||||
{!!icon && (<Icon name={icon} />)}
|
||||
{!!icon && !!name && ' '}
|
||||
{!!name && name}
|
||||
</Button>
|
||||
</NavLink>
|
||||
|
||||
);
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
import React from 'react';
|
||||
import {
|
||||
Breadcrumb,
|
||||
BreadcrumbItem,
|
||||
BreadcrumbLink,
|
||||
BreadcrumbSeparator,
|
||||
} from '@chakra-ui/react';
|
||||
import ColorModeSwitcher from './ColorModeSwitcher';
|
||||
|
||||
export default () => (
|
||||
<Breadcrumb>
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbLink href="#">Home</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
|
||||
<BreadcrumbSeparator />
|
||||
|
||||
<BreadcrumbItem>
|
||||
<BreadcrumbLink href="#">Docs</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
|
||||
<BreadcrumbSeparator />
|
||||
|
||||
<BreadcrumbItem isCurrentPage>
|
||||
<BreadcrumbLink href="#">Breadcrumb</BreadcrumbLink>
|
||||
</BreadcrumbItem>
|
||||
|
||||
<ColorModeSwitcher />
|
||||
</Breadcrumb>
|
||||
);
|
||||
Loading…
Reference in a new issue