-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Eb/자주쓰이는 atom component 구현 및 molecule component 일부 구현 #98
Merged
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
fb01594
[feat] date picker atom 컴포넌트 view 구현
Eunbin-Kim dd01997
[feat] filter button atom 컴포넌트 view 구현
Eunbin-Kim 1092d39
[feat] input label atom 컴포넌트 view 구현
Eunbin-Kim f6aa1d4
[feat] textarea atom 컴포넌트 view 구현
Eunbin-Kim 6e858cd
[feat] label tag atom 컴포넌트 view 구현
Eunbin-Kim 492e8f1
[feat] filter item의 title 부분 atom component view 구현
Eunbin-Kim e83c004
[feat] filter item의 description 부분 atom component view 구현
Eunbin-Kim 91db2a2
[feat] filter item의 color swatch 부분 atom component view 구현
Eunbin-Kim 381f67a
[feat] filter item 중 label molecule component view 구현
Eunbin-Kim 5a32ba5
[feat] input common style 추가
Eunbin-Kim 9014199
[refactor] 파일경로 alias 수정
Eunbin-Kim File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
client/src/components/atoms/DatePicker/DatePicker.stories.tsx
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, { ChangeEvent, useState } from 'react'; | ||
import { text } from '@storybook/addon-knobs'; | ||
import DatePicker from './DatePicker'; | ||
|
||
export default { | ||
title: 'Components/DatePicker', | ||
component: DatePicker, | ||
}; | ||
|
||
export const Default = () => { | ||
const value = text('date', '2020-11-04'); | ||
const onChange = (e: ChangeEvent<HTMLInputElement>) => {}; | ||
|
||
return <DatePicker value={value} onChange={onChange} />; | ||
}; |
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,28 @@ | ||
import React, { FunctionComponent, ChangeEvent } from 'react'; | ||
import styled from '@themes/styled'; | ||
|
||
const StyledDatePicker = styled.input` | ||
background-color: ${({ theme }) => theme.palette.BG_COLOR01}; | ||
font-size: 0.8rem; | ||
color: ${({ theme }) => theme.palette.PRIMARY}; | ||
border-radius: 0.5rem; | ||
padding: 5px 12px; | ||
width: 440px; | ||
border: 1px solid ${({ theme }) => theme.palette.BG_COLOR02}; | ||
&:focus { | ||
background-color: ${({ theme }) => theme.palette.LIGHT}; | ||
border-color: ${({ theme }) => theme.palette.LINK_BLUE}; | ||
box-shadow: 0 0 0 3px rgba(3, 102, 214, 0.3); | ||
} | ||
`; | ||
|
||
interface Props { | ||
value: string; | ||
onChange: (e: ChangeEvent<HTMLInputElement>) => void; | ||
} | ||
|
||
const DatePicker: FunctionComponent<Props> = ({ value, onChange }) => ( | ||
<StyledDatePicker type="date" value={value} onChange={onChange} /> | ||
); | ||
|
||
export default DatePicker; |
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 './DatePicker'; |
15 changes: 15 additions & 0 deletions
15
client/src/components/atoms/FilterButton/FilterButton.stories.tsx
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 { text } from '@storybook/addon-knobs'; | ||
import FilterButton from './FilterButton'; | ||
|
||
export default { | ||
title: 'Components/FilterButton', | ||
component: FilterButton, | ||
}; | ||
|
||
export const Default = () => { | ||
const onClick = () => {}; | ||
const value = text('button text', 'Author'); | ||
|
||
return <FilterButton onClick={onClick} text={value} />; | ||
}; |
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,23 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import styled from '@themes/styled'; | ||
|
||
const StyledFilterButton = styled.button` | ||
all: unset; | ||
color: ${({ theme }) => theme.palette.SECONDARY}; | ||
font-size: 0.8rem; | ||
&:hover { | ||
color: ${({ theme }) => theme.palette.PRIMARY}; | ||
cursor: pointer; | ||
} | ||
`; | ||
|
||
interface Props { | ||
onClick: () => void; | ||
text: string; | ||
} | ||
|
||
const FilterButton: FunctionComponent<Props> = ({ onClick, text }) => ( | ||
<StyledFilterButton onClick={onClick}>{text} ▾</StyledFilterButton> | ||
); | ||
|
||
export default FilterButton; |
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 './FilterButton'; |
13 changes: 13 additions & 0 deletions
13
client/src/components/atoms/InputLabel/InputLabel.stories.tsx
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,13 @@ | ||
import React from 'react'; | ||
import { text } from '@storybook/addon-knobs'; | ||
import InputLabel from './InputLabel'; | ||
|
||
export default { | ||
title: 'Components/InputLabel', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. storybook 에서 한번 더 구분하는거 좋습니다 👍 |
||
component: InputLabel, | ||
}; | ||
|
||
export const Default = () => { | ||
const value = text('label', 'Due date (optional)'); | ||
return <InputLabel text={value} />; | ||
}; |
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 React, { FunctionComponent } from 'react'; | ||
import styled from '@themes/styled'; | ||
|
||
const StyledInputLabel = styled.span` | ||
font-size: 1rem; | ||
font-weight: 600; | ||
`; | ||
|
||
interface Props { | ||
text: string; | ||
} | ||
|
||
const InputLabel: FunctionComponent<Props> = ({ text }) => ( | ||
<StyledInputLabel>{text}</StyledInputLabel> | ||
); | ||
|
||
export default InputLabel; |
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 './InputLabel'; |
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 { text } from '@storybook/addon-knobs'; | ||
import LabelTag from './LabelTag'; | ||
|
||
export default { | ||
title: 'Components/LabelTag', | ||
component: LabelTag, | ||
}; | ||
|
||
export const Default = () => { | ||
const value = text('tag text', 'Bug'); | ||
const bgColor = text('background color', '#a30a0a'); | ||
|
||
return <LabelTag text={value} bgColor={bgColor} />; | ||
}; |
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,23 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import styled from '@themes/styled'; | ||
|
||
const StyledLabelTag = styled.span` | ||
display: inline-block; | ||
padding: 0 7px; | ||
font-size: 12px; | ||
font-weight: 500; | ||
border-radius: 1rem; | ||
color: #000; | ||
line-height: 18px; | ||
`; | ||
|
||
interface Props { | ||
text: string; | ||
bgColor: string; | ||
} | ||
|
||
const LabelTag: FunctionComponent<Props> = ({ text, bgColor }) => ( | ||
<StyledLabelTag style={{ backgroundColor: bgColor }}>{text}</StyledLabelTag> | ||
); | ||
|
||
export default LabelTag; |
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 './LabelTag'; |
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,13 @@ | ||
import React from 'react'; | ||
import { text } from '@storybook/addon-knobs'; | ||
import Textarea from './TextArea'; | ||
|
||
export default { | ||
title: 'Components/Textarea', | ||
component: Textarea, | ||
}; | ||
|
||
export const Default = () => { | ||
const placeholder = text('placeholder', 'Leave a comment'); | ||
return <Textarea placeHolder={placeholder} />; | ||
}; |
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,16 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import styled from '@themes/styled'; | ||
|
||
const StyledTextarea = styled.textarea` | ||
${({ theme }) => theme.commonStyle.input} | ||
`; | ||
|
||
interface Props { | ||
placeHolder?: string; | ||
} | ||
|
||
const Textarea: FunctionComponent<Props> = ({ placeHolder }) => ( | ||
<StyledTextarea placeholder={placeHolder} /> | ||
); | ||
|
||
export default Textarea; |
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 './TextArea'; |
19 changes: 19 additions & 0 deletions
19
client/src/components/atoms/filterItem/ColorSwatch/ColorSwatch.tsx
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,19 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import styled from '@themes/styled'; | ||
|
||
interface Props { | ||
bgColor: string; | ||
} | ||
|
||
const StyledColorSwatch = styled.div<Props>` | ||
border-radius: 2rem; | ||
width: 1rem; | ||
height: 1rem; | ||
background-color: ${({ bgColor }) => bgColor}; | ||
`; | ||
|
||
const ColorSwatch: FunctionComponent<Props> = ({ bgColor }) => ( | ||
<StyledColorSwatch bgColor={bgColor} /> | ||
); | ||
|
||
export default ColorSwatch; |
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 './ColorSwatch'; |
19 changes: 19 additions & 0 deletions
19
client/src/components/atoms/filterItem/Description/Description.tsx
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,19 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import styled from '@themes/styled'; | ||
|
||
const StyledDescription = styled.div` | ||
font-size: 0.4rem; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
color: ${({ theme }) => theme.palette.SECONDARY}; | ||
`; | ||
|
||
interface Props { | ||
text: string; | ||
} | ||
|
||
const Description: FunctionComponent<Props> = ({ text }) => ( | ||
<StyledDescription>{text}</StyledDescription> | ||
); | ||
|
||
export default Description; |
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 './Description'; |
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,16 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import styled from '@themes/styled'; | ||
|
||
const StyledTitle = styled.strong` | ||
font-size: 0.5rem; | ||
`; | ||
|
||
interface Props { | ||
text: string; | ||
} | ||
|
||
const Title: FunctionComponent<Props> = ({ text }) => ( | ||
<StyledTitle>{text}</StyledTitle> | ||
); | ||
|
||
export default Title; |
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 './Title'; |
22 changes: 22 additions & 0 deletions
22
client/src/components/molecules/filterItem/FilterItemLabel/FilterItemLabel.stories.tsx
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,22 @@ | ||
import React from 'react'; | ||
import { text } from '@storybook/addon-knobs'; | ||
import FilterItemLabel from './FilterItemLabel'; | ||
|
||
export default { | ||
title: 'Molecules/FilterItemLabel', | ||
component: FilterItemLabel, | ||
}; | ||
|
||
export const Default = () => { | ||
const swatchColor = text('swatch color', '#eee'); | ||
const title = text('title', 'bug'); | ||
const description = text('description', "Something isn't working"); | ||
|
||
return ( | ||
<FilterItemLabel | ||
swatchColor={swatchColor} | ||
title={title} | ||
description={description} | ||
/> | ||
); | ||
}; |
26 changes: 26 additions & 0 deletions
26
client/src/components/molecules/filterItem/FilterItemLabel/FilterItemLabel.tsx
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,26 @@ | ||
import React, { FunctionComponent } from 'react'; | ||
import ColorSwatch from '@components/atoms/filterItem/ColorSwatch'; | ||
import Description from '@components/atoms/filterItem/Description'; | ||
import Title from '@components/atoms/filterItem/Title'; | ||
|
||
interface Props { | ||
swatchColor: string; | ||
title: string; | ||
description?: string; | ||
} | ||
|
||
const FilterItemLabel: FunctionComponent<Props> = ({ | ||
swatchColor, | ||
title, | ||
description, | ||
}) => ( | ||
<> | ||
<ColorSwatch bgColor={swatchColor} /> | ||
<div> | ||
<Title text={title} /> | ||
<Description text={description} /> | ||
</div> | ||
</> | ||
); | ||
|
||
export default FilterItemLabel; |
1 change: 1 addition & 0 deletions
1
client/src/components/molecules/filterItem/FilterItemLabel/index.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 @@ | ||
export { default } from './FilterItemLabel'; |
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
단위를 통일해 주셔서 좋습니다!