Box align

This commit is contained in:
tmshv committed 2022-09-06 21:03:42 +03:00
1 parent cced734dc4
commit c0694b0953
2 files changed
+9 -3

No files matched your search

+6 -2
View File
@@ -1,18 +1,22 @@
.box {
display: flex;
/* align-items: baseline; */
align-items: center;
align-items: baseline;
justify-content: flex-start;
flex-wrap: nowrap;
flex-direction: row;
}
.box.align {
align-items: center;
}
.box.wrap {
flex-wrap: wrap;
}
.box.center {
align-items: center;
justify-content: center;
}
+3 -1
View File
@@ -10,6 +10,7 @@ export type BoxProps = {
children?: React.ReactNode
style?: React.CSSProperties
wrap?: boolean
align?: boolean
vertical?: boolean
center?: boolean
}
@@ -19,11 +20,12 @@ export const Box: React.FC<BoxProps> = ({
wrap = false,
vertical = false,
center = false,
align = true,
style,
...props
}) => {
const newProps = {
className: cx(s.box, { vertical, center, wrap }),
className: cx(s.box, { vertical, align, center, wrap }),
style,
}