Skip to content

Commit

Permalink
BUG: Remove unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
mseng10 committed Aug 5, 2024
1 parent cdc2669 commit 7a24b3e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 355 deletions.
194 changes: 0 additions & 194 deletions client/src/forms/update/FertilizePlantsForm.js

This file was deleted.

132 changes: 0 additions & 132 deletions client/src/forms/update/RepotPlantsForm.js

This file was deleted.

32 changes: 3 additions & 29 deletions client/src/pages/plant/Plants.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,21 @@ import React, { useState, useMemo } from 'react';
import { DataGrid, GridToolbarContainer, GridToolbarColumnsButton, GridToolbarFilterButton, GridToolbarExport, GridToolbarDensitySelector } from '@mui/x-data-grid';
import Box from '@mui/material/Box';
import IconButton from '@mui/material/IconButton';
import { EditSharp, WaterDropOutlined, DeleteOutlineSharp, LunchDining, ParkSharp } from '@mui/icons-material';
import { EditSharp, WaterDropOutlined, DeleteOutlineSharp } from '@mui/icons-material';
import WaterPlantsForm from '../../modals/plant/WaterPlantsForm';
import KillPlantsForm from '../../modals/plant/KillPlantsForm';
import FertilizePlantsForm from '../../forms/update/FertilizePlantsForm';
import RepotPlantsForm from '../../forms/update/RepotPlantsForm';
import { PHASE_LABELS } from '../../constants';
import { usePlants } from '../../hooks/usePlants';
import { useNavigate } from "react-router-dom";

const Plants = ({ initialPlants }) => {
const navigate = useNavigate();
const { plants, setPlants, genuses, systems, types, isLoading, error } = usePlants(initialPlants);
const { plants, genuses, systems, types, isLoading, error } = usePlants(initialPlants);
const [selectedPlants, setSelectedPlants] = useState([]);
const [formStates, setFormStates] = useState({
updatePlant: false,
waterPlants: false,
killPlants: false,
fertilizePlants: false,
repotPlants: false,
killPlants: false
});

const columns = useMemo(() => [
Expand Down Expand Up @@ -75,12 +71,6 @@ const Plants = ({ initialPlants }) => {
<IconButton size="small" color="error" onClick={() => setFormStates(prev => ({ ...prev, killPlants: true }))}>
<DeleteOutlineSharp />
</IconButton>
<IconButton size="small" color="info" onClick={() => setFormStates(prev => ({ ...prev, fertilizePlants: true }))}>
<LunchDining />
</IconButton>
<IconButton size="small" color="info" onClick={() => setFormStates(prev => ({ ...prev, repotPlants: true }))}>
<ParkSharp />
</IconButton>
</>
)}
</GridToolbarContainer>
Expand Down Expand Up @@ -122,22 +112,6 @@ const Plants = ({ initialPlants }) => {
initialPlants={selectedPlants}
/>
)}
{formStates.fertilizePlants && (
<FertilizePlantsForm
isOpen={formStates.fertilizePlants}
onRequestClose={() => setFormStates(prev => ({ ...prev, fertilizePlants: false }))}
setPlants={setPlants}
plants={selectedPlants}
/>
)}
{formStates.repotPlants && (
<RepotPlantsForm
isOpen={formStates.repotPlants}
onRequestClose={() => setFormStates(prev => ({ ...prev, repotPlants: false }))}
setPlants={setPlants}
plants={selectedPlants}
/>
)}
</>
);
};
Expand Down

0 comments on commit 7a24b3e

Please sign in to comment.