diff --git a/client/src/components/main/TagRanking/TagRankingItem/TagRankingItem.tsx b/client/src/components/main/TagRanking/TagRankingItem/TagRankingItem.tsx index 2ad474bc..6f278835 100644 --- a/client/src/components/main/TagRanking/TagRankingItem/TagRankingItem.tsx +++ b/client/src/components/main/TagRanking/TagRankingItem/TagRankingItem.tsx @@ -1,4 +1,5 @@ import React, { useCallback } from "react"; +import { useNavigate } from "react-router-dom"; import HorizontalRuleIcon from "@mui/icons-material/HorizontalRule"; import ArrowUpwardIcon from "@mui/icons-material/ArrowUpward"; import ArrowDownwardIcon from "@mui/icons-material/ArrowDownward"; @@ -19,8 +20,10 @@ const TagRankingItem = ({ tagInfo }: PopularTagBoxProps): JSX.Element => { const [searchDefaultFilter] = useSearchStore((state) => [ state.searchDefaultFilter, ]); + const navigate = useNavigate(); const handleItemClick = useCallback((): void => { searchDefaultFilter({ tags: [tagInfo.name], lastId: "-1" }); + navigate("/"); }, []); return ( diff --git a/client/src/styles/_mixin.scss b/client/src/styles/_mixin.scss index 3bddb140..c282fa56 100644 --- a/client/src/styles/_mixin.scss +++ b/client/src/styles/_mixin.scss @@ -22,7 +22,7 @@ width: $line-width; height: 100%; overflow-x: hidden; - overflow-y: auto; + overflow-y: hidden; font-family: D2Coding, "D2 coding", monospace; color: $weview-white; text-align: end; diff --git a/client/src/utils/code.ts b/client/src/utils/code.ts index 7fb6e70b..bef76e1c 100644 --- a/client/src/utils/code.ts +++ b/client/src/utils/code.ts @@ -21,8 +21,10 @@ export const chunkHTML = (htmlData: string[]): string[][] => { export const wrapHTML = (chunkedHTML: string[][]): string => chunkedHTML - .map( - (arr, idx) => - `
${arr.join("\n")}
` - ) + .map((arr, idx) => { + return `
${arr + // 배열의 마지막 원소가 빈 문자열일 때 join하면 개행이 사라지므로 이를 확인하여 추가 + .map((item, idx2) => (item === "" && idx2 === 14 ? "
" : item)) + .join("\n")}
`; + }) .join("");