-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from lucasheartcliff/develop
Develop
- Loading branch information
Showing
8 changed files
with
342 additions
and
245 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import dynamic from 'next/dynamic'; | ||
import React from 'react'; | ||
import React, { forwardRef } from 'react'; | ||
import type { ScrollbarProps } from 'react-custom-scrollbars-2'; | ||
import { Scrollbars } from 'react-custom-scrollbars-2'; | ||
|
||
const Scrollbars = dynamic(() => import('react-custom-scrollbars-2'), { | ||
ssr: false, | ||
}); | ||
interface Props extends ScrollbarProps { } | ||
|
||
interface Props extends ScrollbarProps {} | ||
function Scroll({ children, ...props }: Props, ref: any) { | ||
return ( | ||
<Scrollbars ref={ref} {...props}> | ||
{children} | ||
</Scrollbars> | ||
); | ||
} | ||
|
||
const Scroll: React.FC<Props> = ({ children, ...props }) => { | ||
return <Scrollbars {...props}>{children}</Scrollbars>; | ||
}; | ||
|
||
export default Scroll; | ||
export default forwardRef(Scroll); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import ArrowUpOutlined from '@ant-design/icons/lib/icons/ArrowUpOutlined'; | ||
import React from 'react'; | ||
|
||
import Icon from '../Icon'; | ||
|
||
const theme = require('../../styles/themes'); | ||
|
||
type Props = { | ||
isVisible: boolean; | ||
scrollToTop: () => void; | ||
}; | ||
const ScrollToTopButton = ({ isVisible, scrollToTop }: Props) => { | ||
return ( | ||
<div | ||
onClick={scrollToTop} | ||
className={`fixed bottom-5 right-5 cursor-pointer rounded-full text-white shadow-lg transition duration-300 ease-in-out md:bottom-7 md:right-7 ${ | ||
isVisible ? '' : 'invisible' | ||
}`} | ||
> | ||
<div> | ||
<Icon color={theme.primary}> | ||
<ArrowUpOutlined /> | ||
</Icon> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default ScrollToTopButton; |
Oops, something went wrong.