ran format

This commit is contained in:
JJ Kasper
2018-11-04 01:29:26 -06:00
parent 31321e635a
commit 73f05ce4a3
4 changed files with 88 additions and 60 deletions

View File

@@ -26,14 +26,35 @@ export default class MyDocument extends Document {
name="viewport" name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no" content="width=device-width, initial-scale=1, shrink-to-fit=no"
/> />
<link rel="apple-touch-icon" sizes="180x180" href={getUrl("/apple-touch-icon.png")}/> <link
<link rel="icon" type="image/png" sizes="32x32" href={getUrl("/favicon-32x32.png")}/> rel="apple-touch-icon"
<link rel="icon" type="image/png" sizes="16x16" href={getUrl("/favicon-16x16.png")}/> sizes="180x180"
<link rel="manifest" href={getUrl("/site.webmanifest")}/> href={getUrl('/apple-touch-icon.png')}
<link rel="mask-icon" href={getUrl("/safari-pinned-tab.svg")} color="#00d1b2"/> />
<meta name="msapplication-TileColor" content="#202225"/> <link
<meta name="theme-color" content="#202225"/> rel="icon"
<style dangerouslySetInnerHTML={{ __html: this.props.css }} data-glamor /> type="image/png"
sizes="32x32"
href={getUrl('/favicon-32x32.png')}
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href={getUrl('/favicon-16x16.png')}
/>
<link rel="manifest" href={getUrl('/site.webmanifest')} />
<link
rel="mask-icon"
href={getUrl('/safari-pinned-tab.svg')}
color="#00d1b2"
/>
<meta name="msapplication-TileColor" content="#202225" />
<meta name="theme-color" content="#202225" />
<style
dangerouslySetInnerHTML={{ __html: this.props.css }}
data-glamor
/>
<script <script
dangerouslySetInnerHTML={{ dangerouslySetInnerHTML={{
__html: 'window.kbConf=' + JSON.stringify(app.get('kbConf')), __html: 'window.kbConf=' + JSON.stringify(app.get('kbConf')),

View File

@@ -1,18 +1,18 @@
import { css } from 'glamor' import { css } from 'glamor'
import theme from '../styles/theme'; import theme from '../styles/theme'
const style = { const style = {
textAlign: 'center', textAlign: 'center',
padding: '10px 10px 15px', padding: '10px 10px 15px',
background: theme.primaryAlt, background: theme.primaryAlt,
'& p': { '& p': {
marginBottom: 0, marginBottom: 0,
} },
} }
const Footer = () => ( const Footer = () => (
<footer className={ css(style) }> <footer className={css(style)}>
<p> <p>
Powered by{' '} Powered by{' '}
<a <a

View File

@@ -9,92 +9,92 @@ import getUrl from '../util/getUrl'
import mapUser from '../util/mapUser' import mapUser from '../util/mapUser'
const style = { const style = {
background: theme.primaryAlt, background: theme.primaryAlt,
display: 'flex', display: 'flex',
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',
height: 55, height: 55,
'& .navbar-brand': { '& .navbar-brand': {
marginLeft: '0.75em', marginLeft: '0.75em',
marginRight: 'auto', marginRight: 'auto',
'& h3': { '& h3': {
marginBottom: 0, marginBottom: 0,
}, },
}, },
'& .navbar-burger': { '& .navbar-burger': {
width: 32, width: 32,
display: 'none', display: 'none',
marginRight: 10, marginRight: 10,
'&.active div': { '&.active div': {
'&:nth-child(1)': { '&:nth-child(1)': {
transformOrigin: 'center', transformOrigin: 'center',
transform: 'translateY(8px) rotate(45deg)', transform: 'translateY(8px) rotate(45deg)',
}, },
'&:nth-child(2)': { '&:nth-child(2)': {
opacity: 0, opacity: 0,
}, },
'&:nth-child(3)': { '&:nth-child(3)': {
transformOrigin: 'left -6px', transformOrigin: 'left -6px',
transform: 'translateY(8px) rotate(-45deg)', transform: 'translateY(8px) rotate(-45deg)',
}, },
}, },
'& div': { '& div': {
transition: 'all ease-in-out 150ms', transition: 'all ease-in-out 150ms',
width: '100%', width: '100%',
height: 2, height: 2,
margin: '5px 0', margin: '5px 0',
borderRadius: 1, borderRadius: 1,
background: theme.text, background: theme.text,
}, },
}, },
'& .navbar-items': { '& .navbar-items': {
display: 'inline-flex', display: 'inline-flex',
flexDirection: 'row', flexDirection: 'row',
'& .active .item, .item:hover': { '& .active .item, .item:hover': {
background: theme.primary, background: theme.primary,
}, },
'& .item': { '& .item': {
margin: 0, margin: 0,
cursor: 'pointer', cursor: 'pointer',
padding: '15px 20px', padding: '15px 20px',
} },
}, },
'@media screen and (max-width: 840px)': { '@media screen and (max-width: 840px)': {
'& .navbar-burger': { '& .navbar-burger': {
display: 'inline-block', display: 'inline-block',
}, },
'& .navbar-items': { '& .navbar-items': {
display: 'block', display: 'block',
overflow: 'hidden', overflow: 'hidden',
position: 'fixed', position: 'fixed',
top: 55, top: 55,
left: 0, left: 0,
zIndex: 5, zIndex: 5,
background: theme.primaryAlt, background: theme.primaryAlt,
width: '100%', width: '100%',
transform: 'scaleY(0)', transform: 'scaleY(0)',
transformOrigin: 'top', transformOrigin: 'top',
transition: 'all ease-in-out 125ms', transition: 'all ease-in-out 125ms',
'&.active': { '&.active': {
transform: 'scaleY(1)', transform: 'scaleY(1)',
overflow: 'auto', overflow: 'auto',
}, },
'& .item': { '& .item': {
width: '100%', width: '100%',
padding: '5px 0', padding: '5px 0',
textAlign: 'center', textAlign: 'center',
} },
} },
} },
} }
const NavLink = ({ children, href, active }) => { const NavLink = ({ children, href, active }) => {
@@ -127,7 +127,11 @@ class Header extends Component {
const expandClass = this.state.open ? ' active' : '' const expandClass = this.state.open ? ' active' : ''
const { user } = this.props const { user } = this.props
return ( return (
<nav className={ "navbar " + css(style) } role="navigation" aria-label="main navigation"> <nav
className={'navbar ' + css(style)}
role="navigation"
aria-label="main navigation"
>
<div className="navbar-brand"> <div className="navbar-brand">
<NavLink href="/"> <NavLink href="/">
<h3 onClick={this.hideNav}>MYKB</h3> <h3 onClick={this.hideNav}>MYKB</h3>

View File

@@ -15,10 +15,13 @@ const CodeMirrorSkel = () => (
<textarea style={{ height: 'calc(300px - 1.2rem)', margin: 0 }} /> <textarea style={{ height: 'calc(300px - 1.2rem)', margin: 0 }} />
</div> </div>
) )
const CodeMirror = dynamic(typeof window !== 'undefined' && import('../components/CodeMirror'), { const CodeMirror = dynamic(
loading: CodeMirrorSkel, typeof window !== 'undefined' && import('../components/CodeMirror'),
ssr: false, {
}) loading: CodeMirrorSkel,
ssr: false,
}
)
const initState = { const initState = {
name: '', name: '',
dir: '', dir: '',