Skip to content

Commit c1a1b93

Browse files
committed
style: update message
1 parent 6e41fbd commit c1a1b93

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

components/message/index.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ const typeToIcon = {
105105
warning: ExclamationCircleFilled,
106106
loading: LoadingOutlined,
107107
};
108-
108+
export const typeList = Object.keys(typeToIcon) as NoticeType[];
109109
export interface MessageType extends PromiseLike<any> {
110110
(): void;
111111
}
@@ -220,9 +220,7 @@ export function attachTypeApi(originalApi: MessageApi, type: NoticeType) {
220220
};
221221
}
222222

223-
(['success', 'info', 'warning', 'error', 'loading'] as NoticeType[]).forEach(type =>
224-
attachTypeApi(api, type),
225-
);
223+
typeList.forEach(type => attachTypeApi(api, type));
226224

227225
api.warn = api.warning;
228226

0 commit comments

Comments
 (0)