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
55 changes: 28 additions & 27 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,66 +1,67 @@
import { BrowserRouter, Routes, Route } from 'react-router-dom';
import { AppLayout, AuthLayout, HomeLayout } from './components/Layout';
import ApplicationPage from './pages/Application';
import ApplyFinishPage from './pages/Application/applyFinishPage';
import ClubFeePage from './pages/Application/clubFeePage';

import Layout from './components/layout';
import Login from './pages/Auth/Login';
import FinishStep from './pages/Auth/SignUp/FinishStep';
import NameStep from './pages/Auth/SignUp/NameStep';
import StudentIdStep from './pages/Auth/SignUp/StudentIdStep';
import TermStep from './pages/Auth/SignUp/TermStep';
import UniversityStep from './pages/Auth/SignUp/UniversityStep';
import ChatListPage from './pages/Chat';
import ChatRoom from './pages/Chat/ChatRoom';
import ClubDetail from './pages/ClubDetail';
import ClubList from './pages/ClubList';
import ClubSearch from './pages/ClubSearch';
import CouncilDetail from './pages/CouncilDetail';
import CouncilNotice from './pages/CouncilNotice';
import ApplicationPage from './pages/Club/Application';
import ApplyCompletePage from './pages/Club/Application/applyCompletePage';
import ClubFeePage from './pages/Club/Application/clubFeePage';
import ClubDetail from './pages/Club/ClubDetail';
import ClubList from './pages/Club/ClubList';
import ClubSearch from './pages/Club/ClubSearch';
import CouncilDetail from './pages/Council/CouncilDetail';
import CouncilNotice from './pages/Council/CouncilNotice';
import Home from './pages/Home';
import LicensePage from './pages/legal/LicensePage';
import MarketingPolicyPage from './pages/legal/MarketingPolicyPage';
import PrivacyPolicyPage from './pages/legal/PrivacyPolicyPage';
import TermsPage from './pages/legal/TermsPage';
import Login from './pages/Login';
import MyPage from './pages/MyPage';
import Profile from './pages/Profile';
import FinishStep from './pages/SignUp/FinishStep';
import NameStep from './pages/SignUp/NameStep';
import StudentIdStep from './pages/SignUp/StudentIdStep';
import TermStep from './pages/SignUp/TermStep';
import UniversityStep from './pages/SignUp/UniversityStep';
import MyPage from './pages/User/MyPage';
import Profile from './pages/User/Profile';

