Browse Source
type: add RawPurePanelProps interface (#43453)
* type(popover): add RawPurePanelProps interface
* fix: optimize
pull/43456/head
thinkasany
1 year ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
11 additions and
5 deletions
-
components/popover/PurePanel.tsx
|
|
@ -25,7 +25,11 @@ export interface PurePanelProps extends Omit<PopoverProps, 'children'> { |
|
|
|
children?: React.ReactNode; |
|
|
|
} |
|
|
|
|
|
|
|
export function RawPurePanel(props: any) { |
|
|
|
interface RawPurePanelProps extends PopoverProps { |
|
|
|
hashId: string; |
|
|
|
} |
|
|
|
|
|
|
|
export const RawPurePanel: React.FC<RawPurePanelProps> = (props) => { |
|
|
|
const { |
|
|
|
hashId, |
|
|
|
prefixCls, |
|
|
@ -50,13 +54,13 @@ export function RawPurePanel(props: any) { |
|
|
|
> |
|
|
|
<div className={`${prefixCls}-arrow`} /> |
|
|
|
<Popup {...props} className={hashId} prefixCls={prefixCls}> |
|
|
|
{children || getOverlay(prefixCls, title, content)} |
|
|
|
{children || getOverlay(prefixCls!, title, content)} |
|
|
|
</Popup> |
|
|
|
</div> |
|
|
|
); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
export default function PurePanel(props: any) { |
|
|
|
const PurePanel: React.FC<PurePanelProps> = (props) => { |
|
|
|
const { prefixCls: customizePrefixCls, ...restProps } = props; |
|
|
|
const { getPrefixCls } = React.useContext(ConfigContext); |
|
|
|
|
|
|
@ -64,4 +68,6 @@ export default function PurePanel(props: any) { |
|
|
|
const [wrapSSR, hashId] = useStyle(prefixCls); |
|
|
|
|
|
|
|
return wrapSSR(<RawPurePanel {...restProps} prefixCls={prefixCls} hashId={hashId} />); |
|
|
|
} |
|
|
|
}; |
|
|
|
|
|
|
|
export default PurePanel; |
|
|
|