Skip to content

Commit

Permalink
disable swipe when there just one ticket (#2147)
Browse files Browse the repository at this point in the history
if just one ticket it's better to disable swipe
  • Loading branch information
GuySerfaty authored Nov 10, 2024
1 parent 19b9100 commit a8605a7
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,8 @@ export const NewHomeScreen = (): ReactElement => {
);
}

const moreThanOneTicket = tickets.length > 1;

return (
<AppContainer
bg="gray"
Expand All @@ -390,6 +392,7 @@ export const NewHomeScreen = (): ReactElement => {
{!(showPodsList || noPods) && <Spacer h={96} />}
<SwipeViewContainer>
<_SwipableViews
disabled={!moreThanOneTicket}
style={{
padding: `0 ${SCREEN_HORIZONTAL_PADDING - CARD_GAP / 2}px`
}}
Expand Down Expand Up @@ -487,7 +490,7 @@ export const NewHomeScreen = (): ReactElement => {
)}
</ButtonsContainer>
</SwipeViewContainer>
{tickets.length > 1 && (
{moreThanOneTicket && (
<NavigationContainer>
<PageCircleButton
disabled={currentPos === 0}
Expand Down

0 comments on commit a8605a7

Please sign in to comment.