Skip to content

Commit

Permalink
Simplify condition
Browse files Browse the repository at this point in the history
Co-authored-by: liam <[email protected]>
  • Loading branch information
39bytes and terror authored Jul 4, 2023
1 parent 037f643 commit a030a81
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/components/JumpToTopButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export const JumpToTopButton = () => {
const [visible, setVisible] = useState(false);

const toggleVisible = () =>
window.scrollY > 300 ? setVisible(true) : setVisible(false);
setVisible(window.scrollY > 300);

const scrollToTop = () => {
window.scrollTo({
Expand Down

0 comments on commit a030a81

Please sign in to comment.