Fakultas Ilmu Komputer UI

EcosystemStackNavigator.tsx 2.05 KB
Newer Older
1
2
3
4
5
6
7
8
9
import { createNativeStackNavigator } from "@react-navigation/native-stack";
import React from "react";
import BusinessEcosystemScreen from "../screens/ecosystem/BusinessEcosystemScreen";
import { EcosystemStackParamList } from "../types/navigation/EcosystemStack";
import {
  BusinessCategoryScreen,
  EcosystemDetailScreen,
  EcosystemListScreen,
  EcosystemMapScreen,
10
  RecommendedEcosystemScreen,
11
  UserListScreen,
12
13
14
15
16
17
18
19
20
21
22
23
24
} from "../screens/ecosystem";

const EcosystemStack = createNativeStackNavigator<EcosystemStackParamList>();

const EcosystemStackNavigator = () => {
  return (
    <EcosystemStack.Navigator initialRouteName="BusinessEcosystem">
      <EcosystemStack.Screen
        name="BusinessEcosystem"
        component={BusinessEcosystemScreen}
        options={{ headerShown: false }}
      />
      <EcosystemStack.Screen
25
26
27
28
29
30
        name="Recommended"
        component={RecommendedEcosystemScreen}
        initialParams={{
          headerTitle: "",
        }}
        options={({ route }) => ({ title: route.params.headerTitle })}
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
      />
      <EcosystemStack.Screen
        name="BusinessCategory"
        component={BusinessCategoryScreen}
        options={{ title: "Kategori Bisnis" }}
      />
      <EcosystemStack.Screen
        name="EcosystemList"
        component={EcosystemListScreen}
        initialParams={{ headerTitle: "" }}
        options={({ route }) => ({ title: route.params.headerTitle })}
      />
      <EcosystemStack.Screen
        name="EcosystemDetails"
        component={EcosystemDetailScreen}
        initialParams={{ headerTitle: "" }}
        options={({ route }) => ({ title: route.params.headerTitle })}
      />
      <EcosystemStack.Screen
        name="EcosystemMap"
        component={EcosystemMapScreen}
        options={{ title: "Peta Ekosistem" }}
      />
      <EcosystemStack.Screen
55
56
        name="UserList"
        component={UserListScreen}
57
58
59
60
61
62
63
64
        initialParams={{ headerTitle: "" }}
        options={({ route }) => ({ title: route.params.headerTitle })}
      />
    </EcosystemStack.Navigator>
  );
};

export default EcosystemStackNavigator;