Kantongku: kelola kategori custom (onboarding + pengaturan)

This commit is contained in:
Bro
2026-08-16 12:29:08 +07:00
parent 664d903c05
commit 6c9276c7fa
6 changed files with 701 additions and 4 deletions
+33 -2
View File
@@ -9,6 +9,8 @@ import { AddTransactionScreen } from '../screens/AddTransactionScreen';
import { EditTransactionScreen } from '../screens/EditTransactionScreen';
import { RecurringFormScreen } from '../screens/RecurringFormScreen';
import { TargetFormScreen } from '../screens/TargetFormScreen';
import { CategoryFormScreen } from '../screens/CategoryFormScreen';
import { OnboardingScreen } from '../screens/OnboardingScreen';
import { SavingsScreen } from '../screens/SavingsScreen';
import { SettingsScreen } from '../screens/SettingsScreen';
import type { TransactionType } from '../types';
@@ -23,9 +25,18 @@ export type RootTabParamList = {
export type RootStackParamList = {
Main: undefined;
Onboarding: undefined;
EditTransaksi: { transactionId: number };
RecurringForm: undefined;
TargetForm: undefined;
CategoryForm:
| {
categoryId?: number;
initialName?: string;
initialIcon?: string;
defaultType?: TransactionType;
}
| undefined;
};
const Tab = createBottomTabNavigator<RootTabParamList>();
@@ -123,10 +134,18 @@ function MainTabs() {
);
}
export function RootNavigator() {
export function RootNavigator({
initialRoute = 'Main',
}: {
initialRoute?: 'Main' | 'Onboarding';
}) {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Navigator
initialRouteName={initialRoute}
screenOptions={{ headerShown: false }}
>
<Stack.Screen name="Main" component={MainTabs} />
<Stack.Screen name="Onboarding" component={OnboardingScreen} />
<Stack.Screen
name="EditTransaksi"
component={EditTransactionScreen}
@@ -163,6 +182,18 @@ export function RootNavigator() {
headerShadowVisible: false,
}}
/>
<Stack.Screen
name="CategoryForm"
component={CategoryFormScreen}
options={({ route }) => ({
presentation: 'modal',
headerShown: true,
title: route.params?.categoryId != null ? 'Edit Kategori' : 'Kategori Baru',
headerTitleStyle: { fontWeight: '700', color: colors.text },
headerStyle: { backgroundColor: colors.background },
headerShadowVisible: false,
})}
/>
</Stack.Navigator>
);
}