Skip to content

Commit 3222913

Browse files
committed
fix: Fix project scroll on mobile
1 parent a27cf72 commit 3222913

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/components/Home/ProjectSection.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import { useCallback, useMemo } from 'react';
33
import { useTranslation } from 'react-i18next';
44

55
import useFetchGitHubRepoInfo from '@/hooks/useFetchGitHubRepoInfo';
6-
import useIsDesktop from '@/hooks/useIsDesktop';
76
import useSeamlessScroll from '@/hooks/useSeamlessScroll';
87

98
import coreLibraryPreview from '../../assets/images/LandingPage/ProjectPreviews/core_library.webp';
@@ -22,7 +21,6 @@ export const ProjectSection = (): JSX.Element => {
2221
// lazy loads translations
2322
const { t } = useTranslation('components/home');
2423

25-
const isDesktop = useIsDesktop();
2624
const theme = useTheme();
2725
const isDark = theme.palette.mode === 'dark';
2826
const gradientColor = isDark ? '9,9,11' : '237,237,237';
@@ -52,7 +50,8 @@ export const ProjectSection = (): JSX.Element => {
5250
}, [projects]);
5351

5452
// initialize seamless scroll hook
55-
const scrollSpeed = isDesktop ? 0.05 : 0.3;
53+
// note: speed value 0.05 and below seems to break on mobile
54+
const scrollSpeed = 0.06;
5655
const { containerRef, handlers } = useSeamlessScroll(scrollSpeed, loopedProjects.length);
5756

5857
// generate unique keys for each card

0 commit comments

Comments
 (0)