From 1c65abc980c5286db2c65edff8d22672ba29cf33 Mon Sep 17 00:00:00 2001 From: [Alisina92] Date: Apr 02 2021 14:59:47 +0000 Subject: Converted enebling/disabling of info cards to collapse using reactstrap --- diff --git a/src/landingpage/Hideable.js b/src/landingpage/Hideable.js index aac075a..e932eac 100644 --- a/src/landingpage/Hideable.js +++ b/src/landingpage/Hideable.js @@ -1,37 +1,45 @@ -import React, { Component } from "react" -import _ from "lodash" +import React, { useState } from "react"; +import { Collapse, Button, CardBody, Card } from "reactstrap"; +import _ from "lodash"; -class Hideable extends Component { - constructor(props) { - super(props) - this.id = _.uniqueId("hideable-id-") - } +const Hideable = (props) => { + const [id, setId] = useState(_.uniqueId("hideable-id-")); + const [isCollapsed, setIsCollapsed] = useState(true); + const toggler = () => setIsCollapsed(!isCollapsed); - render() { - if (this.props.component_name === undefined) { - return
- } - return ( -
- {this.props.children} - this.props.toggle_handler(e, this.props.component_name)} - role="button"> - {this.props.is_enabled ? "Disable" : "Enable"} - -
- ) + if (props.component_name === undefined) { + return
; } -} + return ( +
+ + + + {props.children} + + +
+ ); +}; -export default Hideable +export default Hideable;