File tree Expand file tree Collapse file tree 1 file changed +13
-8
lines changed
src/components/auto-center Expand file tree Collapse file tree 1 file changed +13
-8
lines changed Original file line number Diff line number Diff line change 1- import React from 'react'
21import type { FC , ReactNode } from 'react'
2+ import React from 'react'
33import { NativeProps , withNativeProps } from '../../utils/native-props'
4+ import { useConfig } from '../config-provider'
45
5- const classPrefix = 'adm-auto-center'
6-
7- export type AutoCenterProps = { children ?: ReactNode } & NativeProps
6+ export type AutoCenterProps = {
7+ children ?: ReactNode
8+ prefixCls ?: string
9+ } & NativeProps
810
9- export const AutoCenter : FC < AutoCenterProps > = props =>
10- withNativeProps (
11+ export const AutoCenter : FC < AutoCenterProps > = props => {
12+ const { getPrefixCls } = useConfig ( )
13+ const prefixCls = getPrefixCls ( 'auto-center' , props . prefixCls )
14+ return withNativeProps (
1115 props ,
12- < div className = { classPrefix } >
13- < div className = { `${ classPrefix } -content` } > { props . children } </ div >
16+ < div className = { prefixCls } >
17+ < div className = { `${ prefixCls } -content` } > { props . children } </ div >
1418 </ div >
1519 )
20+ }
You can’t perform that action at this time.
0 commit comments