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

Commit

Permalink
feat: settings are added (#123)
Browse files Browse the repository at this point in the history
* feat: settings are added

* fix: props are renamed
  • Loading branch information
dmtrack committed Oct 11, 2023
1 parent abe8162 commit 3e3f4c9
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
13 changes: 13 additions & 0 deletions client/src/shared/ui/flex/flex.module.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
.flexWrapper {
display: flex;
/* align-items: var(--align, normal);
justify-content: var(--justify, normal);
gap: var(--gap, 0);
margin: var(--margin, 0);
padding: var(--padding, 0);
flex-direction: var(--direction, row);
max-height: var(--maxHeight, none);
position: var(--position, static);
width: var(--width, 100%);
max-width: var(--maxWidth, none);
height: var(--height, auto);
flex-wrap: nowrap;
flex-shrink: unset; */
}
2 changes: 2 additions & 0 deletions client/src/shared/ui/flex/flex.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ const flexProps: FlexProps = {
width: '100%',
maxWidth: '500px',
height: 'auto',
wrap: 'nowrap',
shrink: 'unset',
children: <div>Item 1</div>,
};

Expand Down
19 changes: 19 additions & 0 deletions client/src/shared/ui/flex/flex.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ export interface FlexProps {
* [props.height] - The height property defines the height of the component. Default is 'auto'.
*/
height?: string;

/**
* [props.flexWrap] - The flex-wrap property controls whether the flex container is single-line or multi-line, and the direction of the cross-axis, which determines the direction new lines are stacked in. Default is 'nowrap'
*/
wrap?: string;

/**
* [props.flexShrink] - Sets the flex shrink factor. Negative numbers are invalid. Default is 'nowrap'
*/
shrink?: string | number;

/**
* props.children - The content to be laid out.
*/
Expand All @@ -71,6 +84,8 @@ export interface FlexProps {
* width="100%"
* maxWidth="500px"
* height="auto"
* wrap="wrap"
* shrink={1}
* >
* <div>Item 1</div>
* <div>Item 2</div>
Expand All @@ -91,6 +106,8 @@ export const Flex: React.FC<FlexProps> = props => {
width,
maxWidth,
height,
wrap,
shrink,
children,
} = props;

Expand All @@ -106,6 +123,8 @@ export const Flex: React.FC<FlexProps> = props => {
width: width,
maxWidth: maxWidth,
height: height,
flexWrap: wrap,
flexShrink: shrink,
} as React.CSSProperties;

return (
Expand Down

2 comments on commit 3e3f4c9

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for teameights ready!

✅ Preview
https://teameights-ljd8oxgyw-exortme1ster.vercel.app

Built with commit 3e3f4c9.
This pull request is being automatically deployed with vercel-action

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Deploy preview for teameights-storybook ready!

✅ Preview
https://teameights-storybook-gjgusxrc5-exortme1ster.vercel.app

Built with commit 3e3f4c9.
This pull request is being automatically deployed with vercel-action

Please sign in to comment.