diff options
author | 2021-11-04 14:01:54 +0000 | |
---|---|---|
committer | 2021-11-04 14:01:54 +0000 | |
commit | bfda0ad41502165f52e772e74bd3d499f010bc18 (patch) | |
tree | c07ceae65a95361f00cf0a163dd2c669349928a5 /gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js | |
parent | e6da0175ab60c095830e8cb7c23fdde2b9fbb90c (diff) | |
parent | 33391192adecdf86da3547f024ff82fb0cf85535 (diff) |
Merge "UPDATED Jest Unit Tests for Monitoring Functionality"
Diffstat (limited to 'gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js')
-rw-r--r-- | gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js index 2997239..a34b5b3 100644 --- a/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js +++ b/gui-clamp/ui-react/src/components/dialogs/ControlLoop/AccordionHeader.js @@ -19,9 +19,9 @@ * */ +import React from "react"; import styled from "styled-components"; import { Accordion, Button } from "react-bootstrap"; -import React, { useEffect, useState } from "react"; const UninitialisedHeader = styled.div` margin: 0; @@ -62,6 +62,12 @@ const ToggleButton = styled(Button)` const AccordionHeader = (props) => { + const index = props.index; + + console.log("----------------"); + console.log(index); + console.log("----------------"); + const toggleState = () => { switch (props.orderedState) { case 'UNINITIALISED': @@ -70,6 +76,8 @@ const AccordionHeader = (props) => { return renderPassiveOrderedState(); case 'RUNNING': return renderRunningOrderedState(); + default: + return renderUninitialisedOrderedState(); } } @@ -77,7 +85,7 @@ const AccordionHeader = (props) => { return ( <UninitialisedHeader className="panel-header"> - <Accordion.Toggle as={ToggleButton} variant="link" eventKey={ props.index.toString() }> + <Accordion.Toggle as={ToggleButton} variant="link" eventKey={ index.toString() }> { props.title } </Accordion.Toggle> </UninitialisedHeader> @@ -85,11 +93,9 @@ const AccordionHeader = (props) => { } const renderPassiveOrderedState = () => { - console.log("renderPassiveOrderedState called"); - return ( <PassiveHeader className="panel-header"> - <Accordion.Toggle as={ToggleButton} variant="link" eventKey={ props.index.toString() }> + <Accordion.Toggle as={ToggleButton} variant="link" eventKey={ index.toString() }> { props.title } </Accordion.Toggle> </PassiveHeader> @@ -97,11 +103,9 @@ const AccordionHeader = (props) => { } const renderRunningOrderedState = () => { - console.log("renderRunningOrderedState called"); - return ( <RunningHeader className="panel-header"> - <Accordion.Toggle as={ToggleButton} variant="link" eventKey={ props.index.toString() }> + <Accordion.Toggle as={ToggleButton} variant="link" eventKey={ index.toString() }> { props.title } </Accordion.Toggle> </RunningHeader> @@ -109,7 +113,7 @@ const AccordionHeader = (props) => { } return ( - toggleState() + toggleState() ); } |