From 92cb960ba7bcf7b78ff5c2def36725d198c8785c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 12 Jun 2024 15:35:15 +0800 Subject: [PATCH] chore: rollback --- src/components/toast/toast.less | 7 ++++++- src/components/toast/toast.tsx | 26 ++++++++++++++------------ 2 files changed, 20 insertions(+), 13 deletions(-) diff --git a/src/components/toast/toast.less b/src/components/toast/toast.less index d3d855f2ac..05871a9b8b 100644 --- a/src/components/toast/toast.less +++ b/src/components/toast/toast.less @@ -30,7 +30,7 @@ } .@{class-prefix-toast}-main-text { padding: 12px; - min-width: 0px; + min-width: 0; } .@{class-prefix-toast}-main-icon { padding: 35px 12px; @@ -43,3 +43,8 @@ } } } + +.@{class-prefix-toast}-loading { + --size: 48px; + margin: 0 auto 8px; +} diff --git a/src/components/toast/toast.tsx b/src/components/toast/toast.tsx index 451b18fe20..fe7a7cbdc8 100644 --- a/src/components/toast/toast.tsx +++ b/src/components/toast/toast.tsx @@ -31,19 +31,21 @@ const defaultProps = { stopPropagation: ['click'], } -export const InternalToast: FC = props => { - const mergedProps = mergeProps(defaultProps, props) - const { maskClickable, content, icon, position } = mergedProps +export const InternalToast: FC = p => { + const props = mergeProps(defaultProps, p) + const { maskClickable, content, icon, position } = props const iconElement = useMemo(() => { if (icon === null || icon === undefined) return null switch (icon) { case 'success': - return + return case 'fail': - return + return case 'loading': - return + return ( + + ) default: return icon } @@ -62,18 +64,18 @@ export const InternalToast: FC = props => { return (