type: export QRPropsSvg type (#42605)

pull/42632/head^2
lijianan 2 years ago committed by GitHub
parent a17c4cb581
commit 2777f26909
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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';

@ -45,7 +45,7 @@ const QRCode: React.FC<QRCodeProps> = (props) => {
width: iconSize,
excavate: true,
};
const qrCodeProps = {
value,
size: size - (token.paddingSM + token.lineWidth) * 2,
@ -53,8 +53,8 @@ const QRCode: React.FC<QRCodeProps> = (props) => {
bgColor,
fgColor: color,
imageSettings: icon ? imageSettings : undefined,
}
};
const [locale] = useLocale('QRCode');
if (!value) {
@ -93,11 +93,7 @@ const QRCode: React.FC<QRCodeProps> = (props) => {
)}
</div>
)}
{type === 'canvas' ? (
<QRCodeCanvas {...qrCodeProps} />
) : (
<QRCodeSVG {...qrCodeProps} />
)}
{type === 'canvas' ? <QRCodeCanvas {...qrCodeProps} /> : <QRCodeSVG {...qrCodeProps} />}
</div>,
);
};

@ -21,7 +21,9 @@ export interface QRProps {
}
export type QRPropsCanvas = QRProps & React.CanvasHTMLAttributes<HTMLCanvasElement>;
export type QRPropsSvg = QRProps & React.SVGAttributes<SVGSVGElement>;
export interface QRCodeProps extends QRProps {
className?: string;
rootClassName?: string;

@ -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 {}

Loading…
Cancel
Save