Merge pull request #59 from havfo/feat/notifications-layout

Push out notifications when opening sidebar
master
Håvar Aambø Fosstveit 2018-08-03 10:33:17 +02:00 committed by GitHub
commit fd9b509b97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 6 deletions

View File

@ -6,10 +6,15 @@ import * as appPropTypes from './appPropTypes';
import * as stateActions from '../redux/stateActions'; import * as stateActions from '../redux/stateActions';
import { Appear } from './transitions'; import { Appear } from './transitions';
const Notifications = ({ notifications, onClick }) => const Notifications = ({ notifications, onClick, toolAreaOpen }) =>
{ {
return ( return (
<div data-component='Notifications'> <div
data-component='Notifications'
className={classnames({
'toolarea-open' : toolAreaOpen
})}
>
{ {
notifications.map((notification) => notifications.map((notification) =>
{ {
@ -33,14 +38,18 @@ const Notifications = ({ notifications, onClick }) =>
Notifications.propTypes = Notifications.propTypes =
{ {
notifications : PropTypes.arrayOf(appPropTypes.Notification).isRequired, notifications : PropTypes.arrayOf(appPropTypes.Notification).isRequired,
onClick : PropTypes.func.isRequired onClick : PropTypes.func.isRequired,
toolAreaOpen : PropTypes.bool
}; };
const mapStateToProps = (state) => const mapStateToProps = (state) =>
{ {
const { notifications } = state; const { notifications } = state;
return { notifications }; return {
notifications,
toolAreaOpen : state.toolarea.toolAreaOpen
};
}; };
const mapDispatchToProps = (dispatch) => const mapDispatchToProps = (dispatch) =>

View File

@ -2,14 +2,19 @@
position: absolute; position: absolute;
z-index: 1010; z-index: 1010;
pointer-events: none; pointer-events: none;
top: 0; top: 45px;
right: 65px; right: 0;
bottom: 0; bottom: 0;
padding: 20px; padding: 20px;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: flex-start; justify-content: flex-start;
align-items: flex-end; align-items: flex-end;
transition: right 0.3s;
&.toolarea-open {
right: 25%;
}
+desktop() { +desktop() {
padding: 10px; padding: 10px;