function App() {
return (
<BrowserRouter>
<Routes>
<Route element={<AuthLayout />}>
<Route element={<Layout contentClassName="bg-indigo-0" />}>
<Route path="/" element={<Login />} />
<Route path="/signup">
<Route path="signup">
<Route index element={<TermStep />} />
<Route path="university" element={<UniversityStep />} />
<Route path="student-id" element={<StudentIdStep />} />
<Route path="studentid" element={<StudentIdStep />} />
<Route path="name" element={<NameStep />} />
<Route path="finish" element={<FinishStep />} />
</Route>
</Route>
<Route element={<HomeLayout />}>
<Route path="/home" element={<Home />} />
<Route path="/me" element={<MyPage />} />
<Route path="/council">
<Route element={<Layout showBottomNav />}>
<Route path="home" element={<Home />} />
<Route path="me" element={<MyPage />} />
<Route path="council">
<Route index element={<CouncilDetail />} />
<Route path="notice/:noticeId" element={<CouncilNotice />} />
</Route>
</Route>
<Route element={<AppLayout />}>
<Route element={<Layout />}>
<Route path="profile" element={<Profile />} />
<Route path="legal">
<Route path="oss" element={<LicensePage />} />
<Route path="terms" element={<TermsPage />} />
<Route path="privacy" element={<PrivacyPolicyPage />} />
<Route path="marketing" element={<MarketingPolicyPage />} />
</Route>
<Route path="/clubs">
<Route path="clubs">
<Route index element={<ClubList />} />
<Route path="search" element={<ClubSearch />} />
<Route path=":clubId" element={<ClubDetail />} />
<Route path=":clubId/applications" element={<ApplicationPage />} />
<Route path=":clubId/fee" element={<ClubFeePage />} />
<Route path=":clubId/finish" element={<ApplyFinishPage />} />
<Route path=":clubId/complete" element={<ApplyCompletePage />} />
</Route>
<Route path="chats">
<Route index element={<ChatListPage />} />
Expand Down
10 changes: 5 additions & 5 deletions src/apis/auth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,37 @@ import { apiClient } from '../client';
import type { ModifyMyInfoRequest, MyInfoResponse, SignupRequest } from './entity';

export const signup = async (data: SignupRequest) => {
const response = await apiClient.post('/users/signup', {
const response = await apiClient.post('users/signup', {
body: data,
requiresAuth: true,
});
return response;
};

export const getMyInfo = async () => {
const response = await apiClient.get<MyInfoResponse>('/users/me', {
const response = await apiClient.get<MyInfoResponse>('users/me', {
requiresAuth: true,
});
return response;
};

export const logout = async () => {
const response = await apiClient.post('/users/logout', {
const response = await apiClient.post('users/logout', {
requiresAuth: true,
});
return response;
};

export const putMyInfo = async (data: ModifyMyInfoRequest) => {
const response = await apiClient.put('/users/me', {
const response = await apiClient.put('users/me', {
body: data,
requiresAuth: true,
});
return response;
};

export const deleteMyAccount = async () => {
const response = await apiClient.delete('/users/withdraw', {
const response = await apiClient.delete('users/withdraw', {
Comment on lines +5 to +35
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar to the chats endpoints, the API paths have been changed to remove the leading slash. This pattern is repeated across multiple endpoints. Verify that this is intentional and consistent with the apiClient's base URL configuration to avoid broken API calls.

Copilot uses AI. Check for mistakes.
requiresAuth: true,
});
return response;
Expand Down
8 changes: 4 additions & 4 deletions src/apis/chat/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,22 @@ import type {
} from './entity';

export const getChatRooms = async () => {
const response = await apiClient.get<ChatRoomsResponse>('/chats/rooms', {
const response = await apiClient.get<ChatRoomsResponse>('chats/rooms', {
Copy link

Copilot AI Dec 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The API paths have been changed to remove the leading slash (e.g., '/chats/rooms' to 'chats/rooms'). While this might work depending on the apiClient implementation, it's inconsistent with standard URL practices where relative paths typically start with a slash. Ensure this change is intentional and that the apiClient correctly handles paths without leading slashes.

Copilot uses AI. Check for mistakes.
requiresAuth: true,
});
return response;
};

export const postChatRooms = async (clubId: number) => {
const response = await apiClient.post<CreateChatRoomResponse>('/chats/rooms', {
const response = await apiClient.post<CreateChatRoomResponse>('chats/rooms', {
body: { clubId },
requiresAuth: true,
});
return response;
};

export const postChatMessage = async (chatRoomId: number, content: string) => {
const response = await apiClient.post<ChatMessage>(`/chats/rooms/${chatRoomId}/messages`, {
const response = await apiClient.post<ChatMessage>(`chats/rooms/${chatRoomId}/messages`, {
body: { content },
requiresAuth: true,
});
Expand All @@ -32,7 +32,7 @@ export const postChatMessage = async (chatRoomId: number, content: string) => {

export const getChatMessages = async (params: ChatMessageRequestParam) => {
const response = await apiClient.get<ChatMessagesResponse, ChatMessageRequestParam>(
`/chats/rooms/${params.chatRoomId}`,
`chats/rooms/${params.chatRoomId}`,
{ params, requiresAuth: true }
);
return response;
Expand Down
44 changes: 0 additions & 44 deletions src/components/Layout/index.tsx

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Link, useLocation, useNavigate, useParams } from 'react-router-dom';
import ChatCircleIcon from '@/assets/svg/chat-circle.svg';
import ChevronLeftIcon from '@/assets/svg/chevron-left.svg';
import useChat from '@/pages/Chat/hooks/useChat';
import { useMyInfo } from '@/pages/Profile/hooks/useMyInfo';
import { useMyInfo } from '@/pages/User/Profile/hooks/useMyInfo';
import { ROUTE_TITLES } from './routeTitles';

const INFO_HEADER_LIST = ['/home', '/council'];
Expand Down
30 changes: 30 additions & 0 deletions src/components/layout/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { Suspense } from 'react';
import { Outlet } from 'react-router-dom';
import { twMerge } from 'tailwind-merge';
import BottomNav from './BottomNav';
import Header from './Header';

interface LayoutProps {
showBottomNav?: boolean;
contentClassName?: string;
}

export default function Layout({ showBottomNav = false, contentClassName }: LayoutProps) {
return (
<div className="flex min-h-screen flex-col">
<Header />
<Suspense>
<main
className={twMerge(
'bg-background flex flex-1 flex-col overflow-y-auto pt-11',
showBottomNav && 'pb-19',
contentClassName
)}
>
<Outlet />
</main>
</Suspense>
{showBottomNav && <BottomNav />}
</div>
);
}
5 changes: 5 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,13 @@
}

@layer base {
html {
overscroll-behavior: none;
}

body {
position: relative;
overscroll-behavior-y: contain;
}

button {
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useNavigate } from 'react-router-dom';
import CheckInCircleIcon from '@/assets/svg/check-in-circle.svg';
import { useMyInfo } from '../Profile/hooks/useMyInfo';
import { useMyInfo } from '@/pages/User/Profile/hooks/useMyInfo';

function FinishStep() {
const navigate = useNavigate();
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function UniversityStep() {

const handleUniversitySelect = (universityId: string) => () => {
update({ universityId });
navigate('/signup/student-id');
navigate('/signup/studentid');
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useParams } from 'react-router-dom';
import CheckCircleIcon from '@/assets/svg/check-circle.svg';
import { useGetClubDetail } from '../ClubDetail/hooks/useGetClubDetail';

function ApplyFinishPage() {
function ApplyCompletePage() {
const { clubId } = useParams();
const { data: clubDetail } = useGetClubDetail(Number(clubId));

Expand Down Expand Up @@ -30,4 +30,4 @@ function ApplyFinishPage() {
);
}

export default ApplyFinishPage;
export default ApplyCompletePage;
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function ClubFeePage() {
<button
type="button"
className="bg-primary mt-auto w-full rounded-lg py-3.5 text-center text-lg leading-7 font-bold text-white"
onClick={() => navigate(`/clubs/${clubId}/finish`)}
onClick={() => navigate(`/clubs/${clubId}/complete`)}
>
제출하기
</button>
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useParams } from 'react-router-dom';
import AccountInfoCard from '@/pages/Application/components/AccountInfo';
import { useGetClubFee } from '@/pages/Application/hooks/useGetClubFee';
import AccountInfoCard from '../../Application/components/AccountInfo';
import { useGetClubFee } from '../../Application/hooks/useGetClubFee';

function ClubAccount() {
const { clubId } = useParams();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ function ClubDetail() {
setSearchParams({ tab }, { replace: true });
};

if (!clubDetail) {
return <div>잘못된 경로입니다</div>;
}

const tabs: { key: TabType; label: string; show: boolean }[] = [
{ key: 'recruitment', label: '모집', show: clubDetail.recruitment.status !== 'CLOSED' },
{ key: 'intro', label: '소개', show: true },
Expand All @@ -31,10 +35,6 @@ function ClubDetail() {

const visibleTabs = tabs.filter((tab) => tab.show);

if (!clubDetail) {
return <div>잘못된 경로입니다</div>;
}

return (
<>
<div className="fixed right-0 left-0 bg-white shadow-[0_1px_2px_0_rgba(0,0,0,0.04)]">
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useEffect, useRef } from 'react';
import { Link } from 'react-router-dom';
import { useCouncilNotice } from '@/pages/ClubDetail/hooks/useCouncilNotices';
import { useCouncilNotice } from '@/pages/Club/ClubDetail/hooks/useCouncilNotices';

function CouncilNotice() {
const observerRef = useRef<HTMLDivElement>(null);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ export const useGetCouncilNoticeDetail = ({ noticeId }: UseGetCouncilNoticeDetai

return changed ? next : old;
});

queryClient.invalidateQueries({ queryKey: ['myInfo'], refetchType: 'all' });
}, [noticeId, query.data, queryClient]);

return query;
Expand Down
4 changes: 2 additions & 2 deletions src/pages/Home/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Link } from 'react-router-dom';
import CalendarIcon from '@/assets/svg/calendar.svg';
import Card from '@/components/common/Card';
import ClubCard from '../ClubList/components/ClubCard';
import { useGetClubs } from '../ClubList/hooks/useGetClubs';
import ClubCard from '../Club/ClubList/components/ClubCard';
import { useGetClubs } from '../Club/ClubList/hooks/useGetClubs';
import SimpleClubCard from './components/SimpleClubCard';
import { useGetJoinedClubs } from './hooks/useGetJoinedClubs';
import { useGetScheduleList } from './hooks/useGetScheduleList';
Expand Down
File renamed without changes.
File renamed without changes.