v1.0-230926 #27

Merged
FatttSnake merged 81 commits from dev into master 2023-09-26 11:06:08 +08:00
2 changed files with 21 additions and 5 deletions
Showing only changes of commit 2b1d8d7f27 - Show all commits

View File

@@ -5,3 +5,11 @@
width: 100%;
height: 100%;
}
.direction-horizontal {
flex-direction: row;
}
.direction-vertical {
flex-direction: column;
}

View File

@@ -1,13 +1,21 @@
import React from 'react'
import '@/assets/css/components/common/fit-center.scss'
const FitCenter: React.FC<
React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>
> = (props) => {
const { className, ..._props } = props
interface FitCenterProps
extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
vertical?: boolean
}
const FitCenter: React.FC<FitCenterProps> = (props) => {
const { className, vertical, ..._props } = props
return (
<>
<div className={`fit-center${className ? ' ' + className : ''}`} {..._props}></div>
<div
className={`fit-center${className ? ' ' + className : ''}${
vertical ? ' direction-vertical' : ' direction-horizontal'
}`}
{..._props}
></div>
</>
)
}