Skip to content

Commit

Permalink
[#476] [모임 상세] 비로그인 시 모임 참여하기 버튼 비활성화 (#479)
Browse files Browse the repository at this point in the history
* refactor: 카카오 로그인 url 상수 선언

* feat: 비로그인시 로그인 및 회원가입 버튼 노출
  • Loading branch information
gxxrxn committed Jun 17, 2024
1 parent 5e54b72 commit a2e628d
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 15 additions & 1 deletion src/app/group/[groupId]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
'use client';

import Link from 'next/link';
import SSRSafeSuspense from '@/components/SSRSafeSuspense';
import BookGroupInfo from '@/v1/bookGroup/detail/BookGroupInfo';
import CommentList from '@/v1/bookGroup/detail/CommentList';
import BookGroupNavigation from '@/v1/bookGroup/BookGroupNavigation';
import JoinBookGroupButton from '@/v1/bookGroup/detail/JoinBookGroupButton';
import BottomActionButton from '@/v1/base/BottomActionButton';
import { isAuthed } from '@/utils/helpers';
import { KAKAO_LOGIN_URL } from '@/constants/url';

const DetailBookGroupPage = ({
params: { groupId },
Expand All @@ -29,7 +33,11 @@ const DetailBookGroupPage = ({
<CommentList groupId={groupId} />
</div>
</div>
<JoinBookGroupButton groupId={groupId} />
{isAuthed() ? (
<JoinBookGroupButton groupId={groupId} />
) : (
<LoginBottomActionButton />
)}
</SSRSafeSuspense>
</>
);
Expand All @@ -54,3 +62,9 @@ const PageSkeleton = () => (
);

const Divider = () => <p className="w-app h-[0.5rem] bg-background"></p>;

const LoginBottomActionButton = () => (
<Link href={KAKAO_LOGIN_URL}>
<BottomActionButton>로그인 및 회원가입</BottomActionButton>
</Link>
);
2 changes: 2 additions & 0 deletions src/constants/dataUrl.ts → src/constants/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ export const DATA_URL = {
placeholder:
'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAA1JREFUGFdjWL9+/X8ABysDDapsaG4AAAAASUVORK5CYII=', // data url for placeholder color (#AFAFAF)
};

export const KAKAO_LOGIN_URL = `${process.env.NEXT_PUBLIC_API_URL}/oauth2/authorize/kakao?redirect_uri=${process.env.NEXT_PUBLIC_CLIENT_REDIRECT_URI}`;
2 changes: 1 addition & 1 deletion src/v1/book/BookCover.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentPropsWithoutRef } from 'react';
import Image from 'next/image';

import { DATA_URL } from '@/constants/dataUrl';
import { DATA_URL } from '@/constants/url';

type BookCoverSize =
| 'xsmall'
Expand Down

0 comments on commit a2e628d

Please sign in to comment.