Fix: remove inline styles
This commit is contained in:
parent
5412a3a1fc
commit
e723791916
2 changed files with 7 additions and 14 deletions
|
|
@ -58,12 +58,12 @@ const NotificationCenter = ({
|
||||||
hasUnreadProp,
|
hasUnreadProp,
|
||||||
notifButtonCoords
|
notifButtonCoords
|
||||||
}) => {
|
}) => {
|
||||||
const classes = useStyles()
|
|
||||||
const { data, loading } = useQuery(GET_NOTIFICATIONS, {
|
const { data, loading } = useQuery(GET_NOTIFICATIONS, {
|
||||||
pollInterval: 60000
|
pollInterval: 60000
|
||||||
})
|
})
|
||||||
const [showingUnread, setShowingUnread] = useState(false)
|
const [showingUnread, setShowingUnread] = useState(false)
|
||||||
const [xOffset, setXOffset] = useState(0)
|
const [xOffset, setXOffset] = useState(0)
|
||||||
|
const classes = useStyles({ notifButtonCoords, xOffset })
|
||||||
const machines = R.compose(
|
const machines = R.compose(
|
||||||
R.map(R.prop('name')),
|
R.map(R.prop('name')),
|
||||||
R.indexBy(R.prop('deviceId'))
|
R.indexBy(R.prop('deviceId'))
|
||||||
|
|
@ -117,14 +117,7 @@ const NotificationCenter = ({
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<button
|
<button onClick={close} className={classes.notificationIcon}>
|
||||||
onClick={close}
|
|
||||||
className={classes.notificationIcon}
|
|
||||||
style={{
|
|
||||||
position: 'absolute',
|
|
||||||
top: notifButtonCoords.y,
|
|
||||||
left: notifButtonCoords.x - xOffset
|
|
||||||
}}>
|
|
||||||
<NotificationIconZodiac />
|
<NotificationIconZodiac />
|
||||||
{hasUnread && <div className={classes.hasUnread} />}
|
{hasUnread && <div className={classes.hasUnread} />}
|
||||||
</button>
|
</button>
|
||||||
|
|
|
||||||
|
|
@ -37,17 +37,17 @@ const styles = {
|
||||||
marginLeft: spacer * 2,
|
marginLeft: spacer * 2,
|
||||||
height: 0
|
height: 0
|
||||||
},
|
},
|
||||||
notificationIcon: {
|
notificationIcon: ({ notifButtonCoords, xOffset }) => ({
|
||||||
/* position: 'absolute',
|
position: 'absolute',
|
||||||
left: spacer * 22 + 2,
|
top: notifButtonCoords ? notifButtonCoords.y : 0,
|
||||||
top: spacer + 5, */
|
left: notifButtonCoords ? notifButtonCoords.x - xOffset : 0,
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
background: 'transparent',
|
background: 'transparent',
|
||||||
boxShadow: '0px 0px 0px transparent',
|
boxShadow: '0px 0px 0px transparent',
|
||||||
border: '0px solid transparent',
|
border: '0px solid transparent',
|
||||||
textShadow: '0px 0px 0px transparent',
|
textShadow: '0px 0px 0px transparent',
|
||||||
outline: 'none'
|
outline: 'none'
|
||||||
},
|
}),
|
||||||
clearAllButton: {
|
clearAllButton: {
|
||||||
marginTop: -spacer * 2,
|
marginTop: -spacer * 2,
|
||||||
marginLeft: spacer,
|
marginLeft: spacer,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue