Skip to content

Commit 1dd0de7

Browse files
committed
fix: hide back button on first artwork of art quiz (#12845)
1 parent 0a74e5c commit 1dd0de7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/app/Scenes/ArtQuiz/ArtQuizArtworks.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ import { FancySwiper, FancySwiperArtworkCard } from "app/Components/FancySwiper/
1010
import { usePopoverMessage } from "app/Components/PopoverMessage/popoverMessageHooks"
1111
import { ArtQuizLoader } from "app/Scenes/ArtQuiz/ArtQuizLoader"
1212
import { GlobalStore } from "app/store/GlobalStore"
13-
import { goBack, navigate } from "app/system/navigation/navigate"
13+
// eslint-disable-next-line no-restricted-imports
14+
import { navigate } from "app/system/navigation/navigate"
1415
import { extractNodes } from "app/utils/extractNodes"
1516
import { isEmpty } from "lodash"
1617
import { Suspense, useEffect, useMemo, useState } from "react"
@@ -106,9 +107,7 @@ const ArtQuizArtworksScreen = () => {
106107

107108
const handleOnBack = () => {
108109
popoverMessage.hide()
109-
if (activeCardIndex === 0) {
110-
goBack()
111-
} else {
110+
if (activeCardIndex !== 0) {
112111
const previousArtwork = artworks[activeCardIndex - 1]
113112

114113
setActiveCardIndex(activeCardIndex - 1)
@@ -169,6 +168,7 @@ const ArtQuizArtworksScreen = () => {
169168
<Screen>
170169
<Screen.Header
171170
onBack={handleOnBack}
171+
hideLeftElements={activeCardIndex === 0}
172172
title={`${activeCardIndex + 1}/${artworks.length}`}
173173
rightElements={
174174
<Touchable accessibilityRole="button" haptic="impactLight" onPress={handleOnSkip}>

0 commit comments

Comments
 (0)