Skip to content

Commit

Permalink
fix: getWebDomain으로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
LeeJeongHooo committed Aug 27, 2024
1 parent 88441cc commit f427835
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { Txt } from '@sambad/sds/components';
import { size, colors } from '@sambad/sds/theme';
import CopyToClipboard from 'react-copy-to-clipboard';

import { getWebDomain } from '@/common';
import { CircleCopy } from '@/new-meeting/common/assets/icons/CircleCopy';
import { useToast } from '@/new-meeting/common/components/Toast/ToastProvider';

Expand All @@ -13,6 +14,7 @@ interface InviteLinkShareButtonProps {

export const InviteLinkShareButton = (props: InviteLinkShareButtonProps) => {
const { inviteCode } = props;
const domain = getWebDomain();

if (!inviteCode) {
return null;
Expand All @@ -24,7 +26,7 @@ export const InviteLinkShareButton = (props: InviteLinkShareButtonProps) => {
addToast(() => CopyToast({ content: '링크를 복사했어요!' }));
};

const copyUrl = `${window.location.origin}/meeting/participate/closing?inviteCode=${inviteCode}`;
const copyUrl = `${domain}/meeting/participate/closing?inviteCode=${inviteCode}`;

return (
<div css={{ margin: `${size['3xs']} ${size.xs}`, textAlign: 'center' }}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Txt } from '@sambad/sds/components';
import { size, colors } from '@sambad/sds/theme';

import { generateKakaoShare } from '@/common';
import { generateKakaoShare, getWebDomain } from '@/common';
import { CircleKakao } from '@/new-meeting/common/assets/icons/CircleKakao';

interface shareKakaoButtonProps {
Expand All @@ -11,6 +11,7 @@ interface shareKakaoButtonProps {

const ShareKakaoButton = (props: shareKakaoButtonProps) => {
const { inviteCode, name } = props;
const domain = getWebDomain();

if (!inviteCode) {
return null;
Expand All @@ -20,7 +21,7 @@ const ShareKakaoButton = (props: shareKakaoButtonProps) => {
generateKakaoShare({
shareDescription: `${name} 모임에 여러분들을 초대합니다`,
shareImageUrl: 'https://file.moring.one/defaults/invite_narrow.png',
shareLink: `${window.location.origin}/meeting/participate/closing?inviteCode=${inviteCode}`,
shareLink: `${domain}/meeting/participate/closing?inviteCode=${inviteCode}`,
});
};

Expand Down

0 comments on commit f427835

Please sign in to comment.