-
Notifications
You must be signed in to change notification settings - Fork 7
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
현재 모임 상태 태그구현 #142
Merged
Merged
현재 모임 상태 태그구현 #142
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
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
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,43 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import Tag from './Tag'; | ||
|
||
const meta = { | ||
component: Tag, | ||
title: 'Components/Tag', | ||
} satisfies Meta<typeof Tag>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Default: Story = { | ||
args: { | ||
children: '모집중', | ||
color: 'green', | ||
}, | ||
render: (args) => <Tag {...args} />, | ||
}; | ||
|
||
export const RecruitingTag: Story = { | ||
args: { | ||
children: '모집중', | ||
color: 'green', | ||
}, | ||
render: (args) => <Tag {...args} />, | ||
}; | ||
|
||
export const RecruitingCanceledTag: Story = { | ||
args: { | ||
children: '모집취소', | ||
color: 'red', | ||
}, | ||
render: (args) => <Tag {...args} />, | ||
}; | ||
|
||
export const RecruitingCompletedTag: Story = { | ||
args: { | ||
children: '모집완료', | ||
color: 'grey', | ||
}, | ||
render: (args) => <Tag {...args} />, | ||
}; |
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 { css, Theme } from '@emotion/react'; | ||
|
||
interface TagBoxProps { | ||
theme: Theme; | ||
color: 'red' | 'green' | 'grey'; | ||
} | ||
export const tagBox = (props: TagBoxProps) => { | ||
const { theme, color } = props; | ||
return css` | ||
${theme.typography.tag} | ||
display: inline-flex; | ||
gap: 1rem; | ||
align-items: center; | ||
justify-content: center; | ||
|
||
padding: 0.2rem 0.6rem; | ||
|
||
color: ${theme.colorPalette.white[100]}; | ||
|
||
background-color: ${color === 'red' | ||
? theme.colorPalette.red[400] | ||
: color === 'green' | ||
? theme.colorPalette.green[200] | ||
: theme.colorPalette.grey[400]}; | ||
border-radius: 1rem; | ||
`; | ||
}; |
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 * as S from '@_components/Tag/Tag.style'; | ||
|
||
import { HTMLProps, ReactNode } from 'react'; | ||
import { useTheme } from '@emotion/react'; | ||
|
||
interface TagProps extends HTMLProps<HTMLDivElement> { | ||
color: 'red' | 'green' | 'grey'; | ||
children: ReactNode; | ||
} | ||
|
||
export default function Tag(props: TagProps) { | ||
const theme = useTheme(); | ||
const { children, color } = props; | ||
return <div css={S.tagBox({ theme, color })}>{children}</div>; | ||
} |
Oops, something went wrong.
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.
figma 디자인 시스템 typography에는 아직 tag에 대한 것은 적용되어 있지 않은 것 같아요!
@ksk0605 테바에게 공유가 되어야 할 것 같아요~
이번 케이스와 같이 개발을 하면서 필요할 것 같은 규칙이 있다면 추가하고 공유해드리면 될까요?