2019-11-23 19:41:14 +07:00
|
|
|
import styled from '@emotion/styled';
|
|
|
|
import { css } from '@emotion/core';
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-11-23 19:41:14 +07:00
|
|
|
import { Theme } from '../../design-tokens/theme';
|
2019-10-03 23:17:04 +07:00
|
|
|
import IconButton from '../../muiComponents/IconButton';
|
2019-10-31 14:12:18 +07:00
|
|
|
import AppBar from '../../muiComponents/AppBar';
|
|
|
|
import Toolbar from '../../muiComponents/Toolbar';
|
|
|
|
import Link from '../Link';
|
2019-10-03 23:17:04 +07:00
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const InnerNavBar = styled(Toolbar)({
|
2019-10-31 14:12:18 +07:00
|
|
|
justifyContent: 'space-between',
|
|
|
|
alignItems: 'center',
|
|
|
|
padding: '0 15px',
|
2019-07-15 16:57:32 +07:00
|
|
|
});
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const Greetings = styled('span')({
|
2019-10-31 14:12:18 +07:00
|
|
|
margin: '0 5px 0 0',
|
2019-07-15 16:57:32 +07:00
|
|
|
});
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const RightSide = styled(Toolbar)({
|
2019-10-31 14:12:18 +07:00
|
|
|
display: 'flex',
|
|
|
|
padding: 0,
|
2019-07-15 16:57:32 +07:00
|
|
|
});
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const LeftSide = styled(RightSide)({
|
2019-10-31 14:12:18 +07:00
|
|
|
flex: 1,
|
2019-07-15 16:57:32 +07:00
|
|
|
});
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-11-23 19:41:14 +07:00
|
|
|
export const MobileNavBar = styled('div')<{ theme?: Theme }>(props => ({
|
2019-10-31 14:12:18 +07:00
|
|
|
alignItems: 'center',
|
|
|
|
display: 'flex',
|
2019-11-23 19:41:14 +07:00
|
|
|
borderBottom: `1px solid ${props.theme && props.theme.palette.greyLight}`,
|
2019-10-31 14:12:18 +07:00
|
|
|
padding: '8px',
|
|
|
|
position: 'relative',
|
2019-11-23 19:41:14 +07:00
|
|
|
}));
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-11-23 19:41:14 +07:00
|
|
|
export const InnerMobileNavBar = styled('div')<{ theme?: Theme }>(props => ({
|
2019-10-31 14:12:18 +07:00
|
|
|
borderRadius: '4px',
|
2019-11-23 19:41:14 +07:00
|
|
|
backgroundColor: props.theme && props.theme.palette.greyLight,
|
|
|
|
color: props.theme && props.theme.palette.white,
|
2019-10-31 14:12:18 +07:00
|
|
|
width: '100%',
|
|
|
|
padding: '0 5px',
|
|
|
|
margin: '0 10px 0 0',
|
2019-11-23 19:41:14 +07:00
|
|
|
}));
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const IconSearchButton = styled(IconButton)({
|
2019-10-31 14:12:18 +07:00
|
|
|
display: 'block',
|
2019-07-15 16:57:32 +07:00
|
|
|
});
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-07-15 16:57:32 +07:00
|
|
|
export const SearchWrapper = styled('div')({
|
2019-10-31 14:12:18 +07:00
|
|
|
display: 'none',
|
|
|
|
maxWidth: '393px',
|
|
|
|
width: '100%',
|
2019-07-15 16:57:32 +07:00
|
|
|
});
|
2019-02-03 17:23:33 +07:00
|
|
|
|
2019-12-12 22:10:27 +07:00
|
|
|
export const NavBar = styled(AppBar)<{ theme?: Theme }>(({ theme }) => ({
|
|
|
|
backgroundColor: theme && theme.palette.primary.main,
|
2019-11-23 19:41:14 +07:00
|
|
|
minHeight: 60,
|
|
|
|
display: 'flex',
|
|
|
|
justifyContent: 'center',
|
2019-12-12 22:10:27 +07:00
|
|
|
[`@media (min-width: ${theme && theme.breakPoints.medium}px)`]: css`
|
2019-11-23 19:41:14 +07:00
|
|
|
${SearchWrapper} {
|
|
|
|
display: flex;
|
|
|
|
}
|
|
|
|
${IconSearchButton} {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
${MobileNavBar} {
|
|
|
|
display: none;
|
|
|
|
}
|
|
|
|
`,
|
2019-12-12 22:10:27 +07:00
|
|
|
[`@media (min-width: ${theme && theme.breakPoints.large}px)`]: css`
|
2019-11-23 19:41:14 +07:00
|
|
|
${InnerNavBar} {
|
|
|
|
padding: 0 20px;
|
|
|
|
}
|
|
|
|
`,
|
2019-12-12 22:10:27 +07:00
|
|
|
[`@media (min-width: ${theme && theme.breakPoints.xlarge}px)`]: css`
|
2019-11-23 19:41:14 +07:00
|
|
|
${InnerNavBar} {
|
|
|
|
max-width: 1240px;
|
|
|
|
width: 100%;
|
|
|
|
margin: 0 auto;
|
|
|
|
}
|
|
|
|
`,
|
|
|
|
}));
|
2019-10-03 23:17:04 +07:00
|
|
|
|
2019-11-23 19:41:14 +07:00
|
|
|
export const StyledLink = styled(Link)<{ theme?: Theme }>(props => ({
|
|
|
|
color: props.theme && props.theme.palette.white,
|
|
|
|
}));
|