Skip to content
Snippets Groups Projects
Commit c437d698 authored by Jean-Christophe's avatar Jean-Christophe
Browse files

fix détails

parent 4d106cc6
No related branches found
No related tags found
No related merge requests found
import { useState, useEffect } from 'react';
import '../assets/style/app.css';
......
import { useState, useEffect, useRef } from 'react';
import { useEffect, useRef } from 'react';
import '../assets/style/person.css';
......
......@@ -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">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment