From 8134581a14e2aa20ec24ee2639d43ba380d981b3 Mon Sep 17 00:00:00 2001 From: janlay Date: Wed, 28 Jul 2021 15:27:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8Dmodal-confirm=E5=86=85?= =?UTF-8?q?=E4=B8=8D=E5=B8=A6icon=E5=8A=A0=E8=BD=BD=E6=97=B6=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F=E9=94=99=E4=B9=B1=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/ui/modal/src/index.less | 29 ++++++++++++++--------------- packages/ui/modal/src/index.tsx | 6 +----- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/packages/ui/modal/src/index.less b/packages/ui/modal/src/index.less index e32510dd..80649496 100644 --- a/packages/ui/modal/src/index.less +++ b/packages/ui/modal/src/index.less @@ -50,46 +50,45 @@ } .@{osui-modal-class-prefix}-confirm { - &-icon svg.osui-icon { - float: left; - width: 36px; - height: 36px; - margin-right: 20px; - font-size: 14px; - } - .@{ant-prefix}-modal-confirm-body { min-height: 76px; border-bottom: var(--modal-body-border-bottom); + + & > svg.osui-icon { + float: left; + width: 36px; + height: 36px; + margin-right: 20px; + font-size: 14px; + } } .@{ant-prefix}-modal-confirm-content { margin-bottom: 40px; - margin-left: 55px; } .@{ant-prefix}-modal-confirm-btns { margin-top: 15px; } - &.@{ant-prefix}-modal-confirm-warning .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon, - &.@{ant-prefix}-modal-confirm-confirm .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon { + &.@{ant-prefix}-modal-confirm-warning .@{ant-prefix}-modal-confirm-body > svg.osui-icon, + &.@{ant-prefix}-modal-confirm-confirm .@{ant-prefix}-modal-confirm-body > svg.osui-icon { color: var(--theme-warning-color); } - &.@{ant-prefix}-modal-confirm-success .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon { + &.@{ant-prefix}-modal-confirm-success .@{ant-prefix}-modal-confirm-body > svg.osui-icon { color: var(--theme-success-color); } - &.@{ant-prefix}-modal-confirm-info .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon { + &.@{ant-prefix}-modal-confirm-info .@{ant-prefix}-modal-confirm-body > svg.osui-icon { color: var(--theme-info-color); } - &.@{ant-prefix}-modal-confirm-error .@{ant-prefix}-modal-confirm-body &-icon svg.osui-icon { + &.@{ant-prefix}-modal-confirm-error .@{ant-prefix}-modal-confirm-body > svg.osui-icon { color: var(--theme-error-color); } - .@{ant-prefix}-modal-confirm-body > .osui-modal-confirm-icon + .@{ant-prefix}-modal-confirm-title + .@{ant-prefix}-modal-confirm-content { + .@{ant-prefix}-modal-confirm-body > svg.osui-icon + .@{ant-prefix}-modal-confirm-title + .@{ant-prefix}-modal-confirm-content { margin-bottom: 40px; margin-left: 55px; } diff --git a/packages/ui/modal/src/index.tsx b/packages/ui/modal/src/index.tsx index 51fd0473..7a499601 100644 --- a/packages/ui/modal/src/index.tsx +++ b/packages/ui/modal/src/index.tsx @@ -150,11 +150,7 @@ const getConfirmConfig = ( const baseConfig = config; // 对confirm图表的样式调整处理 Object.assign(baseConfig, { - icon: ( - - {config.icon ?? confirmIconMap[type]} - - ), + icon: config.hasOwnProperty('icon') ? config.icon : confirmIconMap[type], }); return { -- Gitee