Skip to content

Commit

Permalink
Additional documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
kamranbastani committed Dec 8, 2023
1 parent ef612a3 commit 8ebbf2c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 79 deletions.
Binary file modified packages/backend/receipts.zip
Binary file not shown.
1 change: 1 addition & 0 deletions packages/frontend/src/AddUsers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ function InputField({ onInputChange }) {

const handleSubmit = (e) => {
e.preventDefault();
// Data validation to ensure the field is not empty
if (inputValue !== "") {
onInputChange(inputValue);
setInputValue('');
Expand Down
13 changes: 2 additions & 11 deletions packages/frontend/src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import HomePage from './HomePage'
import LoginSignup from "./LoginSignup";
import ImageUpload from './ImageUpload';
import ImageCapture from './ImageCapture';
import History from './History.js';
import {BrowserRouter as Router, Routes, Route, Navigate } from 'react-router-dom';

function CreateTable() {

// Upload page
const Upload = () => {
return (
<div>
Expand All @@ -18,6 +18,7 @@ function CreateTable() {
);
};

// Image capture page
const ICAP = () => {
return (
<div>
Expand All @@ -27,15 +28,6 @@ function CreateTable() {
)
}

const HistoryPage = () => {
return (
<div>
<Header/>
<History />
</div>
)
}

const PrivateRoute = ({ element }) => {
const token = localStorage.getItem('token');
return token ? element : <Navigate to="/" />;
Expand All @@ -48,7 +40,6 @@ function CreateTable() {
path="/imageUpload"
element={<PrivateRoute element={<Upload />} />}
/>
<Route path="/history" element={<HistoryPage />} />
<Route path="/imageCapture" element={<PrivateRoute element={<ICAP />}/>} />
<Route path="/" element={<LoginSignup />} />
<Route
Expand Down
1 change: 1 addition & 0 deletions packages/frontend/src/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ function Header() {
);
};

// Buttons for the navigation bar at the top of the screen
return (
<header>
<h3>QuickSplit</h3>
Expand Down
66 changes: 0 additions & 66 deletions packages/frontend/src/History.js

This file was deleted.

1 change: 1 addition & 0 deletions packages/frontend/src/PopUp.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const PopupButton = (props) => {
},
}}

// Button to close the popup
>
<div>
{popupData.map((item, index) => (
Expand Down
6 changes: 4 additions & 2 deletions packages/frontend/src/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,17 @@ const Table = (props) => {
}

const splitEvenly = () => {
// When a button is clicked this updates the clicked attribute in the 2d array
// When the split evenly button is clicked this updates the clicked attribute in the 2d array,
// setting all values to true (selected)
const newButtonStates = props.jsonData.map(() =>
buttonLabels.map(() => ({ clicked: true }))
);
setButtonStates(newButtonStates);
};

const clear = () => {
// When a button is clicked this updates the clicked attribute in the 2d array
// When the clear button is clicked this updates the clicked attribute in the 2d array and sets all
// values to false (not selected)
const newButtonStates = props.jsonData.map(() =>
buttonLabels.map(() => ({ clicked: false }))
);
Expand Down

0 comments on commit 8ebbf2c

Please sign in to comment.