Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#476] [모임 상세] 비로그인 시 모임 참여하기 버튼 비활성화 #479

Merged
merged 2 commits into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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