-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathapp.tsx
55 lines (48 loc) · 1.43 KB
/
app.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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import React from "react";
import { Theme, withStyles } from "@material-ui/core/styles";
import GenericApp from "@iobroker/adapter-react/GenericApp";
import Settings from "./components/settings";
import { GenericAppProps, GenericAppSettings } from "@iobroker/adapter-react/types";
import { StyleRules } from "@material-ui/core/styles";
const styles = (_theme: Theme): StyleRules => ({
root: {},
});
class App extends GenericApp {
constructor(props: GenericAppProps) {
const extendedProps: GenericAppSettings = {
...props,
encryptedFields: [],
translations: {
"en": require("./i18n/en.json"),
"de": require("./i18n/de.json"),
"ru": require("./i18n/ru.json"),
"pt": require("./i18n/pt.json"),
"nl": require("./i18n/nl.json"),
"fr": require("./i18n/fr.json"),
"it": require("./i18n/it.json"),
"es": require("./i18n/es.json"),
"pl": require("./i18n/pl.json"),
"uk": require("./i18n/uk.json"),
"zh-cn": require("./i18n/zh-cn.json"),
},
};
super(props, extendedProps);
}
onConnectionReady(): void {
// executed when connection is ready
}
render() {
if (!this.state.loaded) {
return super.render();
}
return (
<div className="App">
<Settings native={this.state.native} onChange={(attr, value) => this.updateNativeValue(attr, value)} />
{this.renderError()}
{this.renderToast()}
{this.renderSaveCloseButtons()}
</div>
);
}
}
export default withStyles(styles)(App);