Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0312e47
added db table and AsyncStorage
PrajjvalMehra Jun 3, 2023
7933bf8
updated Create Table and async storage logic
PrajjvalMehra Jun 3, 2023
750cd2e
Merge pull request #18 from PrajjvalMehra/dependencies
PrajjvalMehra Jun 3, 2023
61521af
Added icons and history tab in bottom navigator
PrajjvalMehra Jun 4, 2023
c42d6cc
Merge pull request #19 from PrajjvalMehra/bottom-bar-additions
PrajjvalMehra Jun 4, 2023
41d9498
Merge pull request #20 from PrajjvalMehra/development
krislibrekdp Jun 4, 2023
e6a42b2
created a UI template
krislibrekdp Jun 4, 2023
5488280
Home Screen Features added
PrajjvalMehra Jun 5, 2023
162538e
Merge pull request #21 from PrajjvalMehra/9-goal-setting-and-tracking
PrajjvalMehra Jun 5, 2023
ab5e7e3
Modified the UI progress bar
krislibrekdp Jun 5, 2023
4420f60
Merge branch 'development' of https://github.com/PrajjvalMehra/gallon…
krislibrekdp Jun 5, 2023
ee404d6
fixed app crash on android
PrajjvalMehra Jun 5, 2023
47d911e
Merge pull request #22 from PrajjvalMehra/testing
PrajjvalMehra Jun 5, 2023
ea38034
modified bottom highlight color
PrajjvalMehra Jun 5, 2023
6eba473
adding sqlite queries
krislibrekdp Jun 5, 2023
8885a13
Merge branch 'development' of https://github.com/PrajjvalMehra/gallon…
krislibrekdp Jun 5, 2023
59b0038
debug query SQL history list
krislibrekdp Jun 5, 2023
4e37322
fix some bugs in the history logs to query to sql
krislibrekdp Jun 5, 2023
497bc4b
fixing bugs for sql queries
krislibrekdp Jun 6, 2023
da84fbf
fix sql queries bugs
krislibrekdp Jun 6, 2023
44ec537
Merge branch '6-water-intake-history' of https://github.com/PrajjvalM…
krislibrekdp Jun 6, 2023
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
7 changes: 0 additions & 7 deletions App.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@ import { useEffect } from "react";
import AppProvider from "./Context/AppProvider";

import Wrapper from "./Wrapper";
import { dbSetup, testInsert, testQuery } from "./queries/tableSetup";

