Skip to content

Commit

Permalink
feat: SearchSubNavbar에서 검색결과 없으면 스크롤 안함
Browse files Browse the repository at this point in the history
  • Loading branch information
yeolyi committed Mar 27, 2024
1 parent f787636 commit e24176d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions app/[locale]/search/helper/SearchSubNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ export default function SearchSubNavbar({ node }: { node: TreeNode[] }) {
);
}

function SubTab({ node }: { node: TreeNode }) {
const SubTab = ({ node }: { node: TreeNode }) => {
return (
<>
<Link
href={`#nav_${node.name}`}
className={`text-sm ${node.bold ? 'font-bold text-main-orange' : 'text-neutral-700'}`}
className={`text-sm ${node.bold ? 'font-bold text-main-orange' : 'text-neutral-700'} ${
node.size === undefined || node.size === 0 ? 'pointer-events-none' : ''
}`}
style={{ marginLeft: INDENTATION }}
>
{node.name}
Expand All @@ -47,7 +49,9 @@ function SubTab({ node }: { node: TreeNode }) {
{node.children?.map((childNode, idx) => (
<Link
href={`#nav_${childNode.name}`}
className={`text-sm text-neutral-700`}
className={`text-sm text-neutral-700 ${
childNode.size === undefined || childNode.size === 0 ? 'pointer-events-none' : ''
}`}
key={idx}
style={{ marginLeft: INDENTATION * 2 }}
>
Expand All @@ -57,4 +61,4 @@ function SubTab({ node }: { node: TreeNode }) {
))}
</>
);
}
};

0 comments on commit e24176d

Please sign in to comment.