Skip to content

Commit

Permalink
✨ 초대 코드 복사 버튼 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
js43o committed Feb 19, 2024
1 parent 96b1a89 commit 6a3e4aa
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion app/frontend/src/components/Group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ export function Group({
joined,
owned = false,
}: GroupProps) {
const onClickCopy = async () => {
if (accessCode) {
await navigator.clipboard.writeText(accessCode);
}
};

return (
<div className={styles.container}>
<div className={styles.titleWrapper}>
Expand All @@ -45,7 +51,11 @@ export function Group({
<div className={styles.code}>
<span>초대 코드</span>
<div className={styles.codeString}>{accessCode}</div>
<button type="button" className={styles.copyButton}>
<button
type="button"
className={styles.copyButton}
onClick={onClickCopy}
>
<Copy width={24} height={24} fill={grayscale200} />
</button>
</div>
Expand Down

0 comments on commit 6a3e4aa

Please sign in to comment.