ui components updates

This commit is contained in:
tmshv committed 2022-09-06 20:37:24 +03:00
1 parent 160c66a0af
commit 1d1e41adea
13 files changed
+90 -82

No files matched your search

+6 -3
View File
@@ -1,21 +1,24 @@
import s from "./styles.module.css"
import cx from "classnames"
import classnames from "classnames/bind"
import { createElement } from "react"
const cx = classnames.bind(s)
export type BlockProps = {
as?: keyof HTMLElementTagNameMap
style?: React.CSSProperties
direction: "horizontal" | "vertical"
children?: React.ReactNode
align?: boolean
}
export const Block: React.FC<BlockProps> = ({ as = "div", style, direction, ...props }) => {
export const Block: React.FC<BlockProps> = ({ as = "div", align = false, style, direction, ...props }) => {
const directionClass = direction === "horizontal"
? s.horizontal
: s.vertical
const newProps = {
className: cx(s.block, directionClass),
className: cx(s.block, directionClass, { align }),
style,
}
+4
View File
@@ -5,6 +5,10 @@
justify-content: flex-start;
}
.block.align {
align-items: center;
}
.horizontal {
flex-direction: row;
}