Skip to content

Commit

Permalink
Merge pull request #96 from hcp-uw/frontend_stuff
Browse files Browse the repository at this point in the history
Auto reload history page upon switching to it, added camera page
  • Loading branch information
davidye007 authored Sep 20, 2024
2 parents f70545b + 3943c63 commit d7c1c21
Show file tree
Hide file tree
Showing 7 changed files with 406 additions and 14 deletions.
10 changes: 9 additions & 1 deletion source/frontend/app.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,15 @@
"output": "static",
"favicon": "./assets/images/favicon.png"
},
"plugins": ["expo-router"],
"plugins": [
"expo-router",
[
"expo-camera",
{
"cameraPermission": "Allow Receipt Beyond to access your camera"
}
]
],
"experiments": {
"typedRoutes": true
}
Expand Down
33 changes: 24 additions & 9 deletions source/frontend/app/MainNavigator.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,23 @@ import { History } from "@/pages/history";
import { Account } from "@/pages/account";
import { EditProfile } from "@/pages/editprofile";
import { DetailedHistory } from "@/pages/detailedhistory";
import { Capture } from "@/pages/capture";

import {
SummaryStackParamList,
PriceWatchStackParamList,
UserValidStackParamList,
HistoryStackParamList,
AccountStackParamList,
CaptureStackParamList,
} from "./StackParamList";

const SummaryStack = createStackNavigator<SummaryStackParamList>();
const PriceWatchStack = createStackNavigator<PriceWatchStackParamList>();
const UserValidStack = createStackNavigator<UserValidStackParamList>();
const HistoryStack = createStackNavigator<HistoryStackParamList>();
const AccountStack = createStackNavigator<AccountStackParamList>();

const CaptureStack = createStackNavigator<CaptureStackParamList>();
// Create stack navigators for each tab

/**
Expand Down Expand Up @@ -85,15 +88,27 @@ function PriceWatchStackNavigator() {
);
}

function UserValidStackNavigator() {
// function UserValidStackNavigator() {
// return (
// <UserValidStack.Navigator screenOptions={defaultScreenOptions}>
// <UserValidStack.Screen
// name="UserValidation"
// component={UserValid}
// options={{ title: "Add Receipt" }}
// />
// </UserValidStack.Navigator>
// );
// }

function CaptureStackNavigator() {
return (
<UserValidStack.Navigator screenOptions={defaultScreenOptions}>
<UserValidStack.Screen
name="UserValidation"
component={UserValid}
<CaptureStack.Navigator screenOptions={defaultScreenOptions}>
<CaptureStack.Screen
name="Capture"
component={Capture}
options={{ title: "Add Receipt" }}
/>
</UserValidStack.Navigator>
</CaptureStack.Navigator>
);
}

Expand Down Expand Up @@ -172,8 +187,8 @@ function MyTabs() {
}}
/>
<Tab.Screen
name="UserValidTab"
component={UserValidStackNavigator}
name="CaptureTab"
component={CaptureStackNavigator}
options={{
tabBarShowLabel: false,
tabBarIcon: ({ focused }) => (
Expand Down
8 changes: 7 additions & 1 deletion source/frontend/app/StackParamList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ export type HistoryStackParamList = {
// Param list for the Account stack
export type AccountStackParamList = {
Account: undefined;
EditProfile: { view: "email" | "password"}
EditProfile: { view: "email" | "password" };
// Add other screens and their params in Account Stack if necessary
};

// Param list for the Account stack
export type CaptureStackParamList = {
Capture: undefined;
// Add other screens and their params in Account Stack if necessary
};
32 changes: 32 additions & 0 deletions source/frontend/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion source/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,9 @@
"react-native-screens": "3.31.1",
"react-native-svg": "^15.6.0",
"react-native-web": "~0.19.10",
"styled-components": "^6.1.11"
"styled-components": "^6.1.11",
"expo-image-picker": "~15.0.7",
"expo-camera": "~15.0.16"
},
"devDependencies": {
"@babel/core": "^7.20.0",
Expand Down
Loading

0 comments on commit d7c1c21

Please sign in to comment.