Skip to content

Commit 7adae75

Browse files
authored
feat(fe): add session sharing (#202)
* feat: update branding in modals to enhance visual appeal * feat: add session link sharing
1 parent 1dede0a commit 7adae75

File tree

4 files changed

+41
-6
lines changed

4 files changed

+41
-6
lines changed

apps/client/src/components/modal/CreateSessionModal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ function CreateSessionModal() {
4646
return (
4747
<Modal>
4848
<div className='flex h-fit flex-col items-center justify-start gap-4 self-stretch rounded p-4'>
49-
<div className='text-2xl font-bold text-indigo-600'>Ask-It</div>
49+
<div className='font-header text-2xl'>
50+
<span className='text-indigo-600'>A</span>
51+
<span className='text-black'>sk-It</span>
52+
</div>
5053
<InputField
5154
label='세션 이름'
5255
type='text'

apps/client/src/components/modal/SignInModal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ function SignInModal() {
3434
return (
3535
<Modal>
3636
<div className='flex flex-col items-center justify-center gap-4 p-4'>
37-
<p className='text-2xl font-bold text-indigo-600'>Ask-It</p>
37+
<div className='font-header text-2xl'>
38+
<span className='text-indigo-600'>A</span>
39+
<span className='text-black'>sk-It</span>
40+
</div>
3841
<InputField
3942
label='이메일'
4043
type='email'

apps/client/src/components/modal/SignUpModal.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ function SignUpModal() {
5757
return (
5858
<Modal>
5959
<div className='flex flex-col items-center justify-center gap-4 p-4'>
60-
<p className='text-2xl font-bold text-indigo-600'>Ask-It</p>
60+
<div className='font-header text-2xl'>
61+
<span className='text-indigo-600'>A</span>
62+
<span className='text-black'>sk-It</span>
63+
</div>
6164
<InputField
6265
label='이메일'
6366
type='email'

apps/client/src/components/qna/QuestionList.tsx

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { IoClose, IoShareSocialOutline } from 'react-icons/io5';
55

66
import { useModal } from '@/features/modal';
77
import { useSessionStore } from '@/features/session';
8+
import { useToastStore } from '@/features/toast';
89

910
import {
1011
Button,
@@ -15,8 +16,16 @@ import QuestionSection from '@/components/qna/QuestionSection';
1516
import SessionSettingsDropdown from '@/components/qna/SessionSettingsDropdown';
1617

1718
function QuestionList() {
18-
const { sessionTitle, expired, isHost, questions, setSelectedQuestionId } =
19-
useSessionStore();
19+
const {
20+
isHost,
21+
expired,
22+
questions,
23+
sessionId,
24+
sessionTitle,
25+
setSelectedQuestionId,
26+
} = useSessionStore();
27+
28+
const { addToast } = useToastStore();
2029

2130
const { Modal: CreateQuestion, openModal: openCreateQuestionModal } =
2231
useModal(<CreateQuestionModal />);
@@ -62,7 +71,24 @@ function QuestionList() {
6271
{
6372
icon: <IoShareSocialOutline />,
6473
label: '공유',
65-
onClick: () => {},
74+
onClick: async () => {
75+
const shareUrl = `${window.location.origin}/session/${sessionId}`;
76+
77+
try {
78+
await navigator.clipboard.writeText(shareUrl);
79+
addToast({
80+
type: 'SUCCESS',
81+
message: '세션 링크가 클립보드에 복사되었습니다',
82+
duration: 3000,
83+
});
84+
} catch (err) {
85+
addToast({
86+
type: 'ERROR',
87+
message: '링크 복사에 실패했습니다',
88+
duration: 3000,
89+
});
90+
}
91+
},
6692
},
6793
{
6894
icon: <GrValidate />,

0 commit comments

Comments
 (0)