Skip to content

Commit

Permalink
smooth scroll
Browse files Browse the repository at this point in the history
  • Loading branch information
rustyjux committed Apr 23, 2024
1 parent 413fe49 commit e432021
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/nextapp/pages/manager/namespaces/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,13 @@ const NamespacesPage: React.FC = () => {
</>
);

const handleSmoothScroll = (targetId) => {
const element = document.getElementById(targetId);
if (element) {
element.scrollIntoView({ behavior: 'smooth' });
}
};

return (
<>
<Head>
Expand Down Expand Up @@ -416,6 +423,7 @@ const NamespacesPage: React.FC = () => {
href={"#generate-config"}
color="bc-link"
textDecor="underline"
onClick={() => handleSmoothScroll('generate-config')}
>template Yaml file</Link>
{' '}to{' '}
<Link
Expand Down

0 comments on commit e432021

Please sign in to comment.