From ce436627248e44f9ba5e73f5a6e05ae148706de4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Fri, 1 Nov 2024 13:01:28 +0000 Subject: [PATCH 1/6] fix: spacing and color --- .../components/Notifications/NotificationMenu.tsx | 4 ++-- .../src/components/Sidemenu/Sidemenu.css.ts | 14 ++++++++++++-- .../my-pages/src/components/Sidemenu/Sidemenu.tsx | 4 ++-- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx b/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx index 35806e33d7d4..0a2d077e1389 100644 --- a/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx +++ b/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx @@ -51,7 +51,7 @@ const NotificationMenu = ({ onClick={onClose} aria-label={formatMessage(sharedMessages.close)} > - + ) @@ -93,7 +93,7 @@ const NotificationMenu = ({ justifyContent="center" alignItems="center" className={mStyles.overviewIcon} - marginRight={1} + marginRight={'p2'} > svg`, { + color: theme.color.blue400, +}) + export const itemLink = style({ width: '100%', ':hover': { diff --git a/apps/portals/my-pages/src/components/Sidemenu/Sidemenu.tsx b/apps/portals/my-pages/src/components/Sidemenu/Sidemenu.tsx index ae17b9dc87c5..d2fecd5e4fa2 100644 --- a/apps/portals/my-pages/src/components/Sidemenu/Sidemenu.tsx +++ b/apps/portals/my-pages/src/components/Sidemenu/Sidemenu.tsx @@ -47,7 +47,7 @@ const Sidemenu = ({ onClick={() => setSideMenuOpen(false)} aria-label={formatMessage(sharedMessages.close)} > - + ) @@ -89,7 +89,7 @@ const Sidemenu = ({ justifyContent="center" alignItems="center" className={styles.overviewIcon} - marginRight={2} + marginRight={'p2'} > From f320adb290a423c6312c6046310f87ce4f659fc7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81sd=C3=ADs=20Erna=20Gu=C3=B0mundsd=C3=B3ttir?= Date: Sat, 2 Nov 2024 22:31:18 +0000 Subject: [PATCH 2/6] mobile ui --- .../Notifications/NotificationLine.tsx | 18 +++++++++++++----- .../Notifications/NotificationMenu.tsx | 6 ++++-- .../Notifications/Notifications.css.ts | 2 -- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/apps/portals/my-pages/src/components/Notifications/NotificationLine.tsx b/apps/portals/my-pages/src/components/Notifications/NotificationLine.tsx index bb1dde899f58..2082a5f08e4e 100644 --- a/apps/portals/my-pages/src/components/Notifications/NotificationLine.tsx +++ b/apps/portals/my-pages/src/components/Notifications/NotificationLine.tsx @@ -15,6 +15,8 @@ import { COAT_OF_ARMS, resolveLink, } from '@island.is/service-portal/information' +import { useWindowSize } from 'react-use' +import { theme } from '@island.is/island-ui/theme' interface Props { data: { @@ -26,6 +28,10 @@ interface Props { } export const NotificationLine = ({ data, onClickCallback }: Props) => { + const { width } = useWindowSize() + + const isMobile = width < theme.breakpoints.md + const date = data.metadata?.created ? format(new Date(data.metadata.created), dateFormat.is) : '' @@ -44,7 +50,7 @@ export const NotificationLine = ({ data, onClickCallback }: Props) => { position="relative" borderColor="blue200" borderBottomWidth="standard" - paddingX={2} + padding={2} width="full" className={cn(styles.line, { [styles.unread]: !isRead, @@ -60,7 +66,7 @@ export const NotificationLine = ({ data, onClickCallback }: Props) => { width="full" display="flex" flexDirection="column" - paddingLeft={2} + paddingLeft={isMobile ? 'p2' : 2} minWidth={0} > { > {data.message.title} - {date} + {date} { flexDirection="row" justifyContent="spaceBetween" > - {data.message.displayBody} + + {data.message.displayBody} + diff --git a/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx b/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx index 0a2d077e1389..7b987f4d745b 100644 --- a/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx +++ b/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx @@ -60,7 +60,7 @@ const NotificationMenu = ({ Date: Mon, 11 Nov 2024 10:23:26 +0000 Subject: [PATCH 3/6] fix: spacing for link --- .../src/components/Notifications/NotificationMenu.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx b/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx index 7b987f4d745b..eb797c57b4f1 100644 --- a/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx +++ b/apps/portals/my-pages/src/components/Notifications/NotificationMenu.tsx @@ -115,8 +115,8 @@ const NotificationMenu = ({ /> ))} @@ -127,7 +127,7 @@ const NotificationMenu = ({