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

Commit

Permalink
Merge pull request #310 from Tripwire/feat/add-notification-layout
Browse files Browse the repository at this point in the history
feat(layout) add layout for notifications (re-do)
  • Loading branch information
pfaffle authored Oct 5, 2018
2 parents 543b9d0 + 7b38bc5 commit ebcff67
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/components/BannerMessage/BannerMessage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import classnames from 'classnames'
*/

const BannerMessage = props => {
const { button, closed, header, icon, children, info, warning, error, success, onCloseClicked, ...rest } = props
const { className, button, closed, header, icon, children, info, warning, error, success, onCloseClicked, ...rest } = props
const forceInfo = !info && !warning && !error && !success

function getOneDismissElement () {
Expand Down Expand Up @@ -52,7 +52,7 @@ const BannerMessage = props => {
const DismissElement = getOneDismissElement()

return (
<div className='banner-message__wrapper'>
<div className={classnames('banner-message__wrapper', className)}>
<div
className={classnames(
'banner-message',
Expand Down
10 changes: 10 additions & 0 deletions src/components/unstable/Layout/Layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@
"header header"
"nav body";
}
.layout__container--notifying {
grid-template-rows: auto auto 1fr;
grid-template-areas:
"header header"
"nav notification"
"nav body";
}
.layout__container--full {
height: 100vh;
width: 100vw;
Expand All @@ -20,6 +27,9 @@
.layout__nav {
grid-area: nav;
}
.layout__notification {
grid-area: notification;
}
.layout__body {
grid-area: body;
overflow: auto;
Expand Down
14 changes: 11 additions & 3 deletions src/components/unstable/Layout/Layout.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ import PropTypes from 'prop-types'
import React from 'react'

export default function Layout (props) {
const { className, children, full, ...rest } = props
const { className, children, full, notifying, ...rest } = props
const classes = classnames(
'layout__container',
full ? 'layout__container--full' : null,
{
'layout__container--full': full,
'layout__container--notifying': notifying
},
className
)
return (
Expand All @@ -22,8 +25,13 @@ Layout.propTypes = {
/**
* size the layout to the viewpost (100vh, 100vw)
*/
full: PropTypes.bool
full: PropTypes.bool,
/**
* provide a container for notifications between the header and the body
*/
notifying: PropTypes.bool
}
Layout.Header = generic({ name: 'LayoutHeader', className: 'layout__header' })
Layout.Nav = generic({ name: 'LayoutNav', className: 'layout__nav' })
Layout.Notification = generic({ name: 'LayoutNotification', className: 'layout__notification' })
Layout.Body = generic({ name: 'LayoutBody', className: 'layout__body' })
1 change: 0 additions & 1 deletion src/styles/components/banner-message.css
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
}

.banner-message {
z-index: 999;
margin-top: 0;
transition: all 2s ease-in;
}
Expand Down

0 comments on commit ebcff67

Please sign in to comment.