From ca9892c56ab97615c592e58734c44942d7037f0d Mon Sep 17 00:00:00 2001 From: Aaron Cook Date: Wed, 4 Oct 2023 16:40:45 +0200 Subject: [PATCH] feat: notification settings link (#2578) * feat: add link to notification settings in centre * fix: pass `query` * fix: remove expansion increase * fix: adjust text + alignment * fix: reduce vertical padding * fix: close centre on navigation --- .../NotificationCenter/index.tsx | 61 ++++++++++++------- .../NotificationCenter/styles.module.css | 10 ++- 2 files changed, 49 insertions(+), 22 deletions(-) diff --git a/src/components/notification-center/NotificationCenter/index.tsx b/src/components/notification-center/NotificationCenter/index.tsx index 89ff2e55d7..c89d72f015 100644 --- a/src/components/notification-center/NotificationCenter/index.tsx +++ b/src/components/notification-center/NotificationCenter/index.tsx @@ -3,8 +3,8 @@ import ButtonBase from '@mui/material/ButtonBase' import Popover from '@mui/material/Popover' import Paper from '@mui/material/Paper' import Typography from '@mui/material/Typography' -import Button from '@mui/material/Button' import IconButton from '@mui/material/IconButton' +import MuiLink from '@mui/material/Link' import BellIcon from '@/public/images/notifications/bell.svg' import ExpandMoreIcon from '@mui/icons-material/ExpandMore' import ExpandLessIcon from '@mui/icons-material/ExpandLess' @@ -17,6 +17,10 @@ import { } from '@/store/notificationsSlice' import NotificationCenterList from '@/components/notification-center/NotificationCenterList' import UnreadBadge from '@/components/common/UnreadBadge' +import Link from 'next/link' +import { useRouter } from 'next/router' +import { AppRoutes } from '@/config/routes' +import SettingsIcon from '@/public/images/sidebar/settings.svg' import css from './styles.module.css' import { trackEvent, OVERVIEW_EVENTS } from '@/services/analytics' @@ -25,6 +29,7 @@ import SvgIcon from '@mui/icons-material/ExpandLess' const NOTIFICATION_CENTER_LIMIT = 4 const NotificationCenter = (): ReactElement => { + const router = useRouter() const [showAll, setShowAll] = useState(false) const [anchorEl, setAnchorEl] = useState(null) const open = Boolean(anchorEl) @@ -124,32 +129,46 @@ const NotificationCenter = (): ReactElement => { )} {notifications.length > 0 && ( - + )}
- {canExpand && ( -
- setShowAll((prev) => !prev)} disableRipple className={css.expandButton}> - - - - - palette.border.main }}> - {showAll ? 'Hide' : `${notifications.length - NOTIFICATION_CENTER_LIMIT} other notifications`} - -
- )} +
+ {canExpand && ( + <> + setShowAll((prev) => !prev)} disableRipple className={css.expandButton}> + + + + + palette.border.main }}> + {showAll ? 'Hide' : `${notifications.length - NOTIFICATION_CENTER_LIMIT} other notifications`} + + + )} + + + Settings + + +
diff --git a/src/components/notification-center/NotificationCenter/styles.module.css b/src/components/notification-center/NotificationCenter/styles.module.css index 4994b0d952..dab2d17faf 100644 --- a/src/components/notification-center/NotificationCenter/styles.module.css +++ b/src/components/notification-center/NotificationCenter/styles.module.css @@ -28,7 +28,7 @@ } .popoverFooter { - padding: var(--space-2); + padding: var(--space-2) var(--space-3); display: flex; align-items: center; } @@ -57,3 +57,11 @@ width: 18px; height: 18px; } + +.settingsLink { + margin-left: auto; + display: flex; + align-items: center; + text-decoration: unset; + gap: var(--space-1); +}