mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-15 08:59:15 +08:00
c885a42e3b
* fix: Indicators support number 0 * fix * fix * fix * fix * fix * refactoring: rewrite panelRender function to funtion component * restart ci * fix * fix * fix * Update index.test.tsx * Update index.en-US.md * Update components/tour/panelRender.tsx Co-authored-by: MadCcc <1075746765@qq.com> * raname --------- Co-authored-by: MadCcc <1075746765@qq.com>
40 lines
1.1 KiB
TypeScript
40 lines
1.1 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';
|
|
|
|
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 [wrapSSR, hashId] = useStyle(prefixCls);
|
|
|
|
return wrapSSR(
|
|
<PopoverRawPurePanel
|
|
prefixCls={prefixCls}
|
|
hashId={hashId}
|
|
className={classNames(className, `${prefixCls}-pure`, type && `${prefixCls}-${type}`)}
|
|
style={style}
|
|
>
|
|
<TourPanel stepProps={{ ...restProps, prefixCls, total }} current={current} type={type} />
|
|
</PopoverRawPurePanel>,
|
|
);
|
|
};
|
|
|
|
export default PurePanel;
|