Skip to content

Commit

Permalink
feat: qfeed-85 질문페이지 네비게이션 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Sunami97 committed Dec 2, 2024
1 parent 3bbfbbd commit 6124dc6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/pages/Main/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import CategoryButton from '@/components/ui/CategoryButtons/CategoryButton';
import Header from '@/components/common/Header';
import { QuestionCard } from '@/pages/Main/components/QuestionCard/QuestionCard';
Expand All @@ -22,6 +23,7 @@ import {
import AnswerCard from '@/pages/Main/components/AnswerCard/AnswerCard';

const Main = () => {
const navigate = useNavigate();
const [activeCategory, setActiveCategory] = useState(categories[0]);
const [isDragging, setIsDragging] = useState(false);
const [startX, setStartX] = useState(0);
Expand All @@ -32,6 +34,7 @@ const Main = () => {
if (isSelected) {
setActiveCategory(category);
console.log('Selected category:', category);
navigate(`/question/${category}`);
}
};
const handleLikeComment = (commentId: string, isLiked: boolean, count: number) => {
Expand Down

0 comments on commit 6124dc6

Please sign in to comment.