Implement react-intersection-observer to facilitate infinite scroll

Uses react-intersection-observer to load more comments when the last of the previously loaded comments is in the viewport.
This commit is contained in:
Aaron William Po
2023-04-09 18:41:58 -04:00
parent 8981bcb4b8
commit 915adb722a
12 changed files with 157 additions and 109 deletions

View File

@@ -6,8 +6,8 @@ interface SpinnerProps {
const Spinner: FC<SpinnerProps> = ({ size = 'md' }) => {
const spinnerWidths: Record<NonNullable<SpinnerProps['size']>, `w-[${number}px]`> = {
xs: 'w-[10px]',
sm: 'w-[20px]',
xs: 'w-[45px]',
sm: 'w-[60px]',
md: 'w-[100px]',
lg: 'w-[150px]',
xl: 'w-[200px]',