fix folder
This commit is contained in:
@@ -1,9 +1,8 @@
|
|||||||
|
|
||||||
//app/(application)/(tabs)/_layout.tsx
|
//app/(application)/(tabs)/_layout.tsx
|
||||||
import { MainColor } from "@/constants/color-palet";
|
import { MainColor } from "@/constants/color-palet";
|
||||||
import { Entypo, Ionicons } from "@expo/vector-icons";
|
import { Entypo } from "@expo/vector-icons";
|
||||||
import { router, Tabs } from "expo-router";
|
import { Tabs } from "expo-router";
|
||||||
import { Text, TouchableOpacity } from "react-native";
|
|
||||||
|
|
||||||
export default function TabsLayout() {
|
export default function TabsLayout() {
|
||||||
return (
|
return (
|
||||||
@@ -18,35 +17,6 @@ export default function TabsLayout() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Tabs.Screen name="index" options={{ href: null }} />
|
<Tabs.Screen name="index" options={{ href: null }} />
|
||||||
<Tabs.Screen
|
|
||||||
name="forum"
|
|
||||||
options={{
|
|
||||||
title: "Forum",
|
|
||||||
tabBarIcon: () => (
|
|
||||||
<Entypo name="chat" size={20} color={MainColor.white} />
|
|
||||||
),
|
|
||||||
headerLeft: () => (
|
|
||||||
<Ionicons
|
|
||||||
name="arrow-back"
|
|
||||||
onPress={() => {
|
|
||||||
router.back();
|
|
||||||
}}
|
|
||||||
size={20}
|
|
||||||
color={MainColor.white}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
tabBarButton: () => (
|
|
||||||
<TouchableOpacity
|
|
||||||
onPress={() => {
|
|
||||||
router.navigate("/event");
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Entypo name="chat" size={20} color={MainColor.white} />
|
|
||||||
<Text style={{ color: MainColor.white }}>Event</Text>
|
|
||||||
</TouchableOpacity>
|
|
||||||
),
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<Tabs.Screen
|
<Tabs.Screen
|
||||||
name="katalog"
|
name="katalog"
|
||||||
@@ -66,6 +36,16 @@ export default function TabsLayout() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<Tabs.Screen
|
||||||
|
name="forum/index"
|
||||||
|
options={{
|
||||||
|
title: "Forum",
|
||||||
|
tabBarIcon: () => (
|
||||||
|
<Entypo name="chat" size={20} color={MainColor.white} />
|
||||||
|
),
|
||||||
|
}}
|
||||||
|
/>
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
@@ -2,8 +2,10 @@ import { Text, View } from "react-native";
|
|||||||
|
|
||||||
export default function Forum() {
|
export default function Forum() {
|
||||||
return (
|
return (
|
||||||
<View>
|
<>
|
||||||
<Text>Tabs Forum</Text>
|
<View>
|
||||||
</View>
|
<Text>Forum</Text>
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
30
app/(application)/(home-tabs)/index.tsx
Normal file
30
app/(application)/(home-tabs)/index.tsx
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
import HomeView from "@/screens/Home/HomeView";
|
||||||
|
import { Styles } from "@/styles/global-styles";
|
||||||
|
import { Stack } from "expo-router";
|
||||||
|
import React from "react";
|
||||||
|
import { View } from "react-native";
|
||||||
|
|
||||||
|
export default function Tabs() {
|
||||||
|
// const router = useRouter();
|
||||||
|
// const navigation = useNavigation();
|
||||||
|
// useEffect(() => {
|
||||||
|
// navigation.setOptions({
|
||||||
|
|
||||||
|
// });
|
||||||
|
// }, [navigation]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<View>
|
||||||
|
<Stack.Screen
|
||||||
|
options={{
|
||||||
|
title: "HIPMI",
|
||||||
|
headerStyle: Styles.headerStyle,
|
||||||
|
headerTitleStyle: Styles.headerTitleStyle,
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
<HomeView />
|
||||||
|
</View>
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1,10 +0,0 @@
|
|||||||
//app/(application)/(tabs)/forum/_layout.tsx
|
|
||||||
import { Stack } from "expo-router";
|
|
||||||
|
|
||||||
export default function ForumLayout() {
|
|
||||||
return<>
|
|
||||||
<Stack>
|
|
||||||
<Stack.Screen name="index" options={{ headerShown: false, }} />
|
|
||||||
</Stack>
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
import HomeView from "@/screens/Home/HomeView";
|
|
||||||
import { MainColor } from "@/constants/color-palet";
|
|
||||||
import { Stack } from "expo-router";
|
|
||||||
import React from "react";
|
|
||||||
import { View } from "react-native";
|
|
||||||
|
|
||||||
export default function Tabs() {
|
|
||||||
// const router = useRouter();
|
|
||||||
// const navigation = useNavigation();
|
|
||||||
// useEffect(() => {
|
|
||||||
// navigation.setOptions({
|
|
||||||
|
|
||||||
// });
|
|
||||||
// }, [navigation]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<>
|
|
||||||
<View>
|
|
||||||
<Stack.Screen
|
|
||||||
options={{
|
|
||||||
title: "My home",
|
|
||||||
headerStyle: { backgroundColor: MainColor.darkblue },
|
|
||||||
headerTintColor: "#fff",
|
|
||||||
headerTitleStyle: {
|
|
||||||
fontWeight: "bold",
|
|
||||||
},
|
|
||||||
|
|
||||||
// headerTitle: (props) => <LogoTitle {...props} />,
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
<HomeView />
|
|
||||||
{/* <Text>Home Screen</Text>
|
|
||||||
<Link href={{ pathname: "/(application)/(tabs)/forum" }}>
|
|
||||||
Go to Details
|
|
||||||
</Link> */}
|
|
||||||
</View>
|
|
||||||
</>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -20,18 +20,12 @@ export default function ApplicationLayout() {
|
|||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="(tabs)"
|
name="(home-tabs)"
|
||||||
options={{
|
options={{
|
||||||
headerShown: false,
|
headerShown: false,
|
||||||
// title: "iii",
|
|
||||||
// headerLeft: () => (
|
|
||||||
// <Ionicons name="search" size={20} color={MainColor.white} />
|
|
||||||
// ),
|
|
||||||
// headerRight: () => (
|
|
||||||
// <Ionicons name="notifications" size={20} color={MainColor.white} />
|
|
||||||
// ),
|
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<Stack.Screen
|
<Stack.Screen
|
||||||
name="event/index"
|
name="event/index"
|
||||||
options={{
|
options={{
|
||||||
@@ -46,22 +40,6 @@ export default function ApplicationLayout() {
|
|||||||
),
|
),
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{/* <Stack.Screen
|
|
||||||
name="home"
|
|
||||||
options={{
|
|
||||||
title: "HIPMI",
|
|
||||||
headerLeft: () => (
|
|
||||||
<Ionicons name="search" size={20} color={MainColor.yellow} />
|
|
||||||
),
|
|
||||||
headerRight: () => (
|
|
||||||
<Ionicons
|
|
||||||
name="notifications"
|
|
||||||
size={20}
|
|
||||||
color={MainColor.yellow}
|
|
||||||
/>
|
|
||||||
),
|
|
||||||
}}
|
|
||||||
/> */}
|
|
||||||
</Stack>
|
</Stack>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
40
navigation/types.ts
Normal file
40
navigation/types.ts
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
// src/navigation/types.ts
|
||||||
|
|
||||||
|
import { NavigatorScreenParams } from "@react-navigation/native";
|
||||||
|
|
||||||
|
// Tipe untuk Tab Navigator utama di (home-tabs)
|
||||||
|
export type HomeTabParamList = {
|
||||||
|
index: undefined; // Diperbarui: Tab default (sekarang dinamakan index)
|
||||||
|
maps: undefined;
|
||||||
|
profile: undefined;
|
||||||
|
};
|
||||||
|
|
||||||
|
// Tipe untuk Stack Navigator Event
|
||||||
|
export type EventStackParamList = {
|
||||||
|
index: undefined; // Rute root untuk Event (misalnya, daftar event)
|
||||||
|
// Anda bisa menambahkan rute event lain di sini, contoh:
|
||||||
|
// '[id]': { id: string }; // Untuk detail event
|
||||||
|
};
|
||||||
|
|
||||||
|
// Tipe untuk Stack Navigator Autentikasi
|
||||||
|
export type AuthStackParamList = {
|
||||||
|
index: undefined; // Layar Login
|
||||||
|
register: undefined; // Layar Pendaftaran
|
||||||
|
verification: undefined; // Layar Verifikasi
|
||||||
|
};
|
||||||
|
|
||||||
|
// Tipe untuk Stack Navigator Utama Aplikasi (setelah autentikasi)
|
||||||
|
export type AppStackParamList = {
|
||||||
|
"(home-tabs)": NavigatorScreenParams<HomeTabParamList>; // Mengarah ke Tab Navigator
|
||||||
|
event: NavigatorScreenParams<EventStackParamList>; // Mengarah ke Event Stack
|
||||||
|
forum: undefined; // NEW: Halaman Forum, sebagai Stack Screen terpisah
|
||||||
|
// Anda bisa menambahkan rute stack lain di sini yang tidak termasuk dalam grup di atas
|
||||||
|
};
|
||||||
|
|
||||||
|
// Gabungkan semua tipe rute utama ke dalam RootParamList global
|
||||||
|
// Ini memungkinkan penggunaan useNavigation dan useRouter dengan tipe yang benar
|
||||||
|
declare global {
|
||||||
|
namespace ReactNavigation {
|
||||||
|
interface RootParamList extends AuthStackParamList, AppStackParamList {}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -40,7 +40,7 @@ export default function RegisterView() {
|
|||||||
radius={10}
|
radius={10}
|
||||||
onPress={() => (
|
onPress={() => (
|
||||||
console.log("Success register"),
|
console.log("Success register"),
|
||||||
router.push("/(application)/(tabs)")
|
router.push("/(application)/(home-tabs)")
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
<Spacing />
|
<Spacing />
|
||||||
|
|||||||
@@ -45,6 +45,15 @@ export const Styles = StyleSheet.create({
|
|||||||
fontWeight: "normal",
|
fontWeight: "normal",
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Stack Header Style
|
||||||
|
headerStyle: {
|
||||||
|
backgroundColor: MainColor.darkblue,
|
||||||
|
},
|
||||||
|
headerTitleStyle: {
|
||||||
|
color: MainColor.yellow,
|
||||||
|
fontWeight: "bold",
|
||||||
|
},
|
||||||
|
|
||||||
// HOME
|
// HOME
|
||||||
homeContainer: {
|
homeContainer: {
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user