Skip to content

Commit

Permalink
mobile test
Browse files Browse the repository at this point in the history
  • Loading branch information
carlgunderson committed Jan 7, 2024
1 parent c23c80c commit b5d6681
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 2 additions & 3 deletions src/components/JobItem/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,11 @@ const Arrow = ({ direction, isDisabled, isFilled, item, onClick }) => {
sx={{
position: 'absolute',
top: direction === 'prev'
? [isIosSafari ? '40px' : '20px', '40px']
? ['20px', '40px']
: 'auto',
bottom: direction === 'next'
? [isIosSafari ? '40px' : '20px', '40px']
? ['20px', '40px']
: 'auto',
pb: isIosSafari ? '12px' : '0',
}}
>
<Fab
Expand Down
12 changes: 6 additions & 6 deletions src/components/Section/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -58,19 +58,19 @@ const Section = () => {
const handleTouchEnd = () => {
if (touchStart - touchEnd > 100) {
// Down
if (activeIdx < jobs.length - 1) {
if (activeIdxRef.current < jobs.length - 1) {
activeIdxRef.current = activeIdxRef.current + 1
// setActiveIdx(activeIdxRef.current)
setActiveIdx(prevIdx => prevIdx + 1)
setActiveIdx(activeIdxRef.current)
// setActiveIdx(prevIdx => prevIdx + 1)
}
}

if (touchStart - touchEnd < -100) {
// Up
if (activeIdx > 0) {
if (activeIdxRef.current > 0) {
activeIdxRef.current = activeIdxRef.current - 1
// setActiveIdx(activeIdxRef.current)
setActiveIdx(prevIdx => prevIdx - 1)
setActiveIdx(activeIdxRef.current)
// setActiveIdx(prevIdx => prevIdx - 1)
}
}
}
Expand Down

0 comments on commit b5d6681

Please sign in to comment.