mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-12 23:35:38 +08:00
dcc0ffa016
* style: prettier code * update * Update index.less
33 lines
1.2 KiB
TypeScript
33 lines
1.2 KiB
TypeScript
import * as React from 'react';
|
|
import RcImage from 'rc-image';
|
|
import RotateLeftOutlined from '@ant-design/icons/RotateLeftOutlined';
|
|
import RotateRightOutlined from '@ant-design/icons/RotateRightOutlined';
|
|
import ZoomInOutlined from '@ant-design/icons/ZoomInOutlined';
|
|
import ZoomOutOutlined from '@ant-design/icons/ZoomOutOutlined';
|
|
import CloseOutlined from '@ant-design/icons/CloseOutlined';
|
|
import LeftOutlined from '@ant-design/icons/LeftOutlined';
|
|
import RightOutlined from '@ant-design/icons/RightOutlined';
|
|
import { GroupConsumerProps } from 'rc-image/lib/PreviewGroup';
|
|
import { ConfigContext } from '../config-provider';
|
|
|
|
export const icons = {
|
|
rotateLeft: <RotateLeftOutlined />,
|
|
rotateRight: <RotateRightOutlined />,
|
|
zoomIn: <ZoomInOutlined />,
|
|
zoomOut: <ZoomOutOutlined />,
|
|
close: <CloseOutlined />,
|
|
left: <LeftOutlined />,
|
|
right: <RightOutlined />,
|
|
};
|
|
|
|
const InternalPreviewGroup: React.FC<GroupConsumerProps> = ({
|
|
previewPrefixCls: customizePrefixCls,
|
|
...props
|
|
}) => {
|
|
const { getPrefixCls } = React.useContext(ConfigContext);
|
|
const prefixCls = getPrefixCls('image-preview', customizePrefixCls);
|
|
return <RcImage.PreviewGroup previewPrefixCls={prefixCls} icons={icons} {...props} />;
|
|
};
|
|
|
|
export default InternalPreviewGroup;
|