-
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.
fix: resolve conflict with package lock file
- Loading branch information
1 parent
05ac05f
commit 2775a7f
Showing
9 changed files
with
27,793 additions
and
21,420 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
7 changes: 7 additions & 0 deletions
7
src/components/atoms/ColorTexts/ColorText/ColorText.styles.module.scss
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,7 @@ | ||
@import 'src/scss/mixins'; | ||
|
||
.highlight { | ||
color: $color-base; | ||
margin-left: 5px; | ||
margin-right: 5px; | ||
} |
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,27 @@ | ||
import React from 'react' | ||
|
||
import cx from 'classnames' | ||
|
||
import css from './ColorText.styles.module.scss' | ||
|
||
export type ColorTextProps = { | ||
isHighlight: boolean | ||
isSpace: boolean | ||
text: string | ||
classNameHighlight?: string | ||
} | ||
|
||
export const ColorText = ({ isHighlight, isSpace, text, classNameHighlight }) => { | ||
return ( | ||
<span | ||
className={cx({ | ||
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment | ||
[(css.highlight, classNameHighlight)]: isHighlight | ||
})} | ||
> | ||
{isSpace && <> </>} | ||
{<> </>} | ||
{text} | ||
</span> | ||
) | ||
} |
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 * from './ColorText' |
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,15 @@ | ||
import React from 'react' | ||
|
||
import { ComponentStory, ComponentMeta } from '@storybook/react' | ||
|
||
import { ColorTexts, ColorTextsProps } from './ColorTexts' | ||
|
||
export default { | ||
title: 'atoms/ColorTexts', | ||
component: ColorTexts | ||
} as ComponentMeta<React.ComponentType<ColorTextsProps>> | ||
|
||
const Template: ComponentStory<React.ComponentType<ColorTextsProps>> = args => <ColorTexts {...args} /> | ||
|
||
export const Primary = Template.bind({}) | ||
Primary.args = {} |
3 changes: 3 additions & 0 deletions
3
src/components/atoms/ColorTexts/ColorTexts.styles.module.scss
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 @@ | ||
.color-text { | ||
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,34 @@ | ||
import React from 'react' | ||
|
||
import cx from 'classnames' | ||
|
||
import { ColorText } from './ColorText' | ||
|
||
import css from './ColorTexts.styles.module.scss' | ||
|
||
export type ColorTextsProps = { | ||
className?: string | ||
classNameHighlight?: string | ||
words: string[] | ||
step: number | ||
} | ||
|
||
export const isHighlight = (index: number, step: number) => { | ||
return (index + 1) % step === 0 | ||
} | ||
|
||
export const ColorTexts = ({ words, step, className, classNameHighlight }: ColorTextsProps) => { | ||
return ( | ||
<div className={cx(css.colorText, className)}> | ||
{words.map((word, index) => ( | ||
<ColorText | ||
classNameHighlight={classNameHighlight} | ||
key={word} | ||
isHighlight={isHighlight(index, step)} | ||
isSpace={index === 0} | ||
text={word} | ||
/> | ||
))} | ||
</div> | ||
) | ||
} |
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 * from './ColorTexts' |