blob: 7c27311e46e74b1b55756f5b5dfcaa6ed030131b (
plain)
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
|
import { h, Component } from 'preact'
import { Link } from 'react-router-dom'
import Modal from '../Modal.jsx'
import FolderForm from './FolderForm.jsx'
export default class Folders extends Component {
constructor(props) {
super()
this.state = {
adding: false,
}
}
openModal() {
this.setState({ adding: true })
}
closeModal() {
this.setState({ adding: false })
}
render() {
return (
<div class='folders'>
<button onClick={() => this.openModal()}>+</button>
<Modal visible={this.state.adding} onClose={() => this.closeModal()}>
<FolderForm />
</Modal>
</div>
)
}
}
|