diff --git a/src/components/app.component.jsx b/src/components/app.component.jsx index 8f22e84ece818f28d0775aff0c4f720f754dc490..79920e62710427e05303f5f7a810f275ea6fbee5 100644 --- a/src/components/app.component.jsx +++ b/src/components/app.component.jsx @@ -1,4 +1,3 @@ - import { useState, useEffect } from 'react'; import '../assets/style/app.css'; diff --git a/src/components/person.component.jsx b/src/components/person.component.jsx index aa276c232ca2e3f92f809db8bc473152d631ece5..532694d69c861f2296df5d8cd80101a9531d109b 100644 --- a/src/components/person.component.jsx +++ b/src/components/person.component.jsx @@ -1,4 +1,4 @@ -import { useState, useEffect, useRef } from 'react'; +import { useEffect, useRef } from 'react'; import '../assets/style/person.css'; diff --git a/src/components/personListingController.component.jsx b/src/components/personListingController.component.jsx index 2d130e4937a02950505085c3fe47ab29da16440a..c4778555b3b40ff9ec78a8ff9b18621ee9311b1f 100644 --- a/src/components/personListingController.component.jsx +++ b/src/components/personListingController.component.jsx @@ -8,40 +8,40 @@ import PersonListingControls from './personListingControls.component.jsx'; const INITIAL_DELAY= 1000; const PersonListingController = ( props ) => { - const { persons, incrementAge } = props; const [ closed, setClosed ] = useState(false); const [ started, setStarted ] = useState(false); const [ delay, setDelay ] = useState(INITIAL_DELAY); const startStop = () => setStarted( previousStarted => ! previousStarted); + const closeComponent = () => { setClosed(previousClosed => ! previousClosed); setStarted(false); - } + } const changeDelay = newDelay => setDelay(newDelay); - const buildPersonListing = () => { + const buildPersonListing = () => { if (closed) - return null; + return null; else - return (<PersonListing - { ...props } - delay={delay} - started={started} + return (<PersonListing + { ...props } + delay={delay} + started={started} />); - } + } - const buildListingControls = () => { + const buildListingControls = () => { return (<PersonListingControls started={started} closed={closed} changeDelay={changeDelay} closeAction={closeComponent} startStop={startStop} - />); - } + />); + } return ( <div className="controller">