);
};
-function ClubMemberTab() {
+interface ClubMemberTabProps {
+ memberCount: number;
+}
+
+function ClubMemberTab({ memberCount }: ClubMemberTabProps) {
const { clubId } = useParams();
const { data: clubMembers } = useGetClubMembers(Number(clubId));
- const totalMembers = clubMembers?.clubMembers.length;
+ const members = clubMembers?.clubMembers ?? [];
+ const totalMembers = clubMembers?.clubMembers.length ?? memberCount;
+
return (
- <>
-
- {clubMembers?.clubMembers.map((member) => (
+
+
{totalMembers}명
+
+ {members.map((member) => (
))}
- >
+
);
}
diff --git a/src/pages/Club/ClubDetail/components/ClubRecruitment.tsx b/src/pages/Club/ClubDetail/components/ClubRecruitment.tsx
index bcfeada..86a8fe4 100644
--- a/src/pages/Club/ClubDetail/components/ClubRecruitment.tsx
+++ b/src/pages/Club/ClubDetail/components/ClubRecruitment.tsx
@@ -58,7 +58,7 @@ function ClubRecruitment({ clubId, isMember, presidentUserId }: ClubRecruitProps
hasQuestions ? (
지원하기
@@ -66,7 +66,7 @@ function ClubRecruitment({ clubId, isMember, presidentUserId }: ClubRecruitProps
@@ -101,7 +101,7 @@ function ClubRecruitment({ clubId, isMember, presidentUserId }: ClubRecruitProps
type="button"
onClick={handleApply}
disabled={isPending}
- className="bg-primary text-h3 w-full rounded-lg py-3.5 text-center text-white disabled:opacity-50"
+ className="bg-primary-500 text-h3 w-full rounded-lg py-3.5 text-center text-white disabled:opacity-50"
>
지원하기
diff --git a/src/pages/Club/ClubDetail/index.tsx b/src/pages/Club/ClubDetail/index.tsx
index cfd7fa9..50b478d 100644
--- a/src/pages/Club/ClubDetail/index.tsx
+++ b/src/pages/Club/ClubDetail/index.tsx
@@ -1,6 +1,6 @@
import { Activity, useEffect } from 'react';
import clsx from 'clsx';
-import { useParams, useSearchParams, useLocation } from 'react-router-dom';
+import { useLocation, useParams, useSearchParams } from 'react-router-dom';
import useScrollToTop from '@/utils/hooks/useScrollToTop';
import ClubAccount from './components/ClubAccount';
import ClubIntro from './components/ClubIntro';
@@ -24,9 +24,10 @@ function ClubDetail() {
}, [location.state]);
const [searchParams, setSearchParams] = useSearchParams();
- const currentTab = searchParams.get('tab') || 'intro';
+ const requestedTab = searchParams.get('tab');
+ const clubIdNumber = Number(clubId);
- const { data: clubDetail } = useGetClubDetail(Number(clubId));
+ const { data: clubDetail } = useGetClubDetail(clubIdNumber);
const handleTabClick = (tab: TabType) => {
setSearchParams({ tab }, { replace: true });
@@ -44,32 +45,34 @@ function ClubDetail() {
];
const visibleTabs = tabs.filter((tab) => tab.show);
+ const currentTab = visibleTabs.some((tab) => tab.key === requestedTab)
+ ? (requestedTab as TabType)
+ : (visibleTabs.find((tab) => tab.key === 'intro')?.key ?? visibleTabs[0]?.key ?? 'intro');
return (
- <>
-
-
+
+
+

-
-
{clubDetail.name}
-
{clubDetail.categoryName}
-
{clubDetail.description}
+
+
{clubDetail.name}
+
{clubDetail.categoryName}
+
{clubDetail.description}
-
+
{visibleTabs.map((tab) => (
-
+
{clubDetail.recruitment.status !== 'CLOSED' && (
@@ -92,7 +95,7 @@ function ClubDetail() {
{clubDetail.isMember && (
-
+
)}
{(clubDetail.isMember || clubDetail.isApplied) && (
@@ -101,7 +104,7 @@ function ClubDetail() {
)}
- >
+
);
}
diff --git a/src/pages/Club/ClubList/components/ClubCard.tsx b/src/pages/Club/ClubList/components/ClubCard.tsx
index 6ffcb48..57beb58 100644
--- a/src/pages/Club/ClubList/components/ClubCard.tsx
+++ b/src/pages/Club/ClubList/components/ClubCard.tsx
@@ -33,7 +33,7 @@ function ClubCard({ club }: ClubCardProps) {
const clubTag: ClubTag | null = (() => {
if (club.isPendingApproval) {
return {
- label: '승인대기중',
+ label: '승인 대기중',
bgColor: '#FEF3C7',
textColor: '#B45309',
};
@@ -62,24 +62,24 @@ function ClubCard({ club }: ClubCardProps) {
-

+
-
-
{club.name}
-
{club.categoryName}
+
+
{club.name}
+
{club.categoryName}
{clubTag && (
-
+
{clubTag.label}
)}
diff --git a/src/pages/Club/ClubList/components/SearchBar.tsx b/src/pages/Club/ClubList/components/SearchBar.tsx
index 275f752..56947a1 100644
--- a/src/pages/Club/ClubList/components/SearchBar.tsx
+++ b/src/pages/Club/ClubList/components/SearchBar.tsx
@@ -2,6 +2,8 @@ import { type FormEvent } from 'react';
import { Link } from 'react-router-dom';
import SearchIcon from '@/assets/svg/search.svg';
+const SEARCH_PLACEHOLDER = '동아리 이름으로 검색';
+
interface SearchBarProps {
isButton?: boolean;
value?: string;
@@ -11,19 +13,23 @@ interface SearchBarProps {
}
function SearchBar({ isButton, value, onChange, onSubmit, autoFocus }: SearchBarProps) {
- const wrapperClass = 'fixed left-0 right-0 bg-white px-3 py-2 shadow-[0_2px_2px_0_rgba(0,0,0,0.04)] z-10';
+ const wrapperClass =
+ 'fixed top-11 left-0 right-0 z-20 rounded-b-2xl bg-white px-3 py-2 shadow-[0_0_20px_0_rgba(0,0,0,0.03)]';
const content = (
-
-
-
onChange(e.target.value) : undefined}
- autoFocus={autoFocus}
- />
+
+
+ {isButton && !onChange ? (
+
{SEARCH_PLACEHOLDER}
+ ) : (
+
onChange(e.target.value) : undefined}
+ autoFocus={autoFocus}
+ />
+ )}
);
diff --git a/src/pages/Club/ClubList/index.tsx b/src/pages/Club/ClubList/index.tsx
index f3f6a7c..0d0e07f 100644
--- a/src/pages/Club/ClubList/index.tsx
+++ b/src/pages/Club/ClubList/index.tsx
@@ -19,12 +19,12 @@ function ClubList() {
const allClubs = data?.pages.flatMap((page) => page.clubs) ?? [];
return (
-
+ <>
-
-
- 총 {totalCount}개의 동아리
-
+
+
+
+
총 {totalCount}개의 동아리
{allClubs.map((club) => (
@@ -34,7 +34,7 @@ function ClubList() {
{hasNextPage &&
}
-
+ >
);
}
diff --git a/src/pages/Club/ClubSearch/index.tsx b/src/pages/Club/ClubSearch/index.tsx
index 97001c0..33e3137 100644
--- a/src/pages/Club/ClubSearch/index.tsx
+++ b/src/pages/Club/ClubSearch/index.tsx
@@ -44,15 +44,14 @@ function ClubSearch() {
return (
<>
+
-
+
{!debouncedQuery ? (
검색어를 입력해서 동아리를 검색해보세요.
) : (
<>
-
- 총 {totalCount}개의 동아리
-
+
총 {totalCount}개의 동아리
{allClubs.map((club) => (