Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

[FRAF-544] Flex component #2185

Merged
merged 19 commits into from
Jun 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/flex/Flex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ import theme from './theme.css';

interface FlexProps {
children: ReactNode;
direction?: 'row' | 'column';
farazatarodi marked this conversation as resolved.
Show resolved Hide resolved
}

const Flex = ({ children, ...otherProps }: FlexProps) => {
const classNames = cx(theme['flex']);
const Flex = ({ children, direction = 'row', ...otherProps }: FlexProps) => {
const classNames = cx(theme['flex'], theme[`${direction}`]);

return (
<div className={classNames} {...otherProps}>
Expand Down
8 changes: 8 additions & 0 deletions src/components/flex/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,11 @@
box-sizing: border-box;
display: flex;
}

.row {
flex-direction: row;
}

.column {
flex-direction: column;
}