Browse Source

chore: fix code (#35949)

pull/35970/head
龙风 2 years ago
committed by GitHub
parent
commit
e5ed96d6d4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      components/image/index.tsx

11
components/image/index.tsx

@ -1,11 +1,11 @@
import * as React from 'react';
import { useContext } from 'react';
import EyeOutlined from '@ant-design/icons/EyeOutlined';
import RcImage, { ImageProps } from 'rc-image';
import defaultLocale from '../locale/en_US';
import PreviewGroup, { icons } from './PreviewGroup';
import * as React from 'react';
import { useContext } from 'react';
import { ConfigContext } from '../config-provider';
import defaultLocale from '../locale/en_US';
import { getTransitionName } from '../_util/motion';
import PreviewGroup, { icons } from './PreviewGroup';
export interface CompositionImage<P> extends React.FC<P> {
PreviewGroup: typeof PreviewGroup;
@ -16,11 +16,10 @@ const Image: CompositionImage<ImageProps> = ({
preview,
...otherProps
}) => {
const { getPrefixCls } = useContext(ConfigContext);
const { getPrefixCls, locale: contextLocale = defaultLocale } = useContext(ConfigContext);
const prefixCls = getPrefixCls('image', customizePrefixCls);
const rootPrefixCls = getPrefixCls();
const { locale: contextLocale = defaultLocale } = useContext(ConfigContext);
const imageLocale = contextLocale.Image || defaultLocale.Image;
const mergedPreview = React.useMemo(() => {

Loading…
Cancel
Save