diff --git a/new-lamassu-admin/src/components/NotificationCenter/NotificationCenter.js b/new-lamassu-admin/src/components/NotificationCenter/NotificationCenter.js index d93c2aee..67095851 100644 --- a/new-lamassu-admin/src/components/NotificationCenter/NotificationCenter.js +++ b/new-lamassu-admin/src/components/NotificationCenter/NotificationCenter.js @@ -153,7 +153,6 @@ const NotificationCenter = ({ {!loading && buildNotifications()} -
) } diff --git a/new-lamassu-admin/src/components/NotificationCenter/NotificationCenter.styles.js b/new-lamassu-admin/src/components/NotificationCenter/NotificationCenter.styles.js index 150ce6d6..49f0456f 100644 --- a/new-lamassu-admin/src/components/NotificationCenter/NotificationCenter.styles.js +++ b/new-lamassu-admin/src/components/NotificationCenter/NotificationCenter.styles.js @@ -8,22 +8,16 @@ import { } from 'src/styling/variables' const styles = { - background: { - position: 'absolute', - width: '100vw', - height: '100vh', - left: 0, - top: 0, - zIndex: -1, + container: { + '@media only screen and (max-width: 1920px)': { + width: '30vw' + }, + width: '40vw', + height: '110vh', + right: 0, backgroundColor: white, boxShadow: '0 0 14px 0 rgba(0, 0, 0, 0.24)' }, - container: { - left: -200, - top: -42, - backgroundColor: white, - height: '110vh' - }, header: { display: 'flex', justifyContent: 'space-between' @@ -39,7 +33,7 @@ const styles = { }, notificationIcon: ({ buttonCoords, xOffset }) => ({ position: 'absolute', - top: buttonCoords ? buttonCoords.y - 1 : 0, + top: buttonCoords ? buttonCoords.y : 0, left: buttonCoords ? buttonCoords.x - xOffset : 0, cursor: 'pointer', background: 'transparent', @@ -54,21 +48,33 @@ const styles = { backgroundColor: zircon }, notificationsList: { - width: 440, height: '90vh', maxHeight: '100vh', marginTop: spacer * 3, marginLeft: 0, - marginRight: -50, overflowY: 'auto', overflowX: 'hidden', backgroundColor: white, zIndex: 10 }, notificationRow: { + display: 'flex', + flexDirection: 'row', + justifyContent: 'flex-start', position: 'relative', marginBottom: spacer / 2, - paddingTop: spacer * 1.5 + paddingTop: spacer * 1.5, + '& > *': { + marginRight: 10 + }, + '& > *:last-child': { + marginRight: 0 + } + }, + notificationContent: { + display: 'flex', + flexDirection: 'column', + justifyContent: 'center' }, unread: { backgroundColor: spring3 @@ -79,6 +85,9 @@ const styles = { marginLeft: spacer * 3 } }, + readIconWrapper: { + flexGrow: 1 + }, unreadIcon: { marginLeft: spacer, marginTop: 5, diff --git a/new-lamassu-admin/src/components/NotificationCenter/NotificationRow.js b/new-lamassu-admin/src/components/NotificationCenter/NotificationRow.js index 6451d191..75d97ecd 100644 --- a/new-lamassu-admin/src/components/NotificationCenter/NotificationRow.js +++ b/new-lamassu-admin/src/components/NotificationCenter/NotificationRow.js @@ -1,4 +1,3 @@ -import Grid from '@material-ui/core/Grid' import { makeStyles } from '@material-ui/core/styles' import classnames from 'classnames' import prettyMs from 'pretty-ms' @@ -54,36 +53,27 @@ const NotificationRow = ({ [classes.unreadIcon]: !read } return ( - - - {icon} - - - - - {notificationTitle} - - - - {message} - - - {age} - - - +
{icon}
+
+ + {notificationTitle} + + {message} + {age} +
+
toggleClear(id)} className={classnames(iconClass)} /> - +
{!valid && } - +
) } diff --git a/new-lamassu-admin/src/components/layout/Header.js b/new-lamassu-admin/src/components/layout/Header.js index 1c567359..12e57ae5 100644 --- a/new-lamassu-admin/src/components/layout/Header.js +++ b/new-lamassu-admin/src/components/layout/Header.js @@ -103,7 +103,7 @@ const Header = memo(({ tree, user }) => { const handleClick = event => { const coords = notifCenterButtonRef.current.getBoundingClientRect() - setNotifButtonCoords({ x: coords.x, y: coords.y }) + setNotifButtonCoords({ x: coords.x, y: coords.y + 5 }) setAnchorEl(anchorEl ? null : event.currentTarget) document.querySelector('#root').classList.add('root-notifcenter-open') @@ -132,7 +132,7 @@ const Header = memo(({ tree, user }) => { return ( { if (!match) return false setActive(it) @@ -173,10 +173,16 @@ const Header = memo(({ tree, user }) => { anchorEl={anchorEl} className={classes.popper} disablePortal={false} + placement="bottom-end" modifiers={{ + offset: { + enabled: true, + offset: '100vw' + }, preventOverflow: { enabled: true, - boundariesElement: 'viewport' + boundariesElement: 'viewport', + padding: 0 } }}>