Skip to content

Commit fc1f208

Browse files
authored
fix: remove information icon customization (#1203)
1 parent 3f62bec commit fc1f208

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
lines changed

src/components/Notifications/ToastNotification/Animate.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ const Animate: FC<PropsWithChildren<Props>> = ({
4747
element.style.display = "none";
4848
};
4949
}
50+
// eslint-disable-next-line react-hooks/exhaustive-deps
5051
}, [show, removeState]);
5152

5253
if (removeState) {

src/components/Notifications/ToastNotification/Toast.scss

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
@import "vanilla-framework/scss/settings";
2-
@import "vanilla-framework/scss/build";
3-
41
.toast-animate {
52
position: relative;
63
z-index: 101;
@@ -13,21 +10,21 @@
1310
position: absolute;
1411
right: 0;
1512

16-
@media screen and (min-width: $breakpoint-small) and (max-width: $breakpoint-large) {
13+
@media screen and (min-width: 620px) and (max-width: 1036px) {
1714
width: 500px;
1815
}
1916

20-
@media screen and (min-width: $breakpoint-large) {
17+
@media screen and (min-width: 1036px) {
2118
width: 600px;
2219
}
2320
}
2421

2522
.toast-notification {
26-
box-shadow: 0 0 calc($sp-unit * 4) $sp-unit rgb(0 0 0 / 15%);
23+
box-shadow: 0 0 2rem 0.5rem rgb(0 0 0 / 15%);
2724
overflow: hidden;
2825
z-index: 101;
2926

30-
@media screen and (max-width: $breakpoint-small) {
27+
@media screen and (max-width: 620px) {
3128
left: 0;
3229
margin: 1.5rem auto;
3330
max-width: 400px;
@@ -37,7 +34,7 @@
3734

3835
.toast-notification-list {
3936
background-color: white;
40-
box-shadow: 0 0 calc($sp-unit * 4) $sp-unit rgb(0 0 0 / 22%);
37+
box-shadow: 0 0 2rem 0.5rem rgb(0 0 0 / 22%);
4138
max-height: calc(100vh - 4.5rem);
4239
overflow: auto;
4340
padding: 0 0.5rem;
@@ -66,7 +63,7 @@
6663
.dismiss-text {
6764
align-items: center;
6865
display: flex;
69-
gap: $sph--x-small;
66+
gap: 0.25rem;
7067
}
7168
}
7269

@@ -77,9 +74,9 @@
7774
align-items: center;
7875
border: none;
7976
display: flex;
80-
gap: $sph--x-small;
77+
gap: 0.25rem;
8178
justify-content: center;
82-
margin-right: $sph--small !important;
79+
margin-right: 0.5rem !important;
8380
padding: calc(0.4rem - 1px);
8481

8582
/* stylelint-disable max-nesting-depth */
@@ -88,25 +85,19 @@
8885
padding: 0;
8986
text-align: center;
9087
}
91-
92-
/* stylelint-disable-next-line selector-class-pattern */
93-
.p-icon--info--notification {
94-
@extend %icon;
95-
@include vf-icon-info-coloured-themed;
96-
}
9788
/* stylelint-enable max-nesting-depth */
9889
}
9990
}
10091

101-
@media screen and (max-width: $breakpoint-small) {
92+
@media screen and (max-width: 620px) {
10293
align-items: flex-start;
10394
flex-direction: column;
10495
gap: 0.5rem;
10596
margin-bottom: 0.5rem;
10697
}
10798
}
10899

109-
@media screen and (max-width: $breakpoint-small) {
100+
@media screen and (max-width: 620px) {
110101
bottom: 2rem;
111102
left: 0;
112103
margin: 1.5rem auto;

src/components/Notifications/ToastNotification/ToastNotification.stories.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ const PreloadedList = () => {
4444
"Please try again.",
4545
);
4646
toastNotify.toggleListView();
47+
// eslint-disable-next-line react-hooks/exhaustive-deps
4748
}, []);
4849

4950
return (

src/components/Notifications/ToastNotification/ToastNotificationList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ export const severityOrder = [
2828

2929
export const iconLookup = {
3030
positive: ICONS.success,
31-
// custom name for info icon to override default color from vanilla
32-
information: "info--notification",
31+
information: ICONS.information,
3332
caution: ICONS.warning,
3433
negative: ICONS.error,
3534
} as const;
@@ -55,6 +54,7 @@ const ToastNotificationList: FC<Props> = ({
5554

5655
useLayoutEffect(() => {
5756
adjustScrollPosition();
57+
// eslint-disable-next-line react-hooks/exhaustive-deps
5858
}, [notifications]);
5959

6060
// this layout effect is used to maintain scroll position of the

src/components/Notifications/ToastNotification/ToastNotificationProvider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ const ToastNotificationProvider: FC<PropsWithChildren> = ({ children }) => {
139139
clearTimeout(notificationTimer);
140140
}
141141
};
142+
// eslint-disable-next-line react-hooks/exhaustive-deps
142143
}, []);
143144

144145
const showNotificationWithDelay = () => {

0 commit comments

Comments
 (0)