Skip to content
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
28 changes: 28 additions & 0 deletions src/app/(crew)/crew/detail/[id]/_components/create-gathering.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
'use client';

import { useDisclosure } from '@mantine/hooks';
import CreateGatheringModalContainer from '@/src/app/(crew)/crew/_components/create-gathering-modal/container';
import Button from '@/src/components/common/input/button';
import { CreateGatheringRequestType } from '@/src/types/gathering-data';

export default function CreateGathering() {
const [opened, { open, close }] = useDisclosure(false);

const initialValue: CreateGatheringRequestType = {
title: '',
introduce: '',
dateTime: '',
location: '',
totalCount: 0,
imageUrl: null,
};

return (
<>
<Button type="button" className="btn-filled px-4" onClick={open}>
์•ฝ์† ๋งŒ๋“ค๊ธฐ
</Button>
<CreateGatheringModalContainer opened={opened} close={close} data={initialValue} />
</>
);
}
6 changes: 2 additions & 4 deletions src/app/(crew)/crew/detail/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { getCrewDetail } from '@/src/_apis/detail/get-crew-detail';
import { getGatheringList } from '@/src/_apis/detail/get-gathering-list';
import DetailCrewCard from '@/src/components/common/crew-list/detail-crew-card';
import Button from '@/src/components/common/input/button';
import GatheringCardCarousel from '@/src/components/gathering-list/gathering-card-carousel';
import CreateGathering from './_components/create-gathering';
import CrewReviewSection from './_components/review-section';

export default async function CrewDetailPage() {
Expand All @@ -21,9 +21,7 @@ export default async function CrewDetailPage() {
<article className="space-y-6">
<div className="flex items-center justify-between">
<h2 className="text-2xl font-semibold">ํฌ๋ฃจ ์•ฝ์† ์žก๊ธฐ</h2>
<Button type="button" className="btn-filled px-4">
์•ฝ์† ๋งŒ๋“ค๊ธฐ
</Button>
<CreateGathering />
</div>
<div className="flex w-full">
<GatheringCardCarousel gatheringData={gatheringList} />
Expand Down
2 changes: 1 addition & 1 deletion src/app/(crew)/my-crew/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import CrewCardList from '@/src/components/common/crew-list/crew-card-list';
import Tabs from '@/src/components/common/tab';
import { CrewCardInformResponse } from '@/src/types/crew-card';

export default function MyCrePage() {
export default function MyCrewPage() {
const myPageTabs = [
{ label: '๋‚ด๊ฐ€ ์ฐธ์—ฌํ•œ ํฌ๋ฃจ', id: 'joined-crew' },
{ label: '๋‚ด๊ฐ€ ๋งŒ๋“  ํฌ๋ฃจ', id: 'made-crew' },
Expand Down
Empty file removed src/app/(crew)/mypage/.gitkeep
Empty file.
4 changes: 2 additions & 2 deletions src/components/common/crew-list/detail-crew-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export default function DetailCrewCard({
</div>
</Menu.Target>
<Menu.Dropdown>
<Menu.Item component="a" href="/crew/edit" className="font-pretendard">
<Menu.Item component="a" href={`/crew/detail/${id}/edit`} className="font-pretendard">
ํฌ๋ฃจ ์ˆ˜์ •ํ•˜๊ธฐ
</Menu.Item>
<Menu.Item
Expand Down Expand Up @@ -136,7 +136,7 @@ export default function DetailCrewCard({

{isConfirmed && (
<span className="flex items-center gap-[1px] text-blue-600">
<Image src={Check} alt="ํ™•์ธ" width={24} height={24} />{' '}
<Image src={Check} alt="ํ™•์ธ" width={24} height={24} />
<span className="text-sm font-medium"> ๊ฐœ์„ค ํ™•์ •</span>
</span>
)}
Expand Down
26 changes: 23 additions & 3 deletions src/components/common/review-list/review-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import React, { useState } from 'react';
import { useRouter } from 'next/navigation';
import { Button } from '@mantine/core';
import { useDisclosure } from '@mantine/hooks';
import { formatDateWithYear } from '@/src/utils/format-date';
import ConfirmCancelModal from '@/src/components/common/modal/confirm-cancel-modal';
import { ReviewerType } from '@/src/types/review';
import { Profile } from '../profile';
import ReviewHearts from '../review-heart/hearts';
Expand Down Expand Up @@ -41,6 +43,11 @@ export default function ReviewCard({
gatheringLocation,
reviewer,
}: ReviewCardProps) {
const [
confirmDeleteModalOpened,
{ open: openConfirmDeleteModal, close: closeConfirmDeleteModal },
] = useDisclosure(false);

const [prefetched, setPrefetched] = useState(new Set());
const CREWPAGE = `crew/detail/${crewId}`;
const router = useRouter();
Expand All @@ -55,8 +62,9 @@ export default function ReviewCard({
setPrefetched(new Set(prefetched).add(CREWPAGE));
};

const handleDelete = (e: React.MouseEvent) => {
e.stopPropagation();
const handleDelete = () => {
// TODO: ์‚ญ์ œ ๋กœ์ง
closeConfirmDeleteModal();
};

const { year, month, day } = formatDateWithYear(createdAt);
Expand Down Expand Up @@ -102,12 +110,24 @@ export default function ReviewCard({
<Button
variant="outline"
className="flex-shrink-0 p-[6px_14px] text-base font-semibold"
onClick={handleDelete}
onClick={(e) => {
e.stopPropagation();
openConfirmDeleteModal();
}}
>
๋ฆฌ๋ทฐ ์‚ญ์ œํ•˜๊ธฐ
</Button>
)}
</div>

{/* ์‚ญ์ œ ํ™•์ธ ๋ชจ๋‹ฌ */}
<ConfirmCancelModal
opened={confirmDeleteModalOpened}
onClose={closeConfirmDeleteModal}
onConfirm={handleDelete}
>
๋ฆฌ๋ทฐ๋ฅผ ์‚ญ์ œํ•˜์‹œ๊ฒ ์Šต๋‹ˆ๊นŒ?
</ConfirmCancelModal>
</div>
);
}