Fakultas Ilmu Komputer UI

Commit 64b6028f authored by Ahmad Izzudin Alifyandra's avatar Ahmad Izzudin Alifyandra
Browse files

Merge branch 'navigation-ecosystem' into 'PBI-13-Create_Ecosystem_Page'

Fix: Navigation ecosystem

See merge request !88
parents 5d70c22e dae99f25
Pipeline #86226 passed with stage
in 17 minutes and 59 seconds
import { TypedUseSelectorHook, useDispatch, useSelector } from "react-redux";
import type { RootState, AppDispatch } from "../redux/store";
import { IUser } from "../types/firestore/User";
// Use throughout your app instead of plain `useDispatch` and `useSelector`
export const useAppDispatch = () => useDispatch<AppDispatch>();
export const useAppSelector: TypedUseSelectorHook<RootState> = useSelector;
export const useUser = () => useAppSelector((state) => state.user);
export const useUser = (): IUser => useAppSelector((state) => state.user);
......@@ -4,11 +4,11 @@ import BusinessEcosystemScreen from "../screens/ecosystem/BusinessEcosystemScree
import { EcosystemStackParamList } from "../types/navigation/EcosystemStack";
import {
BusinessCategoryScreen,
UserListScreen,
EcosystemDetailScreen,
EcosystemListScreen,
EcosystemMapScreen,
RecommendedEcosystemScreen,
UserListScreen,
} from "../screens/ecosystem";
const EcosystemStack = createNativeStackNavigator<EcosystemStackParamList>();
......
......@@ -33,7 +33,13 @@ const BusinessEcosystemScreen = () => {
<View>
<TouchableOpacity
onPress={() => {
nav.navigate("Ecosystem", { screen: "MyEcosystem" });
nav.navigate("Ecosystem", {
screen: "Recommended",
params: {
headerTitle: "Ekosistem Saya",
toFetch: "myEcosystem",
},
});
}}
>
<Text style={styles.link}>Ekosistem Saya</Text>
......@@ -65,7 +71,13 @@ const BusinessEcosystemScreen = () => {
<View>
<TouchableOpacity
onPress={() => {
nav.navigate("Ecosystem", { screen: "Popular" });
nav.navigate("Ecosystem", {
screen: "Recommended",
params: {
headerTitle: "Paling Populer",
toFetch: "popular",
},
});
}}
>
<Text style={styles.link}>Paling Populer</Text>
......@@ -75,7 +87,13 @@ const BusinessEcosystemScreen = () => {
<View>
<TouchableOpacity
onPress={() => {
nav.navigate("Ecosystem", { screen: "Latest" });
nav.navigate("Ecosystem", {
screen: "Recommended",
params: {
headerTitle: "Terbaru Minggu Ini",
toFetch: "mostRecent",
},
});
}}
>
<Text style={styles.link}>Terbaru Minggu Ini</Text>
......
import * as React from "react";
import { Alert, StyleSheet } from "react-native";
import { StyleSheet } from "react-native";
import { Text, View } from "../../components/Themed";
import Colors from "../../constants/Colors";
import { EcosystemStackScreenProps } from "../../types/navigation";
import { LogBox } from "react-native";
const RecommendedEcosystemScreen = ({
route,
}: EcosystemStackScreenProps<"Recommended">) => {
const { toFetch } = route.params;
switch (toFetch) {
case "popular":
break;
case "myEcosystem":
break;
case "mostRecent":
break;
case "joined":
break;
default:
break;
}
LogBox.ignoreLogs([
"Non-serializable values were found in the navigation state",
]);
return (
<View style={styles.container}>
<View>
<Text onPress={() => Alert.alert(toFetch)}>
Layar Rekomendasi Ekosistem
</Text>
<Text>Layar Rekomendasi Ekosistem</Text>
</View>
</View>
);
......
......@@ -7,7 +7,7 @@ const UserListScreen = () => {
return (
<View style={styles.container}>
<View>
<Text>Layar List Bisnis</Text>
<Text>Layar List User</Text>
</View>
</View>
);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment