Software: Apache. PHP/7.3.33 uname -a: Linux acloudg.aryanict.com 4.18.0-513.9.1.lve.el8.x86_64 #1 SMP Mon Dec 4 15:01:22 UTC uid=1095(katebhospital) gid=1098(katebhospital) groups=1098(katebhospital) Safe-mode: OFF (not secure) /opt/alt/alt-nodejs12/root/usr/lib/node_modules/npm/docs/src/components/ drwxr-xr-x |
Viewing file: Select action/file-type: import React from 'react' import styled from 'styled-components' import downCarrot from '../images/down-carrot.svg' import upCarrot from '../images/up-carrot.svg' const SectionButton = styled.button` outline: none; background-color: transparent; cursor: pointer; color: red; border: none; font-size: 18px; font-weight: bold; padding: 5px 0; transition: opacity .5s; &:after { background: center / contain no-repeat url(${(props) => props.isOpen ? upCarrot : downCarrot}); content: ''; height: 11px; width: 28px; display: inline-block; } &:hover { opacity: .6; } ` class Accordion extends React.Component { constructor (props) { super(props) this.state = { isOpen: true } this.onHide = this.onHide.bind(this) } onHide () { this.setState({isOpen: !this.state.isOpen}) } render () { return ( <div> <SectionButton isOpen={this.state.isOpen} onClick={this.onHide}>{this.props.section}</SectionButton> {this.state.isOpen && <div> {this.props.children} </div> } </div> ) } } export default Accordion |
:: Command execute :: | |
--[ c99shell v. 2.0 [PHP 7 Update] [25.02.2019] maintained by KaizenLouie | C99Shell Github | Generation time: 0.0039 ]-- |