This repository has been archived by the owner on May 10, 2020. It is now read-only.
-
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.
feat(money): add styleing of controls
- Loading branch information
1 parent
a6c5fe2
commit 73315bf
Showing
9 changed files
with
83 additions
and
43 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -1,4 +1,17 @@ | ||
.container { | ||
padding: 0; | ||
} | ||
|
||
.inlineContainer { | ||
display: flex; | ||
align-items: center; | ||
} | ||
|
||
.text { | ||
display: block; | ||
padding-bottom: 8px; | ||
} | ||
|
||
.textInline { | ||
padding-right: 8px; | ||
} |
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 |
---|---|---|
@@ -1,16 +1,20 @@ | ||
import cx from 'classnames' | ||
import { ReactNode } from 'react' | ||
|
||
import { resolveContainerClassName } from './helpers/resolveContainerClassName' | ||
import { resolveTextClassName } from './helpers/resolveTextClassName' | ||
import * as styles from './Label.css' | ||
|
||
interface Props { | ||
text: string | ||
children: ReactNode | ||
className?: string | ||
inline?: boolean | ||
} | ||
|
||
export const Label = ({ text, children, className }: Props) => ( | ||
<label className={className}> | ||
<span className={styles.text}>{text}</span> | ||
export const Label = ({ text, children, className, inline = false }: Props) => ( | ||
<label className={cx(className, styles[resolveContainerClassName(inline)])}> | ||
<span className={styles[resolveTextClassName(inline)]}>{text}</span> | ||
{children} | ||
</label> | ||
) |
2 changes: 2 additions & 0 deletions
2
front/src/ui/atoms/label/helpers/resolveContainerClassName.ts
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,2 @@ | ||
export const resolveContainerClassName = (inline: boolean) => | ||
inline ? 'inlineContainer' : 'container' |
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,2 @@ | ||
export const resolveTextClassName = (inline: boolean) => | ||
inline ? 'textInline' : 'text' |
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