diff --git a/public/images/share-kakao.png b/public/images/share-kakao.png new file mode 100644 index 00000000..df6c4a48 Binary files /dev/null and b/public/images/share-kakao.png differ diff --git a/public/images/share-link.png b/public/images/share-link.png new file mode 100644 index 00000000..10ddbae3 Binary files /dev/null and b/public/images/share-link.png differ diff --git a/src/app/(main)/page.tsx b/src/app/(main)/page.tsx index 3ef30c2f..33db9b44 100644 --- a/src/app/(main)/page.tsx +++ b/src/app/(main)/page.tsx @@ -20,5 +20,5 @@ export async function generateMetadata(): Promise { } export default function RootPage() { - redirect('/project'); + redirect('/teampsylog'); } diff --git a/src/app/(main)/teampsylog/[uuid]/_components/KeywordListPage.tsx b/src/app/(main)/teampsylog/[uuid]/_components/KeywordListPage.tsx index c48ba185..ac9d9c58 100644 --- a/src/app/(main)/teampsylog/[uuid]/_components/KeywordListPage.tsx +++ b/src/app/(main)/teampsylog/[uuid]/_components/KeywordListPage.tsx @@ -10,7 +10,7 @@ const KeywordListPage = () => { return ( <> - + ); }; diff --git a/src/app/(main)/teampsylog/_components/CommentPage.tsx b/src/app/(main)/teampsylog/_components/CommentPage.tsx index f7e08705..67f2d8e5 100644 --- a/src/app/(main)/teampsylog/_components/CommentPage.tsx +++ b/src/app/(main)/teampsylog/_components/CommentPage.tsx @@ -37,12 +37,12 @@ const CommentPage = ({ return (

{`‘${keywordName}’에 대한 다른 사람들의 코멘트에요`}

-

중복된 키워드는 말풍선이 커져요

+ {/*

중복된 키워드는 말풍선이 커져요

*/}
{comments.map((comment, idx) => ( diff --git a/src/app/(main)/teampsylog/_components/KeywordBar.tsx b/src/app/(main)/teampsylog/_components/KeywordBar.tsx index 9dd1f99d..291ad654 100644 --- a/src/app/(main)/teampsylog/_components/KeywordBar.tsx +++ b/src/app/(main)/teampsylog/_components/KeywordBar.tsx @@ -6,6 +6,7 @@ import ProfileDropdown from './ProfileDropdown'; import { ResponseProfile } from '@/types/profile'; import { useToast } from '@/contexts/ToastContext'; import KeywordGuideBalloon from './KeywordGuideBalloon'; +import { useModal } from '@/contexts/ModalContext'; const KeywordBar = ({ profileId, @@ -42,6 +43,8 @@ const KeywordBar = ({ ...Array(Math.max(0, 3 - headKeywords.length)).fill('키워드 선택'), ]; + // 모달 추가 + const { openModal } = useModal(); const handleShare = async () => { let uuid: string | undefined; if (typeof window !== 'undefined') { @@ -60,7 +63,9 @@ const KeywordBar = ({ ? `${window.location.origin}/teampsylog/head/${uuid}` : `${window.location.origin}/teampsylog`; await navigator.clipboard.writeText(url); - addToast({ message: '링크가 복사되었어요' }); + + openModal('linkShare'); + // addToast({ message: '링크가 복사되었어요' }); }; const [dismissedByUser, setDismissedByUser] = useState(false); diff --git a/src/app/(main)/teampsylog/_components/KeywordPage.tsx b/src/app/(main)/teampsylog/_components/KeywordPage.tsx index 944829e5..239a64fb 100644 --- a/src/app/(main)/teampsylog/_components/KeywordPage.tsx +++ b/src/app/(main)/teampsylog/_components/KeywordPage.tsx @@ -16,14 +16,17 @@ import Loading from '@/components/common/Loading'; import KeywordGuideOverlay from './KeywordGuideOverlay'; interface Props { - share?: boolean; uuid?: string; } -const KeywordPage = ({ share = false, uuid }: Props) => { +// uuid 비교후 사용자와 동일하면 일반모드, 다르면 공유모드. + +const KeywordPage = ({ uuid }: Props) => { const router = useRouter(); const { addToast } = useToast(); - const { userName, _hasHydrated } = useUserStore(); + const { uuid: userUuid, userName, _hasHydrated } = useUserStore(); + + const share = !_hasHydrated || userUuid !== uuid; const hasAlerted = useRef(false); @@ -53,14 +56,14 @@ const KeywordPage = ({ share = false, uuid }: Props) => { } }, [_hasHydrated, userName, router, addToast, share]); - // 공유 모드: uuid가 있을 때만 실행 + // 공유 모드일 때만 실행 const requesterInfoResult = useRequesterInfo(uuid ?? '', { enabled: share && !!uuid }); const requesterInfo = requesterInfoResult.data; const shareUserId = share && requesterInfo ? requesterInfo.userId : null; const requesterName = requesterInfo?.requesterName; - // 공유모드 getProfileList 가져오기 - const { data: sharedProfiles } = useGetUuidProfileList(uuid ?? ''); + // 공유 모드일 때만 uuid 기반 프로필을 가져온다. + const { data: sharedProfiles } = useGetUuidProfileList(share && uuid ? uuid : ''); // 일반 모드 const isAuthenticated = _hasHydrated && checkIsLoggedIn(userName); diff --git a/src/app/(main)/teampsylog/page.tsx b/src/app/(main)/teampsylog/page.tsx index 3e887031..4d0bcb3b 100644 --- a/src/app/(main)/teampsylog/page.tsx +++ b/src/app/(main)/teampsylog/page.tsx @@ -1,11 +1,30 @@ -import MobileHeader from '@/components/common/MobileHeader'; -import KeywordPage from './_components/KeywordPage'; +'use client'; +import { useEffect, useRef } from 'react'; +import { useRouter } from 'next/navigation'; +import Loading from '@/components/common/Loading'; +import { useUserStore } from '@/store/useUserStore'; const Page = () => { + const router = useRouter(); + const { uuid, _hasHydrated } = useUserStore(); + const redirectedRef = useRef(false); + + useEffect(() => { + if (!_hasHydrated || redirectedRef.current) return; + + redirectedRef.current = true; + + if (uuid) { + router.replace(`/teampsylog/${uuid}`); + return; + } + + router.replace('/login'); + }, [_hasHydrated, router, uuid]); + return (
- - +
); }; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index aa5896f4..08042e1d 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,10 +1,12 @@ import type { Metadata } from 'next'; import localFont from 'next/font/local'; +import Script from 'next/script'; import { GoogleTagManager } from '@next/third-parties/google'; import './globals.css'; import { ModalProvider } from '@/contexts/ModalContext'; import Providers from './provider'; import { ToastProvider } from '@/contexts/ToastContext'; +import KakaoScript from '@/components/common/KaKaoScript'; const pretendard = localFont({ src: '../../public/fonts/PretendardVariable.woff2', @@ -15,13 +17,14 @@ const pretendard = localFont({ export const metadata: Metadata = { title: 'TEAMFICIAL', - description: 'Generated by create next app', + description: '소프트스킬 팀빌딩 서비스, 팀피셜', icons: { icon: [ { url: '/favicon.ico', sizes: '48x48', type: 'image/x-icon' }, { url: '/favicon.svg', type: 'image/svg+xml' }, ], - apple: '/apple-touch-icon.png', + apple: [{ url: '/apple-touch-icon.png', sizes: '180x180' }], + shortcut: '/favicon.ico', }, }; @@ -39,6 +42,7 @@ export default function RootLayout({ + ); diff --git a/src/components/common/Header.tsx b/src/components/common/Header.tsx index fdc64a6f..5854fc2d 100644 --- a/src/components/common/Header.tsx +++ b/src/components/common/Header.tsx @@ -74,7 +74,7 @@ const Header = () => { height={41} /> - { )} > 팀피셜록 - + */}
{isLoggedIn ? (
@@ -106,7 +106,7 @@ const Header = () => { profile {isProfileDropdownOpen && ( -
+
{
- { onClick={() => setIsMenuOpen(false)} > 프로젝트 - + */} { > 팀피셜록 - {isLoggedIn ? ( + {/* {isLoggedIn ? ( { > 마이페이지 - ) : null} + ) : null} */}
diff --git a/src/components/common/KaKaoScript.tsx b/src/components/common/KaKaoScript.tsx new file mode 100644 index 00000000..89722319 --- /dev/null +++ b/src/components/common/KaKaoScript.tsx @@ -0,0 +1,19 @@ +'use client'; + +import Script from 'next/script'; + +export default function KakaoScript() { + return ( +