diff --git a/packages/web-domains/src/answer/features/answer-closing/containers/AnswerClosingContainer.tsx b/packages/web-domains/src/answer/features/answer-closing/containers/AnswerClosingContainer.tsx index e730827a..49b9be9b 100644 --- a/packages/web-domains/src/answer/features/answer-closing/containers/AnswerClosingContainer.tsx +++ b/packages/web-domains/src/answer/features/answer-closing/containers/AnswerClosingContainer.tsx @@ -7,8 +7,10 @@ import { ClosingButton } from '../../floating-button/components/ClosingButton'; import { ClosingMessage } from '../components/ClosingMessage'; import { useAnswerClosingService } from '../services/useAnswerClosingService'; +const KAKAO_SHARE_IMAGE_URL = 'https://file.moring.one/defaults/question_narrow.png'; + export const AnswerClosingContainer = () => { - const { meetingId, answerGlobalTime, isOpen, basePath, close } = useAnswerClosingService(); + const { meetingId, meetingName, answerGlobalTime, isOpen, basePath, close } = useAnswerClosingService(); return ( <> @@ -27,6 +29,8 @@ export const AnswerClosingContainer = () => { onClose={close} topTitle="모임원들에게 릴레이 질문을" bottomTitle="공유해보세요!" + shareDescription={`${meetingName} 모임 질문을 잊진 않으셨나요?`} + shareImageUrl={KAKAO_SHARE_IMAGE_URL} shareLink={`${basePath}/${meetingId}/answer/opening`} /> diff --git a/packages/web-domains/src/answer/features/answer-closing/services/useAnswerClosingService.ts b/packages/web-domains/src/answer/features/answer-closing/services/useAnswerClosingService.ts index 85501547..e01e942d 100644 --- a/packages/web-domains/src/answer/features/answer-closing/services/useAnswerClosingService.ts +++ b/packages/web-domains/src/answer/features/answer-closing/services/useAnswerClosingService.ts @@ -6,12 +6,15 @@ import { useGetProgressingQuestion } from '@/answer/common/apis/queries/useGetPr import { answerAtoms } from '@/answer/common/atoms/answer.atom'; import { getWebDomain } from '@/common'; import { useDialogContext } from '@/common/contexts/DialogProvider'; +import { useGetMeetingInfo } from '@/home/common/apis/queries/useGetMeetingName'; export const useAnswerClosingService = () => { const { meetingId } = useParams<{ meetingId: string }>(); const [answerGlobalTime, setAnswerGlobalTime] = useAtom(answerAtoms.answerGlobalTime); + const { data: meetingInfo } = useGetMeetingInfo({}); const { close, isOpen } = useDialogContext(); + const meetingName = meetingInfo?.meetings.find((meeting) => meeting.meetingId === Number(meetingId))?.name; const basePath = getWebDomain(); useGetProgressingQuestion({ @@ -29,6 +32,7 @@ export const useAnswerClosingService = () => { return { meetingId, + meetingName, answerGlobalTime: answerGlobalTime ?? 0, isOpen, close, diff --git a/packages/web-domains/src/common/components/KakaoShare/generateKakaoShare.utils.ts b/packages/web-domains/src/common/components/KakaoShare/generateKakaoShare.utils.ts index ffc5763f..f3fd2469 100644 --- a/packages/web-domains/src/common/components/KakaoShare/generateKakaoShare.utils.ts +++ b/packages/web-domains/src/common/components/KakaoShare/generateKakaoShare.utils.ts @@ -10,6 +10,12 @@ interface ShareToKakaoProps { shareLink: string; } +const buttonTextMap: Record = { + 'https://file.moring.one/defaults/invite_narrow.png': '모임 참여하기', + 'https://file.moring.one/defaults/question_narrow.png': '답변하러 가기', + 'https://file.moring.one/defaults/new_question_narrow.png': '답변하러 가기', +}; + export const generateKakaoShare = ({ shareLink, shareImageUrl, shareDescription }: ShareToKakaoProps) => { const { Kakao } = window; @@ -26,5 +32,14 @@ export const generateKakaoShare = ({ shareLink, shareImageUrl, shareDescription mobileWebUrl: shareLink, }, }, + buttons: [ + { + title: buttonTextMap[shareImageUrl], + link: { + webUrl: shareLink, + mobileWebUrl: shareLink, + }, + }, + ], }); }; diff --git a/packages/web-domains/src/home/features/gather-member/containers/GatherMemberProfileListContainer.tsx b/packages/web-domains/src/home/features/gather-member/containers/GatherMemberProfileListContainer.tsx index 3a283d32..e372a91c 100644 --- a/packages/web-domains/src/home/features/gather-member/containers/GatherMemberProfileListContainer.tsx +++ b/packages/web-domains/src/home/features/gather-member/containers/GatherMemberProfileListContainer.tsx @@ -11,6 +11,7 @@ import { useGatherMemberProfileListService } from '../services/useGatherMemberPr export const GatherMemberProfileListContainer = () => { const { meetingId, + meetingName, isOpen, gatherMemberList, searchInput, @@ -40,6 +41,8 @@ export const GatherMemberProfileListContainer = () => { onClose={inviteModalClose} topTitle="모임원들을 모링으로" bottomTitle="초대해보세요!" + shareDescription={`${meetingName} 모임에 여러분들을 초대합니다`} + shareImageUrl="https://file.moring.one/defaults/invite_narrow.png" shareLink={inviteLink} /> diff --git a/packages/web-domains/src/home/features/gather-member/services/useGatherMemberProfileListService.tsx b/packages/web-domains/src/home/features/gather-member/services/useGatherMemberProfileListService.tsx index 4c5c41c8..ffe1d5a9 100644 --- a/packages/web-domains/src/home/features/gather-member/services/useGatherMemberProfileListService.tsx +++ b/packages/web-domains/src/home/features/gather-member/services/useGatherMemberProfileListService.tsx @@ -6,6 +6,7 @@ import { getWebDomain } from '@/common'; import { generateInviteLink } from '@/common/utils/generateInviteLink'; import { getKeywordRegex } from '@/common/utils/getKeywordRegex'; import { useGetInviteCode } from '@/home/common/apis/queries/useGetInviteCode'; +import { useGetMeetingInfo } from '@/home/common/apis/queries/useGetMeetingName'; import { MemberType } from '@/home/common/apis/schema/useGetProgressingQuestionQuery.type'; import { HomeAtoms } from '@/home/common/atoms/home.atom'; @@ -30,6 +31,10 @@ export const useGatherMemberProfileListService = () => { options: { enabled: !!meetingId }, }); + const { data: meetingInfo } = useGetMeetingInfo({}); + + const meetingName = meetingInfo?.meetings.find((meeting) => meeting.meetingId === Number(meetingId))?.name; + const handleChangeSearchInput = (value: string) => { setSearchInput(value); }; @@ -70,6 +75,7 @@ export const useGatherMemberProfileListService = () => { return { meetingId, + meetingName, isOpen, inviteLink: generateInviteLink(inviteCode?.code) ?? `${getWebDomain()}`, searchInput, diff --git a/packages/web-domains/src/relay-question/features/select-relay-question/components/Question/Question.tsx b/packages/web-domains/src/relay-question/features/select-relay-question/components/Question/Question.tsx index a75bfee4..d29330a7 100644 --- a/packages/web-domains/src/relay-question/features/select-relay-question/components/Question/Question.tsx +++ b/packages/web-domains/src/relay-question/features/select-relay-question/components/Question/Question.tsx @@ -19,7 +19,7 @@ interface QuestionProps { export const Question = ({ id, imageUrl, title, usedCount, meetingId }: QuestionProps) => { const openModal = useModal(); - const { refetch } = useRelayQuestionQuery(1); + const { refetch } = useRelayQuestionQuery(id); const router = useRouter(); diff --git a/packages/web-domains/src/relay-question/features/share-group/containers/CurrentRelayQuestionCountContainer/CurrentRelayQuestionCountContainer.tsx b/packages/web-domains/src/relay-question/features/share-group/containers/CurrentRelayQuestionCountContainer/CurrentRelayQuestionCountContainer.tsx index a28a2f95..3374a3c9 100644 --- a/packages/web-domains/src/relay-question/features/share-group/containers/CurrentRelayQuestionCountContainer/CurrentRelayQuestionCountContainer.tsx +++ b/packages/web-domains/src/relay-question/features/share-group/containers/CurrentRelayQuestionCountContainer/CurrentRelayQuestionCountContainer.tsx @@ -37,7 +37,7 @@ export const CurrentRelayQuestionCountContainer = () => { if (!activeQuestion || !data) return; - const currentMeetingName = data.meetings.find(({ meetingId }) => meetingId === Number(meetingId))?.name; + const currentMeetingName = data.meetings.find((meeting) => meeting.meetingId === Number(meetingId))?.name; return ( <> @@ -89,7 +89,7 @@ export const CurrentRelayQuestionCountContainer = () => { topTitle="모임원들에게 릴레이 질문을" bottomTitle="공유해 보세요!" shareImageUrl={KAKAO_IMAGE_URL} - shareDescription={`새로운 질문이 도착했어요! 지금 바로 답변 하러 가볼까요? 다음 질문인은 ${activeQuestion.targetMember.name}님이에요`} + shareDescription={`새로운 질문이 도착했어요! 지금 바로 답변 하러 가볼까요? 다음 질문인은 ${activeQuestion?.nextTargetMember?.name || '000'}님이에요`} shareLink={`${getWebDomain()}/${meetingId}/answer/opening`} />