This repository has been archived by the owner on Mar 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(PC-11178) Refacto using a shared tag component
- Loading branch information
Showing
9 changed files
with
62 additions
and
32 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
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,10 @@ | ||
.tag { | ||
@include highlight(); | ||
|
||
border: solid rem(1px) $tertiary; | ||
border-radius: rem(4px); | ||
color: $tertiary; | ||
display: inline-block; | ||
line-height: rem(16px); | ||
padding: 0 rem(4px); | ||
} |
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 React from 'react' | ||
|
||
import Tag from './Tag' | ||
|
||
export default { | ||
title: 'ui-kit/Tag', | ||
component: Tag, | ||
} | ||
|
||
const Template = args => ( | ||
<Tag {...args}> | ||
{args.children} | ||
</Tag> | ||
) | ||
|
||
export const Default = Template.bind({}) | ||
|
||
Default.args = { | ||
children: 'Offre collective', | ||
} |
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,17 @@ | ||
import cx from 'classnames' | ||
import React from 'react' | ||
|
||
import styles from './Tag.module.scss' | ||
|
||
interface ITagProps { | ||
children: JSX.Element; | ||
className?: string; | ||
} | ||
|
||
const Tag = ({ children, className }: ITagProps): JSX.Element => ( | ||
<span className={cx(styles.tag, className)}> | ||
{children} | ||
</span> | ||
) | ||
|
||
export default Tag |
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 @@ | ||
export { default } from './Tag' |
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,3 +1,4 @@ | ||
export { default as CheckboxField } from './CheckboxField' | ||
export { default as Divider } from './Divider' | ||
export { default as SubmitButton } from './SubmitButton' | ||
export { default as SubmitButton } from './SubmitButton' | ||
export { default as Tag } from './Tag' |