From c0694b0953ac81a00b4ab3e078f675984896b226 Mon Sep 17 00:00:00 2001 From: Roman Timashev Date: Tue, 6 Sep 2022 21:03:42 +0300 Subject: [PATCH] Box align --- src/ui/Box/box.module.css | 8 ++++++-- src/ui/Box/index.tsx | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/ui/Box/box.module.css b/src/ui/Box/box.module.css index 60ac1382..3eb304c2 100644 --- a/src/ui/Box/box.module.css +++ b/src/ui/Box/box.module.css @@ -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; } diff --git a/src/ui/Box/index.tsx b/src/ui/Box/index.tsx index dc3130d7..2243fdb5 100644 --- a/src/ui/Box/index.tsx +++ b/src/ui/Box/index.tsx @@ -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 = ({ 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, }