File tree Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Expand file tree Collapse file tree 2 files changed +16
-5
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,14 @@ const Container = styled.div`
68
68
align-items: flex-start;
69
69
border: 1px solid ${ ( { theme } ) => theme . colors . border . main } ;
70
70
71
+ &.toast__item--minimized {
72
+ align-items: center;
73
+ button {
74
+ height: auto !important;
75
+ padding: 0;
76
+ }
77
+ }
78
+
71
79
.toast__item__status {
72
80
flex: 0 0 auto;
73
81
margin-right: ${ ( { theme } ) => theme . sizes . spaces . sm } px;
@@ -148,6 +156,7 @@ class ToastItem extends React.Component<ToastItemProps, ToastItemState> {
148
156
className = { cc ( [
149
157
`toast__item` ,
150
158
`toast__item--${ this . props . item . type } ` ,
159
+ this . props . item . title == null && `toast__item--minimized` ,
151
160
this . props . onClick != null && 'toast__item--button' ,
152
161
] ) }
153
162
>
@@ -164,9 +173,11 @@ class ToastItem extends React.Component<ToastItemProps, ToastItemState> {
164
173
/>
165
174
</ div >
166
175
< div className = 'toast__item__content' >
167
- < strong className = 'toast__item__title' >
168
- { this . props . item . title }
169
- </ strong >
176
+ { this . props . item . title != null && (
177
+ < strong className = 'toast__item__title' >
178
+ { this . props . item . title }
179
+ </ strong >
180
+ ) }
170
181
< p className = 'toast__item__description' >
171
182
{ this . props . item . description }
172
183
</ p >
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import { createStoreContext } from '../../utils/context'
4
4
5
5
export interface ToastMessage {
6
6
id : string
7
- title : string
7
+ title ? : string
8
8
description : string
9
9
type ?: 'info' | 'error' | 'success'
10
10
createdAt : Date
@@ -57,7 +57,7 @@ const useToastStore = (): ToastStore => {
57
57
{
58
58
id : generateSecret ( ) ,
59
59
createdAt : new Date ( ) ,
60
- title,
60
+ title : process . env . NODE_ENV === 'development' ? title : undefined ,
61
61
type : 'error' ,
62
62
description,
63
63
} ,
You can’t perform that action at this time.
0 commit comments