Skip to content

Commit ed7d21c

Browse files
committed
first phase finalized
1 parent e43ba30 commit ed7d21c

File tree

6 files changed

+35
-16
lines changed

6 files changed

+35
-16
lines changed

app.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"expo": {
3-
"name": "Bahi-Book",
3+
"name": "Bahi Book",
44
"slug": "Bahi-Book",
55
"version": "1.0.0",
66
"orientation": "portrait",

src/components/AddButton.js

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,25 @@
11
import React from "react";
2-
import { View, Text, TouchableOpacity } from "react-native";
2+
import { Text, TouchableOpacity } from "react-native";
33
import { Icon } from "react-native-elements";
44
import tw from "tailwind-react-native-classnames";
55

6-
const AddButton = ({ fun, text, onPress }) => {
6+
const AddButton = ({ text, onPress, style }) => {
77
return (
88
<TouchableOpacity
99
onPress={onPress}
10-
style={tw`bg-white rounded-lg w-11/12 mx-auto p-1 mt-4 items-center justify-center flex-row shadow-lg`}
10+
style={[
11+
tw`bg-green-500 rounded-lg w-11/12 mx-auto p-1 mt-4 items-center justify-center flex-row shadow-lg`,
12+
style,
13+
]}
1114
>
12-
<Icon name="plus" type="feather" size={40} style={tw`mx-2`} />
13-
<Text style={tw`text-xl mx-2`}>{text}</Text>
15+
<Icon
16+
name="checkbox-marked-circle-outline"
17+
type="material-community"
18+
size={40}
19+
style={tw`mx-2`}
20+
color="#fff"
21+
/>
22+
<Text style={tw`text-xl mx-2 text-white font-semibold`}>{text}</Text>
1423
</TouchableOpacity>
1524
);
1625
};

src/components/AddCustomerModal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ const AddCustomerModal = ({ visible, setVisible, fun }) => {
3131
onRequestClose={() => setVisible(false)}
3232
>
3333
<TouchableOpacity
34+
activeOpacity={1}
3435
onPress={() => setVisible(false)}
3536
style={[
3637
tw`h-full w-full absolute justify-center items-center`,

src/components/AddTransactionModal.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ const AddTransactionModal = ({
9595
onRequestClose={() => setVisible(false)}
9696
>
9797
<TouchableOpacity
98+
activeOpacity={1}
9899
onPress={() => setVisible(false)}
99100
style={[
100101
tw`h-full w-full absolute justify-center items-center`,

src/screens/CustomerScreen.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { selectUser } from "../redux/slices/userSlice";
1212
import firebase from "../firebase";
1313
import Dashboard from "../components/Dashboard";
1414
import { useNavigation } from "@react-navigation/native";
15-
import { Avatar } from "react-native-elements";
15+
import { Avatar, FAB } from "react-native-elements";
1616
import tw from "tailwind-react-native-classnames";
1717
import TransactionListItem from "../components/TransactionListItem";
1818
import Loader from "../components/Loader";
@@ -162,14 +162,18 @@ const CustomerScreen = ({ route }) => {
162162
setLoading={setLoading}
163163
/>
164164
)}
165+
<FAB
166+
onPress={() => setModalVisible(true)}
167+
title="Add Transaction"
168+
color="rgb(153,27,27)"
169+
style={tw`z-10`}
170+
placement="right"
171+
/>
165172
<FlatList
166173
ListHeaderComponent={() => (
167174
<View>
168175
<Dashboard data={{ sent: gave || 0, received: got || 0 }} />
169-
<AddButton
170-
text="Add Transaction"
171-
onPress={() => setModalVisible(true)}
172-
/>
176+
<AddButton text="Settle Up" onPress={() => setModalVisible(true)} />
173177
</View>
174178
)}
175179
ListHeaderComponentStyle={tw`mb-4`}

src/screens/HomeScreen.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { StatusBar } from "expo-status-bar";
22
import React, { useEffect, useState } from "react";
33
import { SafeAreaView, FlatList, View, Text, Alert } from "react-native";
4+
import { FAB } from "react-native-elements";
45
import { useSelector } from "react-redux";
56
import tw from "tailwind-react-native-classnames";
67
import AddButton from "../components/AddButton";
@@ -78,7 +79,7 @@ const HomeScreen = () => {
7879
});
7980
setModalVisible(false);
8081
setLoading(false);
81-
// // //ALL THIS IS NOW DONE USING CLOUD FUNCTIONS // // // // //
82+
// // //ALL THIS WAS BEING DONE USING CLOUD FUNCTIONS // // // // //
8283
// //
8384
db().collection("users").doc(id).set({}, { merge: true });
8485
db()
@@ -104,6 +105,13 @@ const HomeScreen = () => {
104105
/>
105106
)}
106107
<StatusBar style="light" />
108+
<FAB
109+
onPress={() => setModalVisible(true)}
110+
title="Add Customer"
111+
color="rgb(153,27,27)"
112+
style={tw`z-10`}
113+
placement="right"
114+
/>
107115
<FlatList
108116
ListHeaderComponent={() => (
109117
<View>
@@ -113,10 +121,6 @@ const HomeScreen = () => {
113121
received: userDoc?.received || 0,
114122
}}
115123
/>
116-
<AddButton
117-
onPress={() => setModalVisible(true)}
118-
text="Add Customer"
119-
/>
120124
</View>
121125
)}
122126
ItemSeparatorComponent={() => (

0 commit comments

Comments
 (0)