Skip to content

Commit

Permalink
feat: discussionList 클릭 시 상세 페이지로 이동 기능 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
Parkhanyoung committed Sep 20, 2024
1 parent 5d203a2 commit b816db1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ export const DiscussionItemContainer = styled.div`
box-sizing: border-box;
box-shadow: ${(props) => props.theme.boxShadow.shadow04};
border-radius: 2.8rem;
cursor: pointer;
`;

export const BadgeWrapper = styled.div`
Expand Down
18 changes: 10 additions & 8 deletions frontend/src/components/DiscussionList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import * as S from './DiscussionList.styled';
import useDiscussions from '@/hooks/useDiscussions';
import DiscussionListItem from './DiscussionListItem';
import { useState } from 'react';
import { Link } from 'react-router-dom';

export default function DiscussionList() {
const [mission] = useState<string>('all');
Expand All @@ -11,14 +12,15 @@ export default function DiscussionList() {
return (
<S.DiscussionListContainer>
{discussions.map((discussion) => (
<DiscussionListItem
key={discussion.id}
title={discussion.title}
mission={discussion.mission}
hashTags={discussion.hashTags}
member={discussion.member}
commentCount={discussion.commentCount}
/>
<Link key={discussion.id} to={`/discussions/${discussion.id}`}>
<DiscussionListItem
title={discussion.title}
mission={discussion.mission}
hashTags={discussion.hashTags}
member={discussion.member}
commentCount={discussion.commentCount}
/>
</Link>
))}
</S.DiscussionListContainer>
);
Expand Down

0 comments on commit b816db1

Please sign in to comment.