✨ feat(组件): 新增 iconCard 组件
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
.layoutBlock {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
background-color: #fff;
|
||||
padding: 32px;
|
||||
margin-bottom: 20px;
|
||||
&--row {
|
||||
flex-flow: row nowrap;
|
||||
}
|
||||
&--col {
|
||||
flex-flow: column nowrap;
|
||||
}
|
||||
&--circle {
|
||||
border-radius: 20px;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import { View } from '@tarojs/components'
|
||||
import { FC, ReactNode } from 'react'
|
||||
import classnames from 'classname'
|
||||
import styles from './index.module.scss'
|
||||
|
||||
type FlexDirection = 'row' | 'col'
|
||||
|
||||
interface PropsType {
|
||||
flexDirection?: FlexDirection
|
||||
|
||||
circle?: boolean
|
||||
children?: ReactNode
|
||||
customStyle?: React.CSSProperties
|
||||
}
|
||||
|
||||
const LayoutBlock: FC<PropsType> = (props) => {
|
||||
const { flexDirection = 'col', circle = false, children } = props
|
||||
|
||||
const getClassName = () => {
|
||||
const classObject = {
|
||||
[styles['layoutBlock--circle']]: circle,
|
||||
[styles[`layoutBlock--${flexDirection}`]]: flexDirection,
|
||||
}
|
||||
return classObject
|
||||
}
|
||||
|
||||
return <View className={classnames(styles.layoutBlock, getClassName())}>{children}</View>
|
||||
}
|
||||
export default LayoutBlock
|
||||
Reference in New Issue
Block a user