From 84c234ac8d5a39711efc68aa729d61c91bb33ceb Mon Sep 17 00:00:00 2001 From: Danial Soheili <33312687+ds1371dani@users.noreply.github.com> Date: Sat, 24 Jun 2023 13:49:44 +0330 Subject: [PATCH] style: move token color to default props (#43164) --- components/qrcode/index.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/qrcode/index.tsx b/components/qrcode/index.tsx index 7355a95f4b..f25b46a0f2 100644 --- a/components/qrcode/index.tsx +++ b/components/qrcode/index.tsx @@ -15,13 +15,14 @@ import useStyle from './style/index'; const { useToken } = theme; const QRCode: React.FC = (props) => { + const { token } = useToken(); const { value, type = 'canvas', icon = '', size = 160, iconSize = 40, - color, + color = token.colorText, errorLevel = 'M', status = 'active', bordered = true, @@ -35,7 +36,6 @@ const QRCode: React.FC = (props) => { const { getPrefixCls } = useContext(ConfigContext); const prefixCls = getPrefixCls('qrcode', customizePrefixCls); const [wrapSSR, hashId] = useStyle(prefixCls); - const { token } = useToken(); const imageSettings: QRProps['imageSettings'] = { src: icon, @@ -51,7 +51,7 @@ const QRCode: React.FC = (props) => { size: size - (token.paddingSM + token.lineWidth) * 2, level: errorLevel, bgColor, - fgColor: color || token.colorText, + fgColor: color, imageSettings: icon ? imageSettings : undefined, };