����JFIF��x�x����'
| Server IP : 78.140.185.180 / Your IP : 216.73.216.220 Web Server : LiteSpeed System : Linux cpanel13.v.fozzy.com 4.18.0-513.11.1.lve.el8.x86_64 #1 SMP Thu Jan 18 16:21:02 UTC 2024 x86_64 User : builderbox ( 1072) PHP Version : 7.3.33 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /proc/3357889/root/opt/alt/alt-nodejs12/root/lib/node_modules/npm/docs/src/components/ |
Upload File : |
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