-
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.
feat: 친구 페이지 친구 삭제, 내 초대코드 조회, 친구 추가 API 연동 (#28)
* chore: eslint @typescript-eslint/no-floating-promises off * feat: CheckIcon 추가, CheckBox component 생성 * fix: Button component ButtonHTMLAttributes props추가 * chore: 친구 페이지 헤더 우측 icon button component 분리 * feat: 친구 제거 API 연동 * style: 친구 페이지 스타일 수정 * feat: 내 초대코드 조회 API 연동 * feat: WarningIcon 추가, WarningLine component 생성 * feat: 친구 추가 API 연동 * fix: build error 수정 * refactor: CheckBox refactoring * refactor: 친구추가 성공, 초대코드 복사 성공시 토스트 메세지 상수화 * refactor: 내 초대코드 조회 query useGetMyInviteCode function으로 분리
- Loading branch information
1 parent
23ce6af
commit f588dd2
Showing
20 changed files
with
308 additions
and
47 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,9 @@ | ||
import React from 'react'; | ||
|
||
const CheckIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => ( | ||
<svg width="12" height="8" viewBox="0 0 12 8" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}> | ||
<path d="M1.3938 3.16216L5.02294 6.7913L10.6062 1.20801" stroke={props.stroke ? 'current' : '#F1F2F4'} strokeWidth="1.67" strokeLinecap="round"/> | ||
</svg> | ||
); | ||
export default CheckIcon; | ||
|
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,9 @@ | ||
import React from 'react'; | ||
|
||
const WarningIcon: React.FC<React.SVGProps<SVGSVGElement>> = (props) => ( | ||
<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg" {...props}> | ||
<path fill={props.fill ? "current" : '#FB2414'} fillRule="evenodd" clipRule="evenodd" d="M12 6C12 9.31348 9.3137 12 6 12C2.6863 12 0 9.31348 0 6C0 2.68652 2.6863 0 6 0C9.3137 0 12 2.68652 12 6ZM6 2.6168C6.27671 2.6168 6.50101 2.84121 6.50101 3.11777V6.30527C6.50101 6.58184 6.27671 6.80625 6 6.80625C5.72329 6.80625 5.49899 6.58184 5.49899 6.30527V3.11777C5.49899 2.84121 5.72329 2.6168 6 2.6168ZM6 8.88223C6.27667 8.88223 6.50098 8.65781 6.50098 8.38125C6.50098 8.10469 6.27667 7.88027 6 7.88027C5.72329 7.88027 5.49899 8.10469 5.49899 8.38125C5.49899 8.65781 5.72329 8.88223 6 8.88223Z" /> | ||
</svg> | ||
); | ||
|
||
export default WarningIcon; |
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,18 @@ | ||
import { CheckIcon } from '@/assets/icons'; | ||
import React from 'react'; | ||
|
||
const CheckBox: React.FC<{ active: boolean; onClick: () => void }> = ({ | ||
active = false, | ||
onClick, | ||
}) => { | ||
const commonStyle = | ||
'flex justify-center items-center w-[20px] h-[20px] rounded-full'; | ||
const buttonClassName = `${commonStyle} ${active ? 'bg-primary2' : 'border border-gray5'}`; | ||
return ( | ||
<button onClick={onClick} className={buttonClassName}> | ||
<CheckIcon stroke={active ? '#F1F2F4' : '#9299AA'} /> | ||
</button> | ||
); | ||
}; | ||
|
||
export default CheckBox; |
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
14 changes: 14 additions & 0 deletions
14
src/components/molecules/FriendshipHeaderSettingButton.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,14 @@ | ||
import React from 'react'; | ||
import { SettingIcon } from '@/assets/icons'; | ||
|
||
const FriendshipHeaderSettingButton: React.FC<{ onClick: () => void }> = ({ | ||
onClick, | ||
}) => { | ||
return ( | ||
<button onClick={onClick}> | ||
<SettingIcon /> | ||
</button> | ||
); | ||
}; | ||
|
||
export default FriendshipHeaderSettingButton; |
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,13 @@ | ||
import React from 'react'; | ||
import { WarningIcon } from '@/assets/icons'; | ||
|
||
const WarningLine: React.FC<{ text: string }> = ({ text }) => { | ||
return ( | ||
<div className="flex items-center"> | ||
<WarningIcon /> | ||
<p className="ml-[4px] body2-regular text-point4">{text}</p> | ||
</div> | ||
); | ||
}; | ||
|
||
export default WarningLine; |
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
Oops, something went wrong.