Layout: add NavigationBar
This commit is contained in:
parent
b1cacc06a1
commit
07ca9a5b2a
32
apps/web/Components/Layout/Navigation.jsx
Normal file
32
apps/web/Components/Layout/Navigation.jsx
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
const Container = styled.div`
|
||||||
|
background-color: white;
|
||||||
|
bottom: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
gap: 10px;
|
||||||
|
height: 40px;
|
||||||
|
justify-content: space-around;
|
||||||
|
position: fixed;
|
||||||
|
width: 100%;
|
||||||
|
`;
|
||||||
|
|
||||||
|
const TabButton = styled.button`
|
||||||
|
background: rgba(240, 240, 240);
|
||||||
|
border-radius: 6px;
|
||||||
|
border: none;
|
||||||
|
cursor: pointer;
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
`;
|
||||||
|
|
||||||
|
export function NavigationBar() {
|
||||||
|
return (
|
||||||
|
<Container>
|
||||||
|
<TabButton>Tab1</TabButton>
|
||||||
|
<TabButton>Tab2</TabButton>
|
||||||
|
<TabButton>Tab3</TabButton>
|
||||||
|
</Container>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -1,11 +1,22 @@
|
|||||||
import Header from './Header';
|
import Header from './Header';
|
||||||
import { AppMenu } from './Navigation';
|
import { AppMenu } from './Menu';
|
||||||
import { min } from '@/styles/mq';
|
import { NavigationBar } from './Navigation';
|
||||||
|
import { screens } from '@/config/ui';
|
||||||
|
import { max, min } from '@/styles/mq';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
|
const MediaQuery = dynamic(() => import('react-responsive'), {
|
||||||
|
ssr: false,
|
||||||
|
});
|
||||||
|
|
||||||
const Main = styled.main`
|
const Main = styled.main`
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
|
|
||||||
|
${max('laptop')} {
|
||||||
|
margin-bottom: 40px; // height of the navigation bar
|
||||||
|
}
|
||||||
|
|
||||||
${min('desktop-xl')} {
|
${min('desktop-xl')} {
|
||||||
margin: 8px 10%;
|
margin: 8px 10%;
|
||||||
}
|
}
|
||||||
@ -17,6 +28,9 @@ export default function Layout({ children, user }) {
|
|||||||
<Header />
|
<Header />
|
||||||
{user?.admin ? <AppMenu /> : false}
|
{user?.admin ? <AppMenu /> : false}
|
||||||
<Main>{children}</Main>
|
<Main>{children}</Main>
|
||||||
|
<MediaQuery maxWidth={screens.laptop}>
|
||||||
|
<NavigationBar />
|
||||||
|
</MediaQuery>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user