@@ -17,8 +17,6 @@ import {
1717 defaultPopupBaseProps ,
1818} from '../popup/popup-base-props'
1919
20- const classPrefix = 'adm-center-popup'
21-
2220export type CenterPopupProps = PopupBaseProps &
2321 PropsWithChildren < {
2422 // These props currently are only used internally. They are not exported to users:
@@ -38,9 +36,9 @@ const defaultProps = {
3836}
3937
4038export const CenterPopup : FC < CenterPopupProps > = props => {
41- const { popup : componentConfig = { } } = useConfig ( )
39+ const { popup : componentConfig = { } , getPrefixCls } = useConfig ( )
4240 const mergedProps = mergeProps ( defaultProps , componentConfig , props )
43-
41+ const prefixCls = getPrefixCls ( 'center-popup' , mergedProps . prefixCls )
4442 const unmountedRef = useUnmountedRef ( )
4543 const style = useSpring ( {
4644 scale : mergedProps . visible ? 1 : 0.8 ,
@@ -76,7 +74,7 @@ export const CenterPopup: FC<CenterPopupProps> = props => {
7674
7775 const body = (
7876 < div
79- className = { classNames ( `${ classPrefix } -body` , mergedProps . bodyClassName ) }
77+ className = { classNames ( `${ prefixCls } -body` , mergedProps . bodyClassName ) }
8078 style = { mergedProps . bodyStyle }
8179 >
8280 { mergedProps . children }
@@ -88,7 +86,7 @@ export const CenterPopup: FC<CenterPopupProps> = props => {
8886 withNativeProps (
8987 mergedProps ,
9088 < div
91- className = { classPrefix }
89+ className = { prefixCls }
9290 style = { {
9391 display : active ? undefined : 'none' ,
9492 pointerEvents : active ? undefined : 'none' ,
@@ -107,15 +105,15 @@ export const CenterPopup: FC<CenterPopupProps> = props => {
107105 } }
108106 style = { mergedProps . maskStyle }
109107 className = { classNames (
110- `${ classPrefix } -mask` ,
108+ `${ prefixCls } -mask` ,
111109 mergedProps . maskClassName
112110 ) }
113111 disableBodyScroll = { false }
114112 stopPropagation = { mergedProps . stopPropagation }
115113 />
116114 ) }
117115 < div
118- className = { `${ classPrefix } -wrap` }
116+ className = { `${ prefixCls } -wrap` }
119117 role = { mergedProps . role }
120118 aria-label = { mergedProps [ 'aria-label' ] }
121119 >
@@ -130,10 +128,7 @@ export const CenterPopup: FC<CenterPopupProps> = props => {
130128 >
131129 { mergedProps . showCloseButton && (
132130 < a
133- className = { classNames (
134- `${ classPrefix } -close` ,
135- 'adm-plain-anchor'
136- ) }
131+ className = { classNames ( `${ prefixCls } -close` , 'adm-plain-anchor' ) }
137132 onClick = { ( ) => {
138133 mergedProps . onClose ?.( )
139134 } }
0 commit comments