-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathFormPanel.py
More file actions
30 lines (25 loc) · 939 Bytes
/
Copy pathFormPanel.py
File metadata and controls
30 lines (25 loc) · 939 Bytes
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
from Component_py.stubs import require, __pragma__ # __:skip
from Component_py.component import Component, destruct
React = require("react")
PropTypes = require("prop-types")
FormGroup, Label, Input = destruct(
require("reactstrap"), "FormGroup", "Label", "Input")
class FormPanel(Component):
propTypes = {
"text": PropTypes.string,
"form_panel_update": PropTypes.func.isRequired
}
def on_text_change(self, e):
self.props.form_panel_update(e.target.value)
def render(self):
required = True
return __pragma__("xtrans", None, "{}", """ (
<FormGroup>
<Label for="text_input">Enter new todo text:</Label>
<Input
onChange={self.on_text_change}
value={self.props.text}
id="text_input"
placeholder="What to do?" />
</FormGroup>
); """)