Skip to content

Commit ce541eb

Browse files
committed
[stype] 공유하기 컴포넌트
1 parent 0b3e3f5 commit ce541eb

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
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: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import ShareBtn from '@/shared/assets/icons/share_24.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 className="duration-100 hover:[&_*]:fill-white/50 [&_*]:duration-200" aria-hidden />
25+
</button>
26+
);
27+
}
28+
export default Share;

0 commit comments

Comments
 (0)