Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed "Scroll to Top" Button Visibility in Light and Dark Modes #454

Merged
merged 1 commit into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions src/components/shared/ScrollUp.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,17 @@ const ScrollToTopButton = () => {
};

return (
<div
className={`fixed bottom-5 right-5 z-50 ${isVisible ? 'block' : 'hidden'}`}
>
<Button
className="scroll-top-button bg-black dark:bg-secondary text-white p-2 rounded-full opacity-75 hover:opacity-100"
onClick={goToTop}
variant={"secondary"}
>
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="white" className="arrow">
<path d="M440-160v-487L216-423l-56-57 320-320 320 320-56 57-224-224v487h-80Z" />
</svg>
</Button>
</div>
<div className={`fixed bottom-5 right-5 z-50 ${isVisible ? 'block' : 'hidden'}`}>
<Button
className="scroll-top-button bg-black dark:bg-secondary text-white p-2 rounded-full opacity-75 hover:opacity-90 hover:bg-gray-800 dark:hover:bg-gray-700"
onClick={goToTop}
variant={"secondary"}
>
<svg xmlns="http://www.w3.org/2000/svg" height="24px" viewBox="0 -960 960 960" width="24px" fill="white" className="arrow">
<path d="M440-160v-487L216-423l-56-57 320-320 320 320-56 57-224-224v487h-80Z" />
</svg>
</Button>
</div>
);
};

Expand Down
Loading