diff --git a/.eslintrc.js b/.eslintrc.js index f1c0a33..935c0d4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -74,5 +74,7 @@ module.exports = { '@typescript-eslint/explicit-function-return-type': 'off', '@typescript-eslint/non-nullable-type-assertion-style': 'off', '@typescript-eslint/promise-function-async': 'off', + '@typescript-eslint/no-misused-promises': 'off', + '@typescript-eslint/triple-slash-reference': 'off', }, } diff --git a/app/(route)/challenge/_components/ChallengeFormDialog.tsx b/app/(route)/challenge/_components/ChallengeFormDialog.tsx index 0afc8d2..34332bb 100644 --- a/app/(route)/challenge/_components/ChallengeFormDialog.tsx +++ b/app/(route)/challenge/_components/ChallengeFormDialog.tsx @@ -10,6 +10,8 @@ import BlackCloseIcon from '@/app/_components/icons/BlackCloseIcon' import { Dialog, DialogClose, DialogContent, DialogTrigger } from '@/app/_components/shared/dialog' import { cn } from '@/app/_styles/utils' +import { share } from '../_utils' + import ChallengeForm from './challenge-form-input' type Category = '자기계발' | '생활습관' | '공부' | '운동' | '기타' | '선택안함' @@ -97,6 +99,14 @@ export default function ChallengeFormDialog() { 'mx-auto min-h-[60px] w-[240px] rounded-lg bg-[#482BD9] text-center', 'disabled:bg-[#A6A6A6]' )} + onClick={() => { + share.kakao({ + title: '불주먹123님이 초대장을 보냈어요!', + description: '1:1 목표 매칭 서비스', + imageUrl: 'https://dodals3.s3.ap-northeast-2.amazonaws.com/asset/dodaldodal_square.png', + link: 'https://dodaldodal-frontend-vercel.app', + }) + }} > 함께할 친구 초대하기 diff --git a/app/(route)/challenge/_components/challenge-form-input.tsx b/app/(route)/challenge/_components/challenge-form-input.tsx index 2b59cd2..4f41543 100644 --- a/app/(route)/challenge/_components/challenge-form-input.tsx +++ b/app/(route)/challenge/_components/challenge-form-input.tsx @@ -2,7 +2,11 @@ export default function ChallengeForm({ children }: { children: React.ReactNode return } -function Title({ title }: { title: string }) { +interface ChallengeFormTitleProps { + title: string +} + +function Title({ title }: ChallengeFormTitleProps) { return {title} } @@ -15,7 +19,7 @@ function Input({ currentLength, maxLength, ...props }: ChallengeFormInputProps) return (
diff --git a/app/(route)/challenge/_utils/index.ts b/app/(route)/challenge/_utils/index.ts new file mode 100644 index 0000000..9b94ba1 --- /dev/null +++ b/app/(route)/challenge/_utils/index.ts @@ -0,0 +1,40 @@ +export const share = { + kakao: ({ + title, + description, + imageUrl, + link, + }: { + title: string + description: string + imageUrl: string + link: string + }) => { + const { Kakao } = window + if (!Kakao.isInitialized()) { + console.log('init') + Kakao.init('f0146584008c5fad855abb3cfad073d7') + } + Kakao.Share.sendDefault({ + objectType: 'feed', + content: { + title, + description, + imageUrl, + link: { + mobileWebUrl: link, + webUrl: link, + }, + }, + buttons: [ + { + title: '웹으로 보기', + link: { + mobileWebUrl: link, + webUrl: link, + }, + }, + ], + }) + }, +} diff --git a/app/(route)/challenge/layout.tsx b/app/(route)/challenge/layout.tsx index 8934709..5fa691f 100644 --- a/app/(route)/challenge/layout.tsx +++ b/app/(route)/challenge/layout.tsx @@ -21,6 +21,12 @@ export default function Layout({ children }: { children: React.ReactNode }) { {children} + ) } diff --git a/app/(route)/invitation/[id]/layout.tsx b/app/(route)/invitation/[id]/layout.tsx new file mode 100644 index 0000000..80a0cfb --- /dev/null +++ b/app/(route)/invitation/[id]/layout.tsx @@ -0,0 +1,20 @@ +'use client' + +import Header from '@/app/_components/shared/header' + +export default function layout({ children }: { children: React.ReactNode }) { + return ( +
+
+
+ 초대장 도착 + { + window.close() + }} + /> +
+ {children} +
+ ) +} diff --git a/app/(route)/invitation/[id]/page.tsx b/app/(route)/invitation/[id]/page.tsx new file mode 100644 index 0000000..6d4da4e --- /dev/null +++ b/app/(route)/invitation/[id]/page.tsx @@ -0,0 +1,24 @@ +import Image from 'next/image' + +export default function InvitationPage() { + return ( +
+
+ +
+
+
+ 별빛우주 + 님이 초대장을 보냈어요 +
+ 목표를 위해 함께 달려볼까요? +
+
+ + +
+
+ ) +} diff --git a/app/_components/shared/header.tsx b/app/_components/shared/header.tsx index 10a2992..c674cf0 100644 --- a/app/_components/shared/header.tsx +++ b/app/_components/shared/header.tsx @@ -3,11 +3,20 @@ import Link from 'next/link' import { type ButtonHTMLAttributes } from 'react' import { ROUTE } from '@/app/_constants/route' +import { cn } from '@/app/_styles/utils' -export default function Header({ children }: { children: React.ReactNode }) { +interface HeaderProps extends React.HTMLAttributes { + children: React.ReactNode + className?: string +} + +export default function Header({ children, className, ...props }: HeaderProps) { return ( -
-
{children}
+
+
{children}
) } @@ -48,9 +57,11 @@ function Title({ children }: { children: React.ReactNode }) { return
{children}
} -function Close() { +interface CloseProps extends React.HTMLAttributes {} + +function Close({ ...props }: CloseProps) { return ( -