Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
feat(Layout): add full mode
Browse files Browse the repository at this point in the history
  • Loading branch information
cdaringe committed Jul 25, 2018
1 parent 2f80ff1 commit bb16a68
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 5 deletions.
4 changes: 4 additions & 0 deletions src/components/unstable/Layout/Layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
"header header"
"nav body";
}
.layout__container--full {
height: 100vh;
width: 100vw;
}

.layout__header {
grid-area: header;
Expand Down
4 changes: 2 additions & 2 deletions src/components/unstable/Layout/Layout.examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ const logo = require('../../../assets/tripwire-logo.png');
<Layout.Header>
<TopNav id='test-top-nav'>
<TopNav.Content className='dummy-test-classname' align="left">
<img src={logo} alt="TripWire Logo" width="75" />
<img src={logo} alt="TripWire Logo" width="75" style={{ marginTop: '8px' }} />
</TopNav.Content>
<TopNav.Content align="right">
<TopNav.Content link>
Audrey
{/* dropdown or logout link goes here */}
</TopNav.Content>
Expand Down
26 changes: 23 additions & 3 deletions src/components/unstable/Layout/Layout.jsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,29 @@
import './Layout.css'
import { generic } from '../../../util/component-factory'
import classnames from 'classnames'
import PropTypes from 'prop-types'
import React from 'react'

const Layout = generic({ name: 'Layout', className: 'layout__container' })
export default function Layout (props) {
const { className, children, full, ...rest } = props
const classes = classnames(
'layout__container',
full ? 'layout__container--full' : null,
className
)
return (
<div className={classes} {...rest}>
{children}
</div>
)
}
Layout.displayName = 'Layout'
Layout.propTypes = {
/**
* size the layout to the viewpost (100vh, 100vw)
*/
full: PropTypes.bool
}
Layout.Header = generic({ name: 'LayoutHeader', className: 'layout__header' })
Layout.Nav = generic({ name: 'LayoutNav', className: 'layout__nav' })
Layout.Body = generic({ name: 'LayoutBody', className: 'layout__body' })

export default Layout

0 comments on commit bb16a68

Please sign in to comment.