Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { View, Text, TextInput, Button, Alert } from "react-native";

import { addAccounts } from "../../utils/storageAccounts.js";

import styles from "./styles.js";
import styles from "../../styles/styles";

function AddBankAccount({ navigation }) {
function AddAccount({ navigation }) {
const [name, setName] = useState("");
const [bank, setbank] = useState("");
const [balance, setbalance] = useState(0.0);
Expand Down Expand Up @@ -77,16 +77,9 @@ function AddBankAccount({ navigation }) {

<View style={styles.buttonsView}>
<Button title="Add" onPress={handleAddAccount} />
<Button
color="#757de8"
title="Back"
onPress={() => {
navigation.goBack();
}}
></Button>
</View>
</View>
);
}

export default AddBankAccount;
export default AddAccount;
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { View, Text, TextInput, TouchableOpacity, Alert } from "react-native";
import DateTimePicker from "@react-native-community/datetimepicker";
import { Picker } from "@react-native-picker/picker";

import styles from "./styles.js";
import styles from "../../styles/AddTransactionStyle";
import { addRevenuesAndExpenses } from "../../utils/storage.js";
import { useAccountsCardStore } from "../../stores/CardsStore.js";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
import React, { useState } from "react";
import { View, Text, TextInput, Button } from "react-native";

import styles from "../../styles/EditFormsStyle";
import {updateAccounts} from "../../utils/storageAccounts";

import styles from "./styles";

const EditBankAccount = ({ route, navigation }) => {
const EditAccount = ({ route, navigation }) => {
const { index, account } = route.params;
const [name, setName] = useState(account.name);
const [bank, setBank] = useState(account.bank);
Expand Down Expand Up @@ -84,4 +83,4 @@ const EditBankAccount = ({ route, navigation }) => {
</View>
);
};
export default EditBankAccount;
export default EditAccount;
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ import {
} from "react-native";
import DateTimePicker from '@react-native-community/datetimepicker';

import styles from "./stylesForms.js";
import styles from "../../styles/EditFormsStyle.js"
import { updateRevenuesAndExpenses } from "../../utils/storage.js";

export default function EditForm({ route, navigation }) {
export default function EditTransaction({ route, navigation }) {
const { transaction, index } = route.params;
const [name, setName] = useState(transaction.name);
const [value, setValue] = useState(transaction.value.toString());
Expand Down
47 changes: 0 additions & 47 deletions src/routes/AddAccount.js

This file was deleted.

10 changes: 6 additions & 4 deletions src/routes/ExtractRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,19 @@ import React from "react";
import { createStackNavigator } from "@react-navigation/stack";

import ExtractS from "../screens/Extract/Extract";
import ExtractDetail from "../screens/ExtractDetail/ExtractDetail";
import EditForm from "../screens/ExtractDetail/formEdit";
import DetailTransaction from "../screens/DetailTransaction/DetailTransaction";
import EditTransaction from "../components/Forms/EditTransaction";
import FormsScreen from "../screens/FormsScreen/FormsScreen";

const Stack = createStackNavigator();

export function ExtractRoute() {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="ExtractS" component={ExtractS} />
<Stack.Screen name="ExtractDetail" component={ExtractDetail} />
<Stack.Screen name="EditForm" component={EditForm} />
<Stack.Screen name="DetailTransaction" component={DetailTransaction} />
<Stack.Screen name="EditTransaction" component={EditTransaction} />
<Stack.Screen name="FormsScreen" component={FormsScreen} />
</Stack.Navigator>
);
}
36 changes: 15 additions & 21 deletions src/routes/Main.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ import { NavigationContainer } from "@react-navigation/native";
import { createBottomTabNavigator } from "@react-navigation/bottom-tabs";

import Home from "../screens/Home/Home.js";
import { AddRoute } from "./AddAccount.js";
import { AddRoute } from "./RouteAccounts.js";
import { ExtractRoute } from "./ExtractRoute.js";

import Add from "../screens/Add/Add";
import { LogoTitle } from "../components/LogoTitle.js";

import HomeIcon from "../assets/home.svg";
import ExtratoIcon from "../assets/extract.svg";
import ContasIcon from "../assets/accounts.svg";
import AddIcon from "../assets/add.svg";

const Tab = createBottomTabNavigator();

Expand Down Expand Up @@ -42,8 +40,6 @@ export function MainRoute() {
return <ExtratoIcon width={24} height={24} />;
case "Accounts":
return <ContasIcon width={24} height={24} />;
case "Add":
return <AddIcon width={24} height={24} />;
default:
return null;
}
Expand All @@ -68,24 +64,22 @@ export function MainRoute() {
>
{(props) => <Home visibleBalance={visibleBalance} {...props} />}
</Tab.Screen>
<Tab.Screen name="Extract"
options={{
headerStyle:{backgroundColor:"#2196f3"},
headerTintColor: "#fff"
}}
component={ExtractRoute} />
<Tab.Screen name="Accounts"
<Tab.Screen
name="Extract"
options={{
headerStyle:{backgroundColor:"#2196f3"},
headerTintColor: "#fff"
}}
component={AddRoute} />
<Tab.Screen name="Add"
headerStyle: { backgroundColor: "#2196f3" },
headerTintColor: "#fff",
}}
component={ExtractRoute}
/>
<Tab.Screen
name="Accounts"
options={{
headerStyle:{backgroundColor:"#2196f3"},
headerTintColor: "#fff"
}}
component={Add} />
headerStyle: { backgroundColor: "#2196f3" },
headerTintColor: "#fff",
}}
component={AddRoute}
/>
</Tab.Navigator>
</NavigationContainer>
);
Expand Down
23 changes: 23 additions & 0 deletions src/routes/RouteAccounts.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from "react";

import { createStackNavigator } from "@react-navigation/stack";

import Accounts from "../screens/Accounts/Accounts";
import FormsScreen from "../screens/FormsScreen/FormsScreen";
import AddAccount from "../components/Forms/AddAccount";
import DetailAccount from "../screens/DetailAccount/DetailAccount";
import EditAccount from "../components/Forms/EditAccount";

const Stack = createStackNavigator();

export function AddRoute() {
return (
<Stack.Navigator screenOptions={{ headerShown: false }}>
<Stack.Screen name="MainCounts" component={Accounts} />
<Stack.Screen name="FormsScreen" component={FormsScreen} />
<Stack.Screen name="AddAccount" component={AddAccount} />
<Stack.Screen name="DetailAccount" component={DetailAccount} />
<Stack.Screen name="EditAccount" component={EditAccount} />
</Stack.Navigator>
);
}
Loading