Skip to content

Commit

Permalink
Update Scroll to top button (#1892)
Browse files Browse the repository at this point in the history
* Update Scroll to top button

* Rearange scroll to top image attributes

---------

Co-authored-by: ani-kalpachka <[email protected]>
  • Loading branch information
ani-kalpachka and ani-kalpachka authored Aug 20, 2024
1 parent e80b677 commit 2df7862
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 4 additions & 0 deletions public/scroll-to-top-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 5 additions & 8 deletions src/components/client/layout/ScrollToTop.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React, { useEffect, useState } from 'react'

import { ArrowCircleUp } from '@mui/icons-material'
import Image from 'next/image'

import { Box } from '@mui/material'

import theme from 'common/theme'

const ScrollToTop = () => {
const scrollToTopButtonPath = '/scroll-to-top-icon.svg'

const [isVisible, setIsVisible] = useState(false)

const toggleVisibility = () => {
Expand Down Expand Up @@ -39,13 +42,7 @@ const ScrollToTop = () => {
bottom: theme.spacing(2),
}}
onClick={scrollToTop}>
<ArrowCircleUp
sx={{
width: theme.spacing(8),
height: theme.spacing(8),
color: theme.palette.primary.main,
}}
/>
<Image src={scrollToTopButtonPath} width={64} height={64} alt="Scroll to top button" />
</Box>
)}
</div>
Expand Down

0 comments on commit 2df7862

Please sign in to comment.