-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathDemoReactstrap.jsx
36 lines (31 loc) · 987 Bytes
/
DemoReactstrap.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import React, { Component } from 'react';
import { Collapse, Button, CardBody, Card } from 'reactstrap';
export default class DemoReactstrap extends Component {
constructor(props) {
super(props);
document.title = 'Demo Reactstrap';
this.toggle = this.toggle.bind(this);
this.state = { collapse: false };
}
toggle() {
this.setState({ collapse: !this.state.collapse });
}
render() {
return (
<div>
<Button color="primary" onClick={this.toggle} style={{ marginBottom: '1rem' }}>Toggle collapse image</Button>
<Collapse isOpen={this.state.collapse}>
<Card style={{ backgroundColor: 'transparent', border: 'none' }}>
<CardBody>
<img
src="https://cdn-images-1.medium.com/max/1800/1*HSisLuifMO6KbLfPOKtLow.jpeg"
alt="Banner React"
width="100%"
/>
</CardBody>
</Card>
</Collapse>
</div>
);
}
}