Skip to content

Commit 58fa232

Browse files
authored
Merge pull request #47 from prgrms-web-devcourse-final-project/feat/share#8
[style] 공유하기 컴포넌트#8
2 parents 9ebf731 + 865819e commit 58fa232

File tree

7 files changed

+45
-14
lines changed

7 files changed

+45
-14
lines changed

src/app/design-system/page.tsx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import ConfirmPop from '@/shared/components/modalPop/ConfirmPop';
1010
import ChatInput from '@/shared/components/InputBox/ChatInput';
1111
import SelectBox from '@/shared/components/InputBox/SelectBox';
1212
import LikeBtn from '@/shared/components/like/LikeBtn';
13+
import Share from '@/shared/components/share/Share';
1314

1415
function Page() {
1516
const [isModalOpen, setModalOpen] = useState(false);
@@ -142,6 +143,11 @@ function Page() {
142143
<h3 className="text-lg font-medium border-b pb-1">like</h3>
143144
<LikeBtn />
144145
</div>
146+
<div className="space-y-2">
147+
<h3 className="text-lg font-medium border-b pb-1">Share</h3>
148+
<Share />
149+
<Share variants="community" />
150+
</div>
145151
</div>
146152
</div>
147153
);
Lines changed: 2 additions & 2 deletions
Loading

src/shared/assets/icons/menu_32.svg

Lines changed: 1 addition & 1 deletion
Loading

src/shared/assets/icons/share_24.svg

Lines changed: 0 additions & 10 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Loading

src/shared/components/like/LikeBtn.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function LikeBtn() {
1616
onClick={handleClick}
1717
>
1818
<LikeIcon
19-
fill={`${isClick ? '#81689d' : null}`}
19+
fill={`${isClick ? '#81689d' : 'transparent'}`}
2020
className="duration-100 hover:[&_*]:fill-tertiary/50 [&_*]:duration-200"
2121
aria-hidden
2222
/>
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import ShareBtn from '@/shared/assets/icons/share_28.svg';
2+
3+
interface Props {
4+
onClick?: () => void;
5+
variants?: 'default' | 'community';
6+
title?: string;
7+
content?: string;
8+
}
9+
10+
function Share({ onClick, variants = 'default', title, content }: Props) {
11+
// title과 content는 추후 API가 들어오면 사용예정 API가 들어오면 타입 옵셔널 체크 해제헤 주세요
12+
13+
return (
14+
<button
15+
type="button"
16+
className={
17+
variants == 'community'
18+
? 'w-13.75 h-13.75 flex-center border-1 border-white rounded-full'
19+
: ''
20+
}
21+
aria-label="공유하기"
22+
onClick={onClick}
23+
>
24+
<ShareBtn
25+
fill="transparent"
26+
className="duration-100 object-contain hover:[&_*]:fill-white/50 [&_*]:duration-200"
27+
aria-hidden
28+
/>
29+
</button>
30+
);
31+
}
32+
export default Share;

0 commit comments

Comments
 (0)