mirror of
https://github.com/roleypoly/roleypoly-v1.git
synced 2025-06-17 10:39:09 +00:00
lerna: split up bulk of packages
This commit is contained in:
parent
cb0b1d2410
commit
47a2e5694e
90 changed files with 0 additions and 0 deletions
60
packages/roleypoly-ui/components/header/common.js
Normal file
60
packages/roleypoly-ui/components/header/common.js
Normal file
|
@ -0,0 +1,60 @@
|
|||
// @flow
|
||||
import * as React from 'react'
|
||||
import dynamic from 'next/dynamic'
|
||||
import styled from 'styled-components'
|
||||
import * as logo from '../logo'
|
||||
|
||||
export type CommonProps = {
|
||||
children: React.Element<any>,
|
||||
noBackground: boolean
|
||||
}
|
||||
|
||||
const Header = styled.div`
|
||||
background-color: ${({ noBackground }: any) => noBackground === false ? 'var(--c-dark);' : 'var(--c-1);'}
|
||||
position: relative;
|
||||
transition: background-color 0.3s ease-in-out;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
z-index: 5;
|
||||
`
|
||||
|
||||
const HeaderInner = styled.div`
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
max-width: 960px;
|
||||
width: 100vw;
|
||||
margin: 0 auto;
|
||||
height: 50px;
|
||||
padding: 3px 5px;
|
||||
position: relative;
|
||||
top: -1px;
|
||||
|
||||
& > div {
|
||||
margin: 0 0.5em;
|
||||
}
|
||||
`
|
||||
|
||||
export const Logotype = styled(logo.Logotype)`
|
||||
height: 30px;
|
||||
`
|
||||
|
||||
export const Logomark = styled(logo.Logomark)`
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
`
|
||||
//
|
||||
const DebugBreakpoints = dynamic(() => import('../../kit/debug-breakpoints'))
|
||||
|
||||
const HeaderBarCommon = ({ children, noBackground = false }: CommonProps) => (
|
||||
<Header noBackground={noBackground}>
|
||||
{ (process.env.NODE_ENV === 'development') && <DebugBreakpoints />}
|
||||
<HeaderInner>
|
||||
{ children }
|
||||
</HeaderInner>
|
||||
</Header>
|
||||
)
|
||||
|
||||
export default HeaderBarCommon
|
Loading…
Add table
Add a link
Reference in a new issue