mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-12-05 13:37:52 +08:00
2e0942ab26
* refactor: cssVarCls * refactor: update * chore: update * fix: cascader & tree-select * fix: ribbon
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import classNames from 'classnames';
|
|
import * as React from 'react';
|
|
import { ConfigContext } from '../config-provider';
|
|
import { RawPurePanel as PopoverRawPurePanel } from '../popover/PurePanel';
|
|
import type { TourStepProps } from './interface';
|
|
import TourPanel from './panelRender';
|
|
import useStyle from './style';
|
|
import { withPureRenderTheme } from '../_util/PurePanel';
|
|
|
|
export interface PurePanelProps extends TourStepProps {}
|
|
|
|
const PurePanel: React.FC<PurePanelProps> = (props) => {
|
|
const {
|
|
prefixCls: customizePrefixCls,
|
|
current = 0,
|
|
total = 6,
|
|
className,
|
|
style,
|
|
type,
|
|
...restProps
|
|
} = props;
|
|
|
|
const { getPrefixCls } = React.useContext(ConfigContext);
|
|
const prefixCls = getPrefixCls('tour', customizePrefixCls);
|
|
|
|
const [wrapCSSVar, hashId, cssVarCls] = useStyle(prefixCls);
|
|
|
|
return wrapCSSVar(
|
|
<PopoverRawPurePanel
|
|
prefixCls={prefixCls}
|
|
hashId={hashId}
|
|
className={classNames(
|
|
className,
|
|
`${prefixCls}-pure`,
|
|
type && `${prefixCls}-${type}`,
|
|
cssVarCls,
|
|
)}
|
|
style={style}
|
|
>
|
|
<TourPanel stepProps={{ ...restProps, prefixCls, total }} current={current} type={type} />
|
|
</PopoverRawPurePanel>,
|
|
);
|
|
};
|
|
|
|
export default withPureRenderTheme(PurePanel);
|