Fakultas Ilmu Komputer UI

Commit 36453194 authored by Abraham Rudolf Brahmana's avatar Abraham Rudolf Brahmana Committed by Bagus Prabowo
Browse files

feat: Recommended screen navigation ecosystem

parent 4e700b18
...@@ -2,18 +2,13 @@ import { createNativeStackNavigator } from "@react-navigation/native-stack"; ...@@ -2,18 +2,13 @@ import { createNativeStackNavigator } from "@react-navigation/native-stack";
import React from "react"; import React from "react";
import BusinessEcosystemScreen from "../screens/ecosystem/BusinessEcosystemScreen"; import BusinessEcosystemScreen from "../screens/ecosystem/BusinessEcosystemScreen";
import { EcosystemStackParamList } from "../types/navigation/EcosystemStack"; import { EcosystemStackParamList } from "../types/navigation/EcosystemStack";
import {
PopularEcosystemScreen,
JoinedEcosystemScreen,
MyEcosystemScreen,
LatestEcosystemScreen,
} from "../screens/ecosystem/recomendation";
import { import {
BusinessCategoryScreen, BusinessCategoryScreen,
BusinessListScreen, BusinessListScreen,
EcosystemDetailScreen, EcosystemDetailScreen,
EcosystemListScreen, EcosystemListScreen,
EcosystemMapScreen, EcosystemMapScreen,
RecommendedEcosystemScreen,
} from "../screens/ecosystem"; } from "../screens/ecosystem";
const EcosystemStack = createNativeStackNavigator<EcosystemStackParamList>(); const EcosystemStack = createNativeStackNavigator<EcosystemStackParamList>();
...@@ -27,24 +22,12 @@ const EcosystemStackNavigator = () => { ...@@ -27,24 +22,12 @@ const EcosystemStackNavigator = () => {
options={{ headerShown: false }} options={{ headerShown: false }}
/> />
<EcosystemStack.Screen <EcosystemStack.Screen
name="MyEcosystem" name="Recommended"
component={MyEcosystemScreen} component={RecommendedEcosystemScreen}
options={{ title: "Ekosistem Saya" }} initialParams={{
/> headerTitle: "",
<EcosystemStack.Screen }}
name="Joined" options={({ route }) => ({ title: route.params.headerTitle })}
component={JoinedEcosystemScreen}
options={{ title: "Sudah Bergabung" }}
/>
<EcosystemStack.Screen
name="Popular"
component={PopularEcosystemScreen}
options={{ title: "Paling Populer" }}
/>
<EcosystemStack.Screen
name="Latest"
component={LatestEcosystemScreen}
options={{ title: "Terbaru Minggu Ini" }}
/> />
<EcosystemStack.Screen <EcosystemStack.Screen
name="BusinessCategory" name="BusinessCategory"
......
...@@ -10,7 +10,6 @@ import { getUser } from "../redux/user/actions"; ...@@ -10,7 +10,6 @@ import { getUser } from "../redux/user/actions";
import LandingScreen from "../screens/auth/LandingScreen"; import LandingScreen from "../screens/auth/LandingScreen";
import firebase from "firebase"; import firebase from "firebase";
import { Alert } from "react-native"; import { Alert } from "react-native";
import CreateBusinessEcosystemScreen from "../screens/CreateBusinessEcosystemScreen";
/** /**
* A root stack navigator is often used for displaying modals on top of all other content. * A root stack navigator is often used for displaying modals on top of all other content.
...@@ -74,11 +73,6 @@ const RootNavigator = () => { ...@@ -74,11 +73,6 @@ const RootNavigator = () => {
component={SuccessChangePasswordScreen} component={SuccessChangePasswordScreen}
options={{ headerShown: false }} options={{ headerShown: false }}
/> />
<RootStack.Screen
name="CreateBusinessEcosystem"
component={CreateBusinessEcosystemScreen}
options={{ title: "" }}
/>
</RootStack.Navigator> </RootStack.Navigator>
) : ( ) : (
<RootStack.Navigator> <RootStack.Navigator>
......
...@@ -27,7 +27,13 @@ const BusinessEcosystemScreen = () => { ...@@ -27,7 +27,13 @@ const BusinessEcosystemScreen = () => {
<View> <View>
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
nav.navigate("Ecosystem", { screen: "MyEcosystem" }); nav.navigate("Ecosystem", {
screen: "Recommended",
params: {
headerTitle: "Ekosistem Saya",
toFetch: "MyEcosystem",
},
});
}} }}
> >
<Text style={styles.link}>Ekosistem Saya</Text> <Text style={styles.link}>Ekosistem Saya</Text>
...@@ -59,7 +65,13 @@ const BusinessEcosystemScreen = () => { ...@@ -59,7 +65,13 @@ const BusinessEcosystemScreen = () => {
<View> <View>
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
nav.navigate("Ecosystem", { screen: "Popular" }); nav.navigate("Ecosystem", {
screen: "Recommended",
params: {
headerTitle: "Paling Populer",
toFetch: "Popular",
},
});
}} }}
> >
<Text style={styles.link}>Paling Populer</Text> <Text style={styles.link}>Paling Populer</Text>
...@@ -69,7 +81,13 @@ const BusinessEcosystemScreen = () => { ...@@ -69,7 +81,13 @@ const BusinessEcosystemScreen = () => {
<View> <View>
<TouchableOpacity <TouchableOpacity
onPress={() => { onPress={() => {
nav.navigate("Ecosystem", { screen: "Latest" }); nav.navigate("Ecosystem", {
screen: "Recommended",
params: {
headerTitle: "Terbaru Minggu Ini",
toFetch: "Latest",
},
});
}} }}
> >
<Text style={styles.link}>Terbaru Minggu Ini</Text> <Text style={styles.link}>Terbaru Minggu Ini</Text>
......
import * as React from "react"; import * as React from "react";
import { StyleSheet } from "react-native"; import { Alert, StyleSheet } from "react-native";
import { Text, View } from "../../../components/Themed"; import { Text, View } from "../../components/Themed";
import Colors from "../../../constants/Colors"; import Colors from "../../constants/Colors";
import { EcosystemStackScreenProps } from "../../types/navigation";
const RecommendedEcosystemScreen = ({
route,
}: EcosystemStackScreenProps<"Recommended">) => {
const { toFetch } = route.params;
const JoinedEcosystemScreen = () => {
return ( return (
<View style={styles.container}> <View style={styles.container}>
<View> <View>
<Text>Layar Ekosistem Sudah Bergabung</Text> <Text onPress={() => Alert.alert(toFetch)}>
Layar Rekomendasi Ekosistem
</Text>
</View> </View>
</View> </View>
); );
...@@ -22,4 +29,4 @@ const styles = StyleSheet.create({ ...@@ -22,4 +29,4 @@ const styles = StyleSheet.create({
}, },
}); });
export default JoinedEcosystemScreen; export default RecommendedEcosystemScreen;
...@@ -3,6 +3,7 @@ import BusinessListScreen from "./BusinessListScreen"; ...@@ -3,6 +3,7 @@ import BusinessListScreen from "./BusinessListScreen";
import EcosystemDetailScreen from "./EcosystemDetailScreen"; import EcosystemDetailScreen from "./EcosystemDetailScreen";
import EcosystemListScreen from "./EcosystemListScreen"; import EcosystemListScreen from "./EcosystemListScreen";
import EcosystemMapScreen from "./EcosystemMapScreen"; import EcosystemMapScreen from "./EcosystemMapScreen";
import RecommendedEcosystemScreen from "./RecommendedEcosystemScreen";
export { export {
BusinessCategoryScreen, BusinessCategoryScreen,
...@@ -10,4 +11,5 @@ export { ...@@ -10,4 +11,5 @@ export {
EcosystemDetailScreen, EcosystemDetailScreen,
EcosystemListScreen, EcosystemListScreen,
EcosystemMapScreen, EcosystemMapScreen,
RecommendedEcosystemScreen,
}; };
import * as React from "react";
import { StyleSheet } from "react-native";
import { Text, View } from "../../../components/Themed";
import Colors from "../../../constants/Colors";
const LatestEcosystemScreen = () => {
return (
<View style={styles.container}>
<View>
<Text>Layar Ekosistem Terbaru</Text>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.background,
paddingHorizontal: 24,
justifyContent: "center",
},
});
export default LatestEcosystemScreen;
import * as React from "react";
import { StyleSheet } from "react-native";
import { Text, View } from "../../../components/Themed";
import Colors from "../../../constants/Colors";
const MyEcosystemScreen = () => {
return (
<View style={styles.container}>
<View>
<Text>Layar Ekosistem Saya</Text>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.background,
paddingHorizontal: 24,
justifyContent: "center",
},
});
export default MyEcosystemScreen;
import * as React from "react";
import { StyleSheet } from "react-native";
import { Text, View } from "../../../components/Themed";
import Colors from "../../../constants/Colors";
const PopularEcosystemScreen = () => {
return (
<View style={styles.container}>
<View>
<Text>Layar Ekosistem Populer</Text>
</View>
</View>
);
};
const styles = StyleSheet.create({
container: {
flex: 1,
backgroundColor: Colors.background,
paddingHorizontal: 24,
justifyContent: "center",
},
});
export default PopularEcosystemScreen;
import JoinedEcosystemScreen from "./JoinedEcosystemScreen";
import MyEcosystemScreen from "./MyEcosystemScreen";
import PopularEcosystemScreen from "./PopularEcosystemScreen";
import LatestEcosystemScreen from "./LatestEcosystemScreen";
export {
PopularEcosystemScreen,
JoinedEcosystemScreen,
MyEcosystemScreen,
LatestEcosystemScreen,
};
...@@ -6,16 +6,13 @@ import { NativeStackScreenProps } from "@react-navigation/native-stack"; ...@@ -6,16 +6,13 @@ import { NativeStackScreenProps } from "@react-navigation/native-stack";
export type EcosystemStackParamList = { export type EcosystemStackParamList = {
BusinessEcosystem: undefined; BusinessEcosystem: undefined;
Joined: undefined;
Popular: undefined;
Latest: undefined;
MyEcosystem: undefined;
CreateEcosystem: undefined; CreateEcosystem: undefined;
BusinessCategory: undefined; BusinessCategory: undefined;
EcosystemList: { headerTitle: string }; EcosystemList: { headerTitle: string };
EcosystemMap: undefined; EcosystemMap: undefined;
BusinessList: { headerTitle: string }; BusinessList: { headerTitle: string };
EcosystemDetails: { headerTitle: string }; EcosystemDetails: { headerTitle: string };
Recommended: { headerTitle: string; toFetch: string };
}; };
export type EcosystemStackScreenProps< export type EcosystemStackScreenProps<
......
Supports Markdown
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