From 2777f269092983580cc052d1ef7a87506aba668b Mon Sep 17 00:00:00 2001 From: lijianan <574980606@qq.com> Date: Thu, 25 May 2023 21:03:38 +0800 Subject: [PATCH] type: export QRPropsSvg type (#42605) --- components/index.ts | 2 +- components/qrcode/index.tsx | 12 ++++-------- components/qrcode/interface.ts | 2 ++ components/qrcode/style/index.ts | 4 ++-- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/components/index.ts b/components/index.ts index 8c661f812e..e11d45bca9 100644 --- a/components/index.ts +++ b/components/index.ts @@ -94,7 +94,7 @@ export type { PopoverProps } from './popover'; export { default as Progress } from './progress'; export type { ProgressProps } from './progress'; export { default as QRCode } from './qrcode'; -export type { QRCodeProps, QRPropsCanvas } from './qrcode/interface'; +export type { QRCodeProps, QRPropsCanvas, QRPropsSvg } from './qrcode/interface'; export { default as Radio } from './radio'; export type { RadioChangeEvent, RadioGroupProps, RadioProps } from './radio'; export { default as Rate } from './rate'; diff --git a/components/qrcode/index.tsx b/components/qrcode/index.tsx index abb6e7d4cf..a96ebb4b75 100644 --- a/components/qrcode/index.tsx +++ b/components/qrcode/index.tsx @@ -45,7 +45,7 @@ const QRCode: React.FC = (props) => { width: iconSize, excavate: true, }; - + const qrCodeProps = { value, size: size - (token.paddingSM + token.lineWidth) * 2, @@ -53,8 +53,8 @@ const QRCode: React.FC = (props) => { bgColor, fgColor: color, imageSettings: icon ? imageSettings : undefined, - } - + }; + const [locale] = useLocale('QRCode'); if (!value) { @@ -93,11 +93,7 @@ const QRCode: React.FC = (props) => { )} )} - {type === 'canvas' ? ( - - ) : ( - - )} + {type === 'canvas' ? : } , ); }; diff --git a/components/qrcode/interface.ts b/components/qrcode/interface.ts index 5bac8c54b7..59c4324a21 100644 --- a/components/qrcode/interface.ts +++ b/components/qrcode/interface.ts @@ -21,7 +21,9 @@ export interface QRProps { } export type QRPropsCanvas = QRProps & React.CanvasHTMLAttributes; + export type QRPropsSvg = QRProps & React.SVGAttributes; + export interface QRCodeProps extends QRProps { className?: string; rootClassName?: string; diff --git a/components/qrcode/style/index.ts b/components/qrcode/style/index.ts index bde2a24142..f40e1f30a9 100644 --- a/components/qrcode/style/index.ts +++ b/components/qrcode/style/index.ts @@ -1,6 +1,6 @@ -import type { FullToken, GenerateStyle } from '../../theme/internal'; -import { mergeToken, genComponentStyleHook } from '../../theme/internal'; import { resetComponent } from '../../style'; +import type { FullToken, GenerateStyle } from '../../theme/internal'; +import { genComponentStyleHook, mergeToken } from '../../theme/internal'; export interface ComponentToken {}