Skip to content

Commit

Permalink
MISC: Rearrange forms
Browse files Browse the repository at this point in the history
  • Loading branch information
mseng10 committed Jun 12, 2024
1 parent d8529bc commit c6571b6
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,11 @@ import CloseSharpIcon from '@mui/icons-material/CloseSharp';
import FingerprintSharpIcon from '@mui/icons-material/FingerprintSharp';


const NewGenusForm = ({ isOpen, onRequestClose }) => {
const NewGenusForm = ({ isOpen, onRequestClose, allGenus }) => {
const [name, setName] = useState('');
const [watering, setWatering] = useState(0);
const [allGenus, setAllGenus] = useState([]);
const [submitted, setSubmitted] = useState(false); // Initialize submitted state

useEffect(() => {
if (isOpen) {
fetch('http://127.0.0.1:5000/genus')
.then((response) => response.json())
.then((data) => setAllGenus(data))
.catch((error) => console.error('Error fetching genus data:', error));
}
}, []);

useEffect(() => {
if (submitted) {
const requestOptions = {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions client/react/src/pages/Home.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import GrassOutlinedIcon from '@mui/icons-material/GrassOutlined';
import System from './System'
import ButtonGroup from '@mui/material/ButtonGroup';
import AddSharpIcon from '@mui/icons-material/AddSharp';
import NewPlantForm from '../forms/NewPlantForm';
import NewGenusForm from '../forms/NewGenusForm';
import NewSystemForm from '../forms/NewSystemForm';
import NewPlantForm from '../forms/create/NewPlantForm';
import NewGenusForm from '../forms/create/NewGenusForm';
import NewSystemForm from '../forms/create/NewSystemForm';
import FingerprintSharpIcon from '@mui/icons-material/FingerprintSharp';
import PointOfSaleIcon from '@mui/icons-material/PointOfSale';
import React, { useState, useEffect } from 'react';
Expand All @@ -15,8 +15,8 @@ import Box from '@mui/material/Box';
import CloseSharpIcon from '@mui/icons-material/CloseSharp';
import VisibilitySharpIcon from '@mui/icons-material/VisibilitySharp';
import ReportGmailerrorredSharpIcon from '@mui/icons-material/ReportGmailerrorredSharp';
import NewLightForm from '../forms/NewLightForm';
import NewTypeForm from '../forms/NewTypeForm';
import NewLightForm from '../forms/create/NewLightForm';
import NewTypeForm from '../forms/create/NewTypeForm';
import TungstenSharpIcon from '@mui/icons-material/TungstenSharp';
import Modal from '@mui/material/Modal';
import CallSplitSharpIcon from '@mui/icons-material/CallSplitSharp';
Expand Down
10 changes: 5 additions & 5 deletions client/react/src/pages/Plants.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
// Plants.js
import React, { useState, useEffect } from 'react';
import UpdatePlantForm from '../forms/UpdatePlantForm';
import WaterPlantsForm from '../forms/WaterPlantsForm';
import FertilizePlantsForm from '../forms/FertilizePlantsForm';
import RepotPlantsForm from '../forms/RepotPlantsForm';
import UpdatePlantForm from '../forms/update/UpdatePlantForm';
import WaterPlantsForm from '../forms/update/WaterPlantsForm';
import FertilizePlantsForm from '../forms/update/FertilizePlantsForm';
import RepotPlantsForm from '../forms/update/RepotPlantsForm';
import IconButton from '@mui/material/IconButton';
import DeleteOutlineSharpIcon from '@mui/icons-material/DeleteOutlineSharp';
import WaterDropOutlinedIcon from '@mui/icons-material/WaterDropOutlined';
import LunchDiningIcon from '@mui/icons-material/LunchDining';
import EditSharpIcon from '@mui/icons-material/EditSharp';
import KillPlantsForm from '../forms/KillPlantsForm';
import KillPlantsForm from '../forms/update/KillPlantsForm';
import ParkSharpIcon from '@mui/icons-material/ParkSharp';
import { DataGrid,GridToolbarContainer,
GridToolbarColumnsButton,
Expand Down

0 comments on commit c6571b6

Please sign in to comment.