Files
DefectingCat 142be807ec Update loading progress
* remove nprogress
* fix loading issue

Add absolute import path aliases
* optimization imports

Add fallback on navbar image

Fix post images zoom wrapper as button

Fix module.css import error
* add router prefetch to post page

Add paging prefetch
* add post comment component
2021-12-02 03:50:02 +00:00

40 lines
901 B
TypeScript

import useGetColors from 'lib/hooks/useGetColors';
import { FC } from 'react';
import { Flex, Fade } from '@chakra-ui/react';
import UseAnimations from 'react-useanimations';
import arrowUp from 'react-useanimations/lib/arrowUp';
interface Props {
showBacktop: boolean;
backToTop: () => void;
}
const BackToTop: FC<Props> = ({ showBacktop, backToTop }) => {
const { boxBg } = useGetColors();
return (
<>
<Fade in={showBacktop}>
<Flex
bg={boxBg}
w="40px"
h="40px"
justify="center"
alignItems="center"
rounded="full"
shadow="card"
position="fixed"
bottom="50px"
right="100px"
onClick={backToTop}
cursor="pointer"
>
<UseAnimations size={32} animation={arrowUp} />
</Flex>
</Fade>
</>
);
};
export default BackToTop;