-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 참여자 입금 상태, 참여자 이름 Chip 컴포넌트 구현 (#570)
* feat: Icon 컴포넌트에 check, x 추가 * feat: 참여자의 입금 상태를 관리하는 DepositCheck 컴포넌트 기능 구현 * test: DepositCheck 스토리북 생성 * refactor: isCheck props를 isDeposited로 api 이름과 동일하게 변경 * fix: icon defalut color 누락된 부분 추가 --------- Co-authored-by: jinho_kim98 <[email protected]>
- Loading branch information
1 parent
1ab3c0d
commit 5e9555e
Showing
10 changed files
with
95 additions
and
2 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 27 additions & 0 deletions
27
client/src/components/Design/components/DepositCheck/DepositCheck.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,27 @@ | ||
import type {Meta, StoryObj} from '@storybook/react'; | ||
|
||
import DepositCheck from '@HDcomponents/DepositCheck/DepositCheck'; | ||
|
||
const meta = { | ||
title: 'Components/DepositCheck', | ||
component: DepositCheck, | ||
tags: ['autodocs'], | ||
parameters: { | ||
layout: 'centered', | ||
}, | ||
argTypes: { | ||
isDeposited: { | ||
description: '', | ||
control: {type: 'boolean'}, | ||
}, | ||
}, | ||
args: { | ||
isDeposited: false, | ||
}, | ||
} satisfies Meta<typeof DepositCheck>; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Playground: Story = {}; |
21 changes: 21 additions & 0 deletions
21
client/src/components/Design/components/DepositCheck/DepositCheck.style.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,21 @@ | ||
import {css} from '@emotion/react'; | ||
|
||
import {WithTheme} from '@components/Design/type/withTheme'; | ||
|
||
import {DepositCheckStyleProps} from './DepositCheck.type'; | ||
|
||
export const DepositCheckStyle = ({theme, isDeposited}: WithTheme<DepositCheckStyleProps>) => | ||
css({ | ||
display: 'flex', | ||
alignItems: 'center', | ||
gap: '0.125rem', | ||
border: `1px solid ${isDeposited ? theme.colors.primary : theme.colors.gray}`, | ||
borderRadius: '0.5rem', | ||
padding: '0.25rem 0.375rem', | ||
height: '1.25rem', | ||
|
||
'.deposit-check-text': { | ||
color: isDeposited ? theme.colors.primary : theme.colors.gray, | ||
paddingTop: '0.0625rem', | ||
}, | ||
}); |
21 changes: 21 additions & 0 deletions
21
client/src/components/Design/components/DepositCheck/DepositCheck.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,21 @@ | ||
/** @jsxImportSource @emotion/react */ | ||
import {useTheme} from '@components/Design'; | ||
|
||
import Icon from '../Icon/Icon'; | ||
import Text from '../Text/Text'; | ||
|
||
import {DepositCheckStyle} from './DepositCheck.style'; | ||
import {DepositCheckProps} from './DepositCheck.type'; | ||
|
||
const DepositCheck: React.FC<DepositCheckProps> = ({isDeposited = false}: DepositCheckProps) => { | ||
const {theme} = useTheme(); | ||
return ( | ||
<div css={DepositCheckStyle({theme, isDeposited})}> | ||
<Text size="tiny" className="deposit-check-text"> | ||
입금 | ||
</Text> | ||
<Icon iconType={isDeposited ? 'check' : 'x'}></Icon> | ||
</div> | ||
); | ||
}; | ||
export default DepositCheck; |
11 changes: 11 additions & 0 deletions
11
client/src/components/Design/components/DepositCheck/DepositCheck.type.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,11 @@ | ||
export interface DepositCheckStyleProps { | ||
isDeposited: boolean; | ||
} | ||
|
||
export interface DepositCheckCustomProps { | ||
isDeposited: boolean; | ||
} | ||
|
||
export type DepositCheckOptionProps = DepositCheckStyleProps & DepositCheckCustomProps; | ||
|
||
export type DepositCheckProps = React.ComponentProps<'div'> & DepositCheckOptionProps; |
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 |
---|---|---|
|
@@ -9,6 +9,8 @@ export type IconType = | |
| 'error' | ||
| 'confirm' | ||
| 'trash' | ||
| 'check' | ||
| 'x' | ||
| 'toss' | ||
| 'meatballs'; | ||
|
||
|