Skip to content

Commit

Permalink
remove unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
kira-m committed Sep 29, 2023
1 parent cfea228 commit f3c852c
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 25 deletions.
5 changes: 1 addition & 4 deletions app/src/admin/dishList.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { useEffect, useRef, useState } from 'react';
import Toolbar from './toolbar';
import { useEffect, useState } from 'react';
import adminApi from "./adminApi";
import { Simulate } from "react-dom/test-utils";
import load = Simulate.load;
import { StyledDishDataLayout } from './styledDishes';

const AdminDishTableRow = ({ dish, selectedHandler, index, selectedList }) => {
Expand Down
1 change: 0 additions & 1 deletion app/src/admin/styledEmail.tsx
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
import styled from 'styled-components'
1 change: 0 additions & 1 deletion app/src/admin/styledUsers.tsx
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
import styled from 'styled-components'
5 changes: 1 addition & 4 deletions app/src/routes/borrow.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useState, useEffect } from "react";
import { useState } from "react";
import { useNavigate } from "react-router-dom";
import Scanner from "../widgets/scanner";
import Modal from "react-bootstrap/Modal";
Expand Down Expand Up @@ -107,7 +107,6 @@ export default () => {
});

const navigate = useNavigate();
const [Buffer, setBuffer] = useState(false);
const onScan = confirm
? null
: (id: string) => {
Expand All @@ -123,8 +122,6 @@ export default () => {
}
setConfirm(false);
const user = currentUser?.id || null;
console.log("USER: " + user);
console.log("scanid", scanId);

axios
.post(
Expand Down
10 changes: 5 additions & 5 deletions app/src/routes/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const NewUser = (dishesUsed) => {

const GetDishes = (dishesUsed) =>{
const checkedOutDishes = dishesUsed.filter(dish => dish.returned.timestamp == "").length
return (
return (
<div id="dishes" style={{marginTop: '24px'}}>
<div className="d-flex justify-content-between">
<p className="sub-header-3">My Dishes</p>
Expand All @@ -91,12 +91,12 @@ const GetDishes = (dishesUsed) =>{
</div>
}
</div>

)}

const ExistingUser = (dishesUsed) => {
const content = GetDishes(dishesUsed)
const returnedDishes = dishesUsed.filter(dish => dish.returned.timestamp != "").length
const returnedDishes = dishesUsed.filter(dish => dish.returned.timestamp != "").length
return (
<div style={{ padding: "24px" }}>
<div id="impact" className="sub-header-3">
Expand Down Expand Up @@ -155,11 +155,11 @@ const Footer = () => {
};

export default () => {
//Show spinner as soon as page is refreshed
//Show spinner as soon as page is refreshed
const [isLoading, setIsLoading] = useState(true);
const { currentUser, sessionToken } = useAuth();
const [dishesUsed, setDishesUsed] = useState([]);
const [isMobile, setIsMobile] = useState(window.innerWidth <= 768);
const [isMobile, setIsMobile] = useState(window.innerWidth <= 768); // eslint-disable-line @typescript-eslint/no-unused-vars

let content;
// Fetch dishes transaction for the user
Expand Down
16 changes: 8 additions & 8 deletions app/src/routes/login.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import React, { useContext, useEffect, useState } from "react";
import { useEffect, useState } from "react";
import { Button, Typography, Box, Avatar } from '@mui/material';
import {BallTriangle} from 'react-loader-spinner';
import desktopLogo from "../assets/dishzero-logo-desktop.png";
import mobileLogo from "../assets/dishzero-logo-mobile.png";
import signInButtonLogo from "../assets/sign-in-button-logo.png";
import MobileBackground from '../assets/leaf-mobile-background.png';
import 'typeface-poppins';
import { useLocation, useNavigate, useParams, useSearchParams } from "react-router-dom";
import { useLocation } from "react-router-dom";
import { useAuth } from "../contexts/AuthContext";


Expand All @@ -15,14 +15,14 @@ const useQuery = () => new URLSearchParams(useLocation().search);
export default function Login() {
const { login } = useAuth()
const [isMobile, setIsMobile] = useState(window.innerWidth <= 768);
//Show spinner as soon as page is refreshed

//Show spinner as soon as page is refreshed
const [isLoading, setIsLoading] = useState(true);
const {currentUser} = useAuth()

//const {transaction_id} = useParams();
const query = useQuery();
const transaction_id = query.get("transaction_id");
const transaction_id = query.get("transaction_id"); // eslint-disable-line @typescript-eslint/no-unused-vars
useEffect(() => {
const handleResize = () => {
setIsMobile(window.innerWidth <= 768);
Expand All @@ -34,7 +34,7 @@ export default function Login() {
};
}, []);



// fired on button click while the user is not signed in.
// logs in the user and navigates to home screen if successfully logged in
Expand Down Expand Up @@ -90,7 +90,7 @@ export default function Login() {
</Button>
</Box>
</Box>)

}

const styles = {
Expand Down
3 changes: 1 addition & 2 deletions app/src/widgets/dishcard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import mug from "../assets/mug_icon_contained.svg";
import container from "../assets/dish_icon_contained.svg";

export default ({dish,token}) => {
const options = { weekday: 'long', year: 'numeric', month: 'long'};
const [dishAPI, setDishAPI] = useState([])
const [dishAPI, setDishAPI] = useState([])
const twoDaysInMs = 86400000 * 2
useEffect(()=>{
axios.get(`${process.env.REACT_APP_BACKEND_ADDRESS}/api/dish`, {headers:{"x-api-key":`${process.env.REACT_APP_API_KEY}`,"session-token":token}, params:{"id":dish.dish}})
Expand Down

0 comments on commit f3c852c

Please sign in to comment.