File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { getStringId } from '../../utils';
5
5
import { Button } from '../Button' ;
6
6
import { Icon } from '../Icon' ;
7
7
import { IconButton } from '../IconButton' ;
8
+ import { Spinner } from '../Spinner' ;
8
9
9
10
export interface ToastProps extends CommonToastProps , HTMLAttributes < HTMLDivElement > {
10
11
/**
@@ -50,6 +51,8 @@ export const Toast: FC<ToastProps> = ({
50
51
return 'Warning' ;
51
52
case 'error' :
52
53
return 'Error' ;
54
+ case 'loading' :
55
+ return undefined ;
53
56
}
54
57
} , [ message ] ) ;
55
58
@@ -66,7 +69,7 @@ export const Toast: FC<ToastProps> = ({
66
69
aria-atomic = { ariaAtomic }
67
70
>
68
71
< div className = "ui__toast__border" />
69
- < Icon icon = { icon } className = "ui__toast__icon" />
72
+ { icon ? < Icon icon = { icon } className = "ui__toast__icon" /> : < Spinner className = "ui__toast__spinner" /> }
70
73
< div className = "ui__toast__copy" >
71
74
{ heading ? (
72
75
< div className = "ui__toast__copy__heading" id = { headingId } >
Original file line number Diff line number Diff line change 16
16
}
17
17
18
18
& --message {
19
- & -info {
19
+ & -info ,
20
+ & -loading {
20
21
.ui__toast__border {
21
22
background-color : $color-message-info ;
22
23
}
64
65
flex-shrink : 0 ;
65
66
}
66
67
68
+ & __spinner {
69
+ margin : 0 $padding-medium ;
70
+ @include flex-center ;
71
+ flex-shrink : 0 ;
72
+ height : 100% ;
73
+
74
+ > * {
75
+ height : 20px ;
76
+ width : 20px ;
77
+ }
78
+ }
79
+
67
80
& __copy {
68
81
padding : $padding-small $padding $padding-small 0 ;
69
82
display : flex ;
You can’t perform that action at this time.
0 commit comments