Skip to content

Commit 7b7d7b7

Browse files
committed
PM-2133 - update desktop styles
1 parent 1fc2ecd commit 7b7d7b7

File tree

6 files changed

+40
-11
lines changed

6 files changed

+40
-11
lines changed

src/libs/shared/lib/components/notifications/Notifications.container.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ import { FC } from 'react'
33
import { Notification } from '~/libs/ui'
44

55
import { NotificationContextType, useNotification } from './Notifications.context'
6+
import styles from './NotificationsContainer.module.scss'
67

78
const NotificationsContainer: FC = () => {
89
const { notifications, removeNotification }: NotificationContextType = useNotification()
910

1011
return (
11-
<div>
12+
<div className={styles.wrap}>
1213
{notifications.map(n => (
1314
<Notification key={n.id} notification={n} onClose={removeNotification} />
1415
))}

src/libs/shared/lib/components/notifications/Notifications.context.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export type NotificationType = 'success' | 'error' | 'info' | 'warning' | 'banne
99
export interface Notification {
1010
id: string;
1111
type: NotificationType;
12+
icon?: ReactNode
1213
message: string;
1314
duration?: number; // in ms
1415
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
@import "@libs/ui/styles/includes";
2+
3+
.wrap {
4+
position: relative;
5+
width: 100%;
6+
z-index: 1000;
7+
}

src/libs/ui/lib/components/notification/Notification.tsx

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
import { FC, useCallback } from 'react'
1+
import { FC, ReactNode, useCallback } from 'react'
22

33
import { NotificationBanner } from './banner'
44

55
interface NotificationProps {
6-
notification: { message: string; id: string; type: string }
6+
notification: {
7+
icon?: ReactNode;
8+
id: string;
9+
message: string;
10+
type: string;
11+
}
712
onClose: (id: string, save?: boolean) => void
813
}
914

@@ -15,6 +20,7 @@ const Notification: FC<NotificationProps> = props => {
1520
if (props.notification.type === 'banner') {
1621
return (
1722
<NotificationBanner
23+
icon={props.notification.icon}
1824
content={props.notification.message}
1925
onClose={handleClose}
2026
/>

src/libs/ui/lib/components/notification/banner/NotificationBanner.module.scss

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,35 @@
44
background: #60267D;
55
color: $tc-white;
66

7+
font-family: "Nunito Sans", sans-serif;
8+
font-size: 14px;
9+
line-height: 20px;
10+
711
.inner {
812
max-width: $xxl-min;
9-
padding: $sp-3 0;
13+
padding: $sp-2 0;
1014
@include pagePaddings;
1115
margin: 0 auto;
1216
width: 100%;
1317
display: flex;
1418
justify-content: space-between;
1519
align-items: center;
16-
@include ltemd {
17-
display: block;
18-
position: relative;
19-
}
2020
}
2121
}
2222

2323
.close {
2424
cursor: pointer;
2525
color: $tc-white;
26+
flex: 0 0;
27+
margin-left: auto;
28+
border-radius: 50%;
29+
border: 2px solid white;
30+
@include ltemd {
31+
margin-left: $sp-3;
32+
}
33+
}
34+
35+
.icon {
36+
flex: 0 0;
37+
margin-right: $sp-2;
2638
}

src/libs/ui/lib/components/notification/banner/NotificationBanner.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import { FC, ReactNode, useCallback } from 'react'
22

3-
import { InformationCircleIcon, XCircleIcon } from '@heroicons/react/outline'
3+
import { InformationCircleIcon } from '@heroicons/react/outline'
4+
5+
import { IconOutline } from '../../svgs'
46

57
import styles from './NotificationBanner.module.scss'
68

@@ -20,7 +22,7 @@ const NotificationBanner: FC<NotificationBannerProps> = props => {
2022
<div className={styles.wrap}>
2123
<div className={styles.inner}>
2224
{props.icon || (
23-
<div>
25+
<div className={styles.icon}>
2426
<InformationCircleIcon className='icon-xl' />
2527
</div>
2628
)}
@@ -29,7 +31,7 @@ const NotificationBanner: FC<NotificationBannerProps> = props => {
2931

3032
{!props.persistent && (
3133
<div className={styles.close} onClick={handleClose}>
32-
<XCircleIcon className='icon-xl' />
34+
<IconOutline.XIcon className='icon-lg' />
3335
</div>
3436
)}
3537
</div>

0 commit comments

Comments
 (0)