fix folder

This commit is contained in:
2025-06-26 14:33:41 +08:00
parent cd35201e30
commit f0e0ef4b8b
11 changed files with 100 additions and 110 deletions

View File

@@ -1,9 +1,8 @@
//app/(application)/(tabs)/_layout.tsx
import { MainColor } from "@/constants/color-palet";
import { Entypo, Ionicons } from "@expo/vector-icons";
import { router, Tabs } from "expo-router";
import { Text, TouchableOpacity } from "react-native";
import { Entypo } from "@expo/vector-icons";
import { Tabs } from "expo-router";
export default function TabsLayout() {
return (
@@ -18,35 +17,6 @@ export default function TabsLayout() {
}}
>
<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
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>
</>
);

View File

@@ -2,8 +2,10 @@ import { Text, View } from "react-native";
export default function Forum() {
return (
<>
<View>
<Text>Tabs Forum</Text>
<Text>Forum</Text>
</View>
</>
);
}

View 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>
</>
);
}

View File

@@ -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>
</>
}

View File

@@ -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>
</>
);
}

View File

@@ -20,18 +20,12 @@ export default function ApplicationLayout() {
}}
>
<Stack.Screen
name="(tabs)"
name="(home-tabs)"
options={{
headerShown: false,
// title: "iii",
// headerLeft: () => (
// <Ionicons name="search" size={20} color={MainColor.white} />
// ),
// headerRight: () => (
// <Ionicons name="notifications" size={20} color={MainColor.white} />
// ),
}}
/>
<Stack.Screen
name="event/index"
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>
</>
);

40
navigation/types.ts Normal file
View 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 {}
}
}

View File

@@ -40,7 +40,7 @@ export default function RegisterView() {
radius={10}
onPress={() => (
console.log("Success register"),
router.push("/(application)/(tabs)")
router.push("/(application)/(home-tabs)")
)}
/>
<Spacing />

View File

@@ -45,6 +45,15 @@ export const Styles = StyleSheet.create({
fontWeight: "normal",
},
// Stack Header Style
headerStyle: {
backgroundColor: MainColor.darkblue,
},
headerTitleStyle: {
color: MainColor.yellow,
fontWeight: "bold",
},
// HOME
homeContainer: {
flex: 1,