-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: 뱃지에 필요한 색상 팔레트 값 추가 * feat: 뱃지 컴포넌트 추가
- Loading branch information
Showing
5 changed files
with
69 additions
and
8 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import styled from '@emotion/styled'; | ||
|
||
type colorTheme = 'purple' | 'blue' | 'green' | 'red' | 'grey'; | ||
|
||
export interface BadgeProps { | ||
colorTheme: colorTheme; | ||
} | ||
|
||
const Container = styled.span<BadgeProps>` | ||
display: inline-flex; | ||
justify-content: center; | ||
align-items: center; | ||
border-radius: 24px; | ||
padding: 3px 8px; | ||
${({ theme }) => theme.typo.b1}; | ||
${({ colorTheme, theme }) => { | ||
return ` | ||
color: ${theme.palette[colorTheme].main}; | ||
background-color: ${theme.palette[colorTheme].sub}; | ||
`; | ||
}} | ||
`; | ||
|
||
export default { | ||
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,7 @@ | ||
import Styled, { BadgeProps } from './Badge.style'; | ||
|
||
const Badge = ({ colorTheme, children }: React.PropsWithChildren<BadgeProps>) => { | ||
return <Styled.Container colorTheme={colorTheme}>{children}</Styled.Container>; | ||
}; | ||
|
||
export default Badge; |
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,5 +1,6 @@ | ||
import ThemeProvider from './ThemeProvider'; | ||
import Button from './Button'; | ||
import TextButton from './TextButton'; | ||
import Badge from './Badge'; | ||
|
||
export { ThemeProvider, Button, TextButton }; | ||
export { ThemeProvider, Button, TextButton, Badge }; |
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