/
component.preact.tsx
39 lines (36 loc) · 1014 Bytes
/
component.preact.tsx
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
37
38
39
import { h } from 'preact';
import { PreactComponent } from '../../component.preact';
import { EditorSerieComponent } from '../editor/component.preact';
import { CreateSerieController } from './controller';
export class CreateSerieComponent extends PreactComponent {
public constructor(props: any) {
super(props, new CreateSerieController());
}
public render() {
return (
<form
onSubmit={(event: Event) => {
event.preventDefault();
event.stopPropagation();
this.$ctrl.onSubmit();
}}
>
<h5>Create a new measuring serie</h5>
<EditorSerieComponent editorForm={this.$ctrl.editorForm} />
<button className="btn btn-primary" type="submit" id="submit">
Add
</button>
<button
className="btn"
type="reset"
id="cancel"
onClick={() => {
this.$ctrl.onCancel();
}}
>
Abbrechen
</button>
</form>
);
}
}