function App() {
useEffect(() => {
dbSetup();
testInsert();
testQuery();
}, []);

return (
<AppProvider>
<Wrapper />
Expand Down
20 changes: 20 additions & 0 deletions Wrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,30 @@ import BottomNavigator from "./components/BottomNavigator/BottomNavigator";
import { NavigationContainer } from "@react-navigation/native";
import { NativeBaseProvider } from "native-base";
import AppContext from "./Context/AppContext";
import { dbSetup, createTodayRow, testQuery } from "./queries/tableSetup";

import { checkOnboarding, setGoal, setUnit } from "./utils/asyncStorage";

import React from "react";

function Wrapper() {
React.useEffect(() => {
dbSetup();
async function fetchOnboardingData() {
const onboarding = await checkOnboarding();
await setGoal();
await setUnit();

// Set onboarding === true to true after testing
if (onboarding === "false") {
createTodayRow();
testQuery();
}
}

fetchOnboardingData();
}, []);

const { statusBarColor } = React.useContext(AppContext);
return (
<NativeBaseProvider>
Expand Down
Binary file added assets/goal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/notification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/target.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/water.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
38 changes: 36 additions & 2 deletions components/BottomNavigator/BottomNavigator.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ import Settings from "../../screens/Settings/Settings";
import AppContext from "../../Context/AppContext";
("../../Context/AppProvider");
import React from "react";
import History from "../../screens/History/History";
import { Ionicons } from "@expo/vector-icons";
import { MaterialIcons } from "@expo/vector-icons";

const Tab = createBottomTabNavigator();

function BottomNavigator() {
Expand All @@ -19,10 +23,40 @@ function BottomNavigator() {
tabBarStyle: {
backgroundColor: bg,
},
tabBarActiveTintColor: "#0891b2",
}}
>
<Tab.Screen name="Home" component={Home} />
<Tab.Screen name="Settings" component={Settings} />
<Tab.Screen
name="History"
options={{
tabBarIcon: ({ color, size }) => (
<MaterialIcons
name="history"
size={size}
color={color}
/>
),
}}
component={History}
/>
<Tab.Screen
name="Home"
options={{
tabBarIcon: ({ color, size }) => (
<Ionicons name="home" size={size} color={color} />
),
}}
component={Home}
/>
<Tab.Screen
name="Settings"
options={{
tabBarIcon: ({ color, size }) => (
<Ionicons name="ios-cog" size={size} color={color} />
),
}}
component={Settings}
/>
</Tab.Navigator>
);
}
Expand Down
70 changes: 70 additions & 0 deletions components/CustomIntake/CustomIntake.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
import React from "react";
import {
Text,
View,
Heading,
Input,
KeyboardAvoidingView,
ScrollView,
Button,
Pressable,
} from "native-base";
import { Ionicons } from "@expo/vector-icons";
import { TouchableWithoutFeedback } from "react-native-gesture-handler";
import { Keyboard, TouchableWithoutFeedbackComponent } from "react-native";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { TouchableOpacity } from "react-native";

function CustomIntake(props) {
const [intake, setIntake] = React.useState("1000");
return (
<View>
<Heading size={"lg"}>Custom Intake</Heading>
<View style={{ marginTop: 20, marginBottom: 10 }}>
<Input
variant={"filled"}
backgroundColor={"primary.100"}
keyboardType="number-pad"
type={"number"}
value={intake}
size={"2xl"}
onChange={(e) => {
setIntake(e.nativeEvent.text);
}}
color={"primary.600"}
fontSize={"2xl"}
clearTextOnFocus={true}
borderRadius={10}
InputRightElement={
<Text fontSize={"3xl"} color={"primary.600"}>
ml{" "}
</Text>
}
></Input>
</View>
<Button
bgColor={"primary.400"}
_text={{ color: "black" }}
_pressed={{ bg: "primary.500" }}
variant={"subtle"}
endIcon={
<MaterialCommunityIcons
name="water-plus-outline"
size={24}
color="black"
/>
}
size={"lg"}
borderRadius={10}
onPress={(e) => {
props.increaseProgress(intake);
props.onClose();
}}
>
Add
</Button>
</View>
);
}

export default CustomIntake;
87 changes: 87 additions & 0 deletions components/ModifyGoal/ModifyGoal.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
import React from "react";
import {
Text,
View,
Heading,
Input,
KeyboardAvoidingView,
ScrollView,
Button,
Pressable,
} from "native-base";
import { Ionicons } from "@expo/vector-icons";
import { TouchableWithoutFeedback } from "react-native-gesture-handler";
import { Keyboard, TouchableWithoutFeedbackComponent } from "react-native";
import { MaterialCommunityIcons } from "@expo/vector-icons";
import { TouchableOpacity } from "react-native";
import { modifyGoal } from "../../utils/asyncStorage";
function ModifyGoal(props) {
const { goal, handleGoalChange, onClose } = props;
const [localGoal, setLocalGoal] = React.useState(goal);

const setDBGoal = async (goal) => {
await modifyGoal(goal);
};

const handleGoalUpdate = () => {
Keyboard.dismiss();
async function updateGoal() {
await setDBGoal(localGoal);
}
updateGoal();
handleGoalChange(localGoal);
onClose();

// handleGoalChange(localGoal);
};

return (
<KeyboardAvoidingView bounces={false}>
<Heading size={"lg"}>Modify Daily Goal</Heading>
<View style={{ marginTop: 20, marginBottom: 10 }}>
<Input
variant={"filled"}
backgroundColor={"primary.100"}
keyboardType="number-pad"
type={"number"}
value={localGoal}
size={"2xl"}
onChange={(e) => {
setLocalGoal(e.nativeEvent.text);
}}
color={"primary.600"}
fontSize={"2xl"}
clearTextOnFocus={true}
borderRadius={10}
InputRightElement={
<Text fontSize={"3xl"} color={"primary.600"}>
ml{" "}
</Text>
}
></Input>
</View>
<Button
bgColor={"primary.400"}
_text={{ color: "black" }}
_pressed={{ bg: "primary.500" }}
variant={"subtle"}
endIcon={
<MaterialCommunityIcons
name="water-plus-outline"
size={24}
color="black"
/>
}
size={"lg"}
borderRadius={10}
onPress={() => {
handleGoalUpdate();
}}
>
Modify Goal
</Button>
</KeyboardAvoidingView>
);
}

export default ModifyGoal;
Loading