Skip to content

Commit ed4c7fc

Browse files
committed
Fix: 게시글 상세 조회 페이지에서 프로필 클릭 시 라우팅 경로 수정
1 parent c01651f commit ed4c7fc

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

src/pages/Post/PostBase/index.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ const PostBase: React.FC<PostBaseProps> = ({ onClickMenu }) => {
6363
const [activeTab, setActiveTab] = useState<'likes' | 'comments'>('likes'); // activeTab state
6464

6565
const { postId } = useParams<{ postId: string }>();
66-
const userId = getCurrentUserId();
6766

6867
const nav = useNavigate();
6968

@@ -73,13 +72,7 @@ const PostBase: React.FC<PostBaseProps> = ({ onClickMenu }) => {
7372
};
7473

7574
const handleUserClick = () => {
76-
if (post?.isPostWriter) {
77-
// 내 게시물인 경우
78-
nav(`/profile/${userId}`);
79-
} else {
80-
// 다른 유저의 게시물인 경우
81-
nav(`/users/${post?.user.id}`);
82-
}
75+
nav(`/profile/${post?.user.id}`);
8376
};
8477

8578
const contentRef = useRef<HTMLDivElement>(null);

src/pages/Post/PostBase/styles.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ export const UserProfile = styled(LoadingSkeleton)`
8888
}
8989
`;
9090

91-
export const UserName = styled(StyledText)``;
91+
export const UserName = styled(StyledText)`
92+
cursor: pointer;
93+
`;
9294

9395
export const MenuBtn = styled.button`
9496
width: 18px;

0 commit comments

Comments
 (0)