Browse Source

refactor: adjust refresh Button logic (#41323)

pull/41203/head
lijianan 2 years ago
committed by GitHub
parent
commit
20816a2184
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      components/qrcode/index.tsx

4
components/qrcode/index.tsx

@ -2,13 +2,13 @@ import { ReloadOutlined } from '@ant-design/icons';
import classNames from 'classnames';
import { QRCodeCanvas } from 'qrcode.react';
import React, { useContext, useMemo } from 'react';
import warning from '../_util/warning';
import Button from '../button';
import type { ConfigConsumerProps } from '../config-provider';
import { ConfigContext } from '../config-provider';
import useLocale from '../locale/useLocale';
import Spin from '../spin';
import theme from '../theme';
import warning from '../_util/warning';
import type { QRCodeProps, QRPropsCanvas } from './interface';
import useStyle from './style/index';
@ -82,7 +82,7 @@ const QRCode: React.FC<QRCodeProps> = (props) => {
{status === 'expired' && (
<>
<p className={`${prefixCls}-expired`}>{locale?.expired}</p>
{typeof onRefresh === 'function' && (
{onRefresh && (
<Button type="link" icon={<ReloadOutlined />} onClick={onRefresh}>
{locale?.refresh}
</Button>

Loading…
Cancel
Save