mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-03 00:09:39 +08:00
96fa23ea7c
* feat: Tooltip, Popover, Dropdown, Tour support css var * chore: update snapshot * chore: code clean * chore: code clean * chore: update snapshot * chore: update snapshot * chore: update snapshot * chore: add test
43 lines
1.3 KiB
TypeScript
43 lines
1.3 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 useCSSVar from './style/cssVar';
|
|
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 [, hashId] = useStyle(prefixCls);
|
|
const wrapCSSVar = useCSSVar(prefixCls);
|
|
|
|
return wrapCSSVar(
|
|
<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 withPureRenderTheme(PurePanel);
|