Skip to content

Commit

Permalink
feat : Add useTopicsQuery hook to TopicCardContainer
Browse files Browse the repository at this point in the history
  • Loading branch information
jiwonh423 committed Jan 14, 2024
1 parent 13da280 commit fed8719
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions frontend/src/components/TopicCardContainer/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { useEffect, useState } from 'react';
import { styled } from 'styled-components';

import useGet from '../../apiHooks/useGet';
import useTopicsQuery from '../../hooks/api/useTopicsQuery';
import useKeyDown from '../../hooks/useKeyDown';
import { TopicCardProps } from '../../types/Topic';
import Box from '../common/Box';
Expand All @@ -25,7 +26,7 @@ function TopicCardContainer({
containerDescription,
routeWhenSeeAll,
}: TopicCardContainerProps) {
const [topics, setTopics] = useState<TopicCardProps[] | null>(null);
const [_, setTopics] = useState<TopicCardProps[] | null>(null);
const { elementRef, onElementKeyDown } = useKeyDown<HTMLSpanElement>();
const { fetchGet } = useGet();

Expand All @@ -38,10 +39,7 @@ function TopicCardContainer({
},
);
};

useEffect(() => {
setTopicsFromServer();
}, []);
const { topics } = useTopicsQuery(url);

return (
<section>
Expand Down

0 comments on commit fed8719

Please sign in to comment.