u
This commit is contained in:
1 parent
6849579652
commit
d60be4a75b
24 files changed
+463
-179
No files matched your search
@@ -1,7 +1,7 @@
|
||||
import { Ionicons } from '@expo/vector-icons'
|
||||
import { usePathname, useRouter } from 'expo-router'
|
||||
import { Image, Pressable, ScrollView, Text, View } from 'react-native'
|
||||
import Animated, { SlideInRight } from 'react-native-reanimated'
|
||||
import { Image, Pressable, Text, View } from 'react-native'
|
||||
import Animated, { SlideInLeft, SlideInRight } from 'react-native-reanimated'
|
||||
import { SafeAreaView } from 'react-native-safe-area-context'
|
||||
|
||||
export interface StepLayoutItem {
|
||||
@@ -31,11 +31,13 @@ export default function StepLayout({ steps, children, showHearder = true }: Step
|
||||
// 是否显示header
|
||||
const headerVisible = showHearder !== false && currentStep.showHearder !== false
|
||||
|
||||
const enteringAnimation = canGoBack ? SlideInRight.duration(300) : SlideInLeft.duration(300)
|
||||
|
||||
return (
|
||||
<SafeAreaView style={{ flex: 1 }}>
|
||||
<Animated.View
|
||||
key={pathname}
|
||||
entering={SlideInRight.duration(300)}
|
||||
entering={enteringAnimation}
|
||||
style={{ flex: 1 }}
|
||||
>
|
||||
{headerVisible && (
|
||||
@@ -44,10 +46,7 @@ export default function StepLayout({ steps, children, showHearder = true }: Step
|
||||
onPress={canGoBack ? (currentStep.onBack ?? (() => router.back())) : undefined}
|
||||
style={{ opacity: canGoBack ? 1 : 0 }}
|
||||
>
|
||||
<Ionicons
|
||||
name="arrow-back"
|
||||
size={22}
|
||||
/>
|
||||
<Ionicons name="arrow-back" size={22} />
|
||||
</Pressable>
|
||||
|
||||
<Text className="flex-1 text-center text-lg font-semibold">
|
||||
|
||||
Reference in new issue
Block a user