diff --git a/src/components/RootLayout.tsx b/src/components/RootLayout.tsx
index f3d0654..fb48f2a 100644
--- a/src/components/RootLayout.tsx
+++ b/src/components/RootLayout.tsx
@@ -3,10 +3,10 @@ import { Outlet, useLocation } from 'react-router-dom';
const RootLayout = () => {
const location = useLocation();
- const isFooterHidden = location.pathname.startsWith('/chatroom');
+ const isFooterHidden = location.pathname === '/' || location.pathname.startsWith('/chatroom');
return (
-
+
{!isFooterHidden && }
diff --git a/src/components/common/Footer.tsx b/src/components/common/Footer.tsx
index 6839e29..78b255b 100644
--- a/src/components/common/Footer.tsx
+++ b/src/components/common/Footer.tsx
@@ -27,7 +27,7 @@ interface FooterProps {
const menuItems = [
{
- path: '/',
+ path: '/main',
label: '홈',
icon: HomeIcon,
activeIcon: HomeIconClicked,
@@ -54,7 +54,7 @@ const menuItems = [
const Footer = ({ maxWidth = '425px' }: FooterProps) => {
const navigate = useNavigate();
- const [value, setValue] = useState('/');
+ const [value, setValue] = useState('/main');
const [hoveredPath, setHoveredPath] = useState(null);
const handleNavigation = (newValue: string) => {
setValue(newValue);
diff --git a/src/constants/routes.ts b/src/constants/routes.ts
index 00af7be..befa634 100644
--- a/src/constants/routes.ts
+++ b/src/constants/routes.ts
@@ -1,6 +1,6 @@
export const ROUTES = {
ROOT: '/',
- MAIN: '',
+ MAIN: '/main',
CHAT: '/chat',
MYPAGE: '/mypage',
LANDING: '/landing',
diff --git a/src/pages/Error/index.tsx b/src/pages/Error/index.tsx
index f1169bd..50d063f 100644
--- a/src/pages/Error/index.tsx
+++ b/src/pages/Error/index.tsx
@@ -8,7 +8,7 @@ const ErrorPage = () => {
const navigate = useNavigate();
const handleHomeClick = () => {
- navigate('/');
+ navigate('/main');
};
return (
diff --git a/src/pages/Event/index.tsx b/src/pages/Event/index.tsx
index 30ff50d..25d0c6f 100644
--- a/src/pages/Event/index.tsx
+++ b/src/pages/Event/index.tsx
@@ -28,12 +28,12 @@ const EventPage = () => {
console.log(
`답변: ${answer}\n공개 여부: ${isPrivate ? '비공개' : '공개'}\n이미지: ${uploadedImage ? uploadedImage.name : '없음'}`
);
- navigate('/');
+ navigate('/main');
};
return (
<>
-
+
Special Question
다가오는 크리스마스, 주연님의 크리스마스 계획은?
diff --git a/src/pages/Landing/index.tsx b/src/pages/Landing/index.tsx
index 31bafd5..f56f360 100644
--- a/src/pages/Landing/index.tsx
+++ b/src/pages/Landing/index.tsx
@@ -1,10 +1,20 @@
import { Logo } from '@/components/ui/Logo/Logo';
import { STYLE } from '@/pages/Landing/Constants/style';
import { Container, LogoWrapper, SubTitle, Title } from '@/pages/Landing/styles';
+import { useEffect } from 'react';
import { useNavigate } from 'react-router';
const LandingPage = () => {
const navigate = useNavigate();
+ useEffect(() => {
+ // 3초 후에 로그인 페이지로 자동 이동
+ const timer = setTimeout(() => {
+ navigate('/login');
+ }, 1000);
+
+ // 컴포넌트가 언마운트될 때 타이머 정리
+ return () => clearTimeout(timer);
+ }, []);
const handleClick = () => {
navigate('/login');
};
diff --git a/src/pages/MyPage/components/Header/Header.tsx b/src/pages/MyPage/components/Header/Header.tsx
index ef3c77e..c49671a 100644
--- a/src/pages/MyPage/components/Header/Header.tsx
+++ b/src/pages/MyPage/components/Header/Header.tsx
@@ -7,7 +7,7 @@ import {
Title,
RightSection,
IconButton,
-} from '@/pages/MyPage/components/Header/Header.styles'
+} from '@/pages/MyPage/components/Header/Header.styles';
interface HeaderProps {
profileImage?: string;
@@ -19,7 +19,7 @@ const Header = ({ className, title }: HeaderProps) => {
const navigate = useNavigate();
const onLogoClick = () => {
- navigate('/');
+ navigate('/main');
};
const handleNotificationClick = () => {
diff --git a/src/pages/QSpace/hooks/Query/useGroupList.ts b/src/pages/QSpace/hooks/Query/useGroupList.ts
index d032eca..aee830f 100644
--- a/src/pages/QSpace/hooks/Query/useGroupList.ts
+++ b/src/pages/QSpace/hooks/Query/useGroupList.ts
@@ -1,9 +1,10 @@
+import { GROUP_KEYS } from '@/api/queryKeys';
import { fetchGroups } from '@/pages/QSpace/api/fetchGroups';
import { useQuery } from '@tanstack/react-query';
export const useGroups = (categoryId: number) => {
return useQuery({
- queryKey: ['groups', 'list', categoryId] as const,
+ queryKey: [GROUP_KEYS.ROOT, GROUP_KEYS.ACTIONS.LIST, categoryId] as const,
queryFn: () => fetchGroups(categoryId),
enabled: categoryId !== undefined,
staleTime: 0,
diff --git a/src/pages/QSpace/hooks/Query/useMemberList.ts b/src/pages/QSpace/hooks/Query/useMemberList.ts
index 32f5bc1..b2ba554 100644
--- a/src/pages/QSpace/hooks/Query/useMemberList.ts
+++ b/src/pages/QSpace/hooks/Query/useMemberList.ts
@@ -5,7 +5,7 @@ import { groupAPI } from '@/pages/QSpace/api/groupAPI';
export const useMemberList = (groupId: number) => {
return useQuery({
- queryKey: [GROUP_KEYS.ROOT, groupId, 'members'],
+ queryKey: [GROUP_KEYS.ROOT, GROUP_KEYS.ACTIONS.MEMBERS, groupId],
queryFn: async () => {
const response = await groupAPI.getGroupMembers(groupId);
if (!response.success || !response.data) {
diff --git a/src/pages/Question/index.tsx b/src/pages/Question/index.tsx
index af497d7..058d988 100644
--- a/src/pages/Question/index.tsx
+++ b/src/pages/Question/index.tsx
@@ -26,8 +26,11 @@ const QuestionPage = () => {
const [isPrivate, setIsPrivate] = useState(true);
const [uploadedImage, setUploadedImage] = useState(null);
- const { data: question, isLoading: loadingQuestion, error: questionError } =
- useQuestions(categoryIdMap[category as string]);
+ const {
+ data: question,
+ isLoading: loadingQuestion,
+ error: questionError,
+ } = useQuestions(categoryIdMap[category as string]);
const { mutate: createAnswer, error: isCreateAnswerError } = useCreateAnswer();
const handleImageUpload = (file: File | null) => {
@@ -36,7 +39,8 @@ const QuestionPage = () => {
const handleSubmit = () => {
console.log(
- `답변: ${answer}\n공개 여부: ${isPrivate ? '비공개' : '공개'}\n이미지: ${uploadedImage ? uploadedImage.name : '없음'
+ `답변: ${answer}\n공개 여부: ${isPrivate ? '비공개' : '공개'}\n이미지: ${
+ uploadedImage ? uploadedImage.name : '없음'
}`
);
@@ -50,7 +54,7 @@ const QuestionPage = () => {
createAnswer(createAnswerRequest, {
onSuccess: (data: CreateAnswerResponse) => {
console.log('Answer created:', data.message);
- navigate('/');
+ navigate('/main');
},
onError: (err) => {
console.error('Error creating answer:', err);
@@ -100,9 +104,7 @@ const QuestionPage = () => {
const PageLayout = ({ children }: { children: React.ReactNode }) => (
<>
-
- {children}
-
+ {children}
>
);
diff --git a/src/router/index.tsx b/src/router/index.tsx
index e7c7bde..b791fcb 100644
--- a/src/router/index.tsx
+++ b/src/router/index.tsx
@@ -48,7 +48,7 @@ const router = createBrowserRouter([
element: ,
},
{
- path: ROUTES.LANDING, //랜딩페이지
+ path: ROUTES.ROOT, //랜딩페이지
element: ,
},
{
diff --git a/src/utils/cookies.ts b/src/utils/cookies.ts
index 246e0a2..3ba5aa7 100644
--- a/src/utils/cookies.ts
+++ b/src/utils/cookies.ts
@@ -8,7 +8,7 @@ interface CookieOptions {
}
const defaultOptions: CookieOptions = {
- path: '/',
+ path: '/main',
secure: process.env.NODE_ENV === 'production',
sameSite: 'strict',
};