GuideStackNavigator.js 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import {
  2. createStackNavigator,
  3. CardStyleInterpolators,
  4. } from "@react-navigation/stack";
  5. import * as React from "react";
  6. import { useModel } from "flooks";
  7. import Guide1Screen from "../screens/Guide1Screen";
  8. const GuideStack = createStackNavigator();
  9. const config = {
  10. animation: "spring",
  11. config: {
  12. stiffness: 1000,
  13. damping: 500,
  14. mass: 3,
  15. overshootClamping: true,
  16. restDisplacementThreshold: 0.01,
  17. restSpeedThreshold: 0.01,
  18. },
  19. };
  20. export default function GuideStackNavigator() {
  21. const { guideStep } = useModel("userModel");
  22. const initial = React.useMemo(() => {
  23. if (guideStep == 0) {
  24. return "Guide1";
  25. } else {
  26. return "Guide1";
  27. }
  28. }, [guideStep]);
  29. return (
  30. <GuideStack.Navigator
  31. headerMode='none'
  32. screenOptions={{
  33. gestureEnabled: true,
  34. cardStyleInterpolator: CardStyleInterpolators.forHorizontalIOS,
  35. }}
  36. initialRouteName={initial}
  37. >
  38. <GuideStack.Screen name='Guide1' component={Guide1Screen} />
  39. </GuideStack.Navigator>
  40. );
  41. }