2022-11-03 00:43:26 +08:00
|
|
|
import classNames from 'classnames';
|
2023-05-06 15:49:37 +08:00
|
|
|
import * as React from 'react';
|
2022-11-03 00:43:26 +08:00
|
|
|
import { ConfigContext } from '../config-provider';
|
|
|
|
import { RawPurePanel as PopoverRawPurePanel } from '../popover/PurePanel';
|
2023-02-13 14:30:08 +08:00
|
|
|
import type { TourStepProps } from './interface';
|
|
|
|
import TourPanel from './panelRender';
|
2022-11-03 00:43:26 +08:00
|
|
|
import useStyle from './style';
|
2023-08-08 19:48:41 +08:00
|
|
|
import { withPureRenderTheme } from '../_util/PurePanel';
|
2022-11-03 00:43:26 +08:00
|
|
|
|
|
|
|
export interface PurePanelProps extends TourStepProps {}
|
|
|
|
|
2022-11-19 13:47:33 +08:00
|
|
|
const PurePanel: React.FC<PurePanelProps> = (props) => {
|
2022-11-03 00:43:26 +08:00
|
|
|
const {
|
|
|
|
prefixCls: customizePrefixCls,
|
|
|
|
current = 0,
|
|
|
|
total = 6,
|
|
|
|
className,
|
|
|
|
style,
|
|
|
|
type,
|
|
|
|
...restProps
|
|
|
|
} = props;
|
|
|
|
|
|
|
|
const { getPrefixCls } = React.useContext(ConfigContext);
|
|
|
|
const prefixCls = getPrefixCls('tour', customizePrefixCls);
|
|
|
|
|
|
|
|
const [wrapSSR, hashId] = useStyle(prefixCls);
|
|
|
|
|
|
|
|
return wrapSSR(
|
|
|
|
<PopoverRawPurePanel
|
|
|
|
prefixCls={prefixCls}
|
|
|
|
hashId={hashId}
|
2022-11-03 11:06:34 +08:00
|
|
|
className={classNames(className, `${prefixCls}-pure`, type && `${prefixCls}-${type}`)}
|
2022-11-03 00:43:26 +08:00
|
|
|
style={style}
|
|
|
|
>
|
2023-02-13 14:30:08 +08:00
|
|
|
<TourPanel stepProps={{ ...restProps, prefixCls, total }} current={current} type={type} />
|
2022-11-03 00:43:26 +08:00
|
|
|
</PopoverRawPurePanel>,
|
|
|
|
);
|
2022-11-05 14:55:34 +08:00
|
|
|
};
|
|
|
|
|
2023-08-08 19:48:41 +08:00
|
|
|
export default withPureRenderTheme(PurePanel);
|