Skip to content

Commit

Permalink
✨ feat: 新增 Center 组件
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx committed Mar 28, 2022
1 parent 363da8a commit c1bddbe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions packages/layout-kit/src/Center.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import type { FlexboxProps } from './Flexbox';
import { Flexbox } from './Flexbox';
import type { FC } from 'react';

export type CenterProps = Omit<FlexboxProps, 'distribution' | 'direction' | 'align'>;

const Center: FC<CenterProps> = ({ children, ...res }) => {
return <Flexbox {...res}>{children}</Flexbox>;
};

export default Center;
2 changes: 2 additions & 0 deletions packages/layout-kit/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
export type { FlexboxProps, IFlexbox, CommonSpaceNumber } from './Flexbox';

export { Flexbox } from './Flexbox';
export { default as Center } from './Center';
export type { CenterProps } from './Center';

0 comments on commit c1bddbe

Please sign in to comment.