Skip to content

Commit b7cd3bb

Browse files
committed
remove error message from prod messages
1 parent ec8190c commit b7cd3bb

File tree

2 files changed

+16
-5
lines changed

2 files changed

+16
-5
lines changed

src/design/components/organisms/Toast.tsx

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,14 @@ const Container = styled.div`
6868
align-items: flex-start;
6969
border: 1px solid ${({ theme }) => theme.colors.border.main};
7070
71+
&.toast__item--minimized {
72+
align-items: center;
73+
button {
74+
height: auto !important;
75+
padding: 0;
76+
}
77+
}
78+
7179
.toast__item__status {
7280
flex: 0 0 auto;
7381
margin-right: ${({ theme }) => theme.sizes.spaces.sm}px;
@@ -148,6 +156,7 @@ class ToastItem extends React.Component<ToastItemProps, ToastItemState> {
148156
className={cc([
149157
`toast__item`,
150158
`toast__item--${this.props.item.type}`,
159+
this.props.item.title == null && `toast__item--minimized`,
151160
this.props.onClick != null && 'toast__item--button',
152161
])}
153162
>
@@ -164,9 +173,11 @@ class ToastItem extends React.Component<ToastItemProps, ToastItemState> {
164173
/>
165174
</div>
166175
<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+
)}
170181
<p className='toast__item__description'>
171182
{this.props.item.description}
172183
</p>

src/design/lib/stores/toast/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { createStoreContext } from '../../utils/context'
44

55
export interface ToastMessage {
66
id: string
7-
title: string
7+
title?: string
88
description: string
99
type?: 'info' | 'error' | 'success'
1010
createdAt: Date
@@ -57,7 +57,7 @@ const useToastStore = (): ToastStore => {
5757
{
5858
id: generateSecret(),
5959
createdAt: new Date(),
60-
title,
60+
title: process.env.NODE_ENV === 'development' ? title : undefined,
6161
type: 'error',
6262
description,
6363
},

0 commit comments

Comments
 (0)