Skip to content

Commit

Permalink
Make appbar notification icons consistent accross new UI pages (#659)
Browse files Browse the repository at this point in the history
* Swap enableNotifications flag to on by default

the enableNotifications flag on the template.purs was true by default.
It made more sense to be disableNotifications and false by default, so
that the most common case is the unset case.

* Remove inherit colour inline style on logout icon

logout icon was set to inherit colour which meant it was unaffected by
theming. Removed this style.
  • Loading branch information
SammyIsConfused authored and doolse committed Dec 18, 2018
1 parent 991aeb9 commit 282d2e7
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ type TemplateProps = (
menuMode :: String,
fullscreenMode :: String,
hideAppBar :: Boolean,
enableNotifications :: Boolean,
disableNotifications :: Boolean,
innerRef :: Nullable (EffectFn1 (Nullable TemplateRef) Unit),
errorResponse :: Nullable ErrorResponse
)
Expand Down Expand Up @@ -172,7 +172,7 @@ templateDefaults title = {
fixedViewPort:nullAny,
preventNavigation:nullAny,
menuExtra:nullAny,
enableNotifications: true,
disableNotifications: false,
tabs:nullAny,
backRoute: nullAny,
footer: nullAny,
Expand Down Expand Up @@ -300,15 +300,14 @@ templateClass = withStyles ourStyles $ R.component "Template" $ \this -> do
userMaybe l = user ^? (_Just <<< l)
userMenu = D.div [DP.className classes.userMenu ] $ (fromMaybe [] $ toMaybe menuExtra) <>
(
(guard $ props.enableNotifications && (not $ fromMaybe true $ userMaybe _guest)) *>
(guard $ not props.disableNotifications && (not $ fromMaybe true $ userMaybe _guest)) *>
[
hidden {mdDown:true} [
badgedLink "assignment" _tasks "access/tasklist.do" topBarString.tasks ,
badgedLink "notifications" _notifications "access/notifications.do" topBarString.notifications
],
tooltip {title: strings.menu.title} $
iconButton {"aria-label": strings.menu.title,
color: inherit,
iconButton {"aria-label": strings.menu.title,
onClick: withCurrentTarget $ d <<< UserMenuAnchor <<< Just}
[ icon_ [ D.text "account_circle"] ],
menu {
Expand Down

0 comments on commit 282d2e7

Please sign in to comment.