-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #86 from code0-tech/flex-container
Simple Flex component
- Loading branch information
Showing
8 changed files
with
45 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {Meta} from "@storybook/react"; | ||
import React from "react"; | ||
import Flex from "./Flex"; | ||
import Text from "../Text/Text"; | ||
|
||
const meta: Meta = { | ||
title: "Flex", | ||
component: Flex | ||
} | ||
|
||
export default meta | ||
|
||
export const ExampleFlex = () => { | ||
|
||
return <Flex> | ||
<Text size={"md"} mr={1}>Example Text 1</Text> | ||
<Text size={"md"}>Example Text 2</Text> | ||
</Flex> | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.flex { | ||
display: flex; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import {Code0Component} from "../../utils/types"; | ||
import React from "react"; | ||
import {mergeCode0Props} from "../../utils/utils"; | ||
import "./Flex.style.scss"; | ||
|
||
interface FlexType extends Code0Component<HTMLDivElement> { | ||
children: React.ReactNode | React.ReactNode[] | ||
} | ||
|
||
const Flex: React.FC<FlexType> = props => { | ||
|
||
const {children, ...rest} = props | ||
|
||
return <div {...mergeCode0Props("flex", rest)}> | ||
{children} | ||
</div> | ||
|
||
} | ||
|
||
export default Flex |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters