diff --git a/src/components/Block/index.tsx b/src/components/Block/index.tsx index add00e6b..75c5c64c 100644 --- a/src/components/Block/index.tsx +++ b/src/components/Block/index.tsx @@ -1,3 +1,5 @@ +import './styles.css' + import cx from 'classnames' import { createElement } from 'react' @@ -8,29 +10,7 @@ export type BlockProps = { } export const Block: React.FC = ({ as = 'div', style, direction, ...props }) => { - const newProps = { className: cx(direction), style } - const children = ( - <> - - - {props.children} - - ) - - return createElement(as, newProps, children) + return createElement(as, newProps, props.children) } diff --git a/src/components/Block/styles.css b/src/components/Block/styles.css new file mode 100644 index 00000000..13b9cb72 --- /dev/null +++ b/src/components/Block/styles.css @@ -0,0 +1,14 @@ +.block { + display: flex; + flex-wrap: wrap; + align-items: baseline; + justify-content: flex-start; +} + +.block.horizontal { + flex-direction: row; +} + +.block.vertical { + flex-direction: column; +}