Alex Mikhalev
8 years ago
8 changed files with 163 additions and 49 deletions
@ -1,14 +1,26 @@ |
|||||||
import * as React from "react"; |
import * as React from "react"; |
||||||
import * as ReactDOM from "react-dom"; |
import * as ReactDOM from "react-dom"; |
||||||
|
import { AppContainer } from "react-hot-loader"; |
||||||
|
|
||||||
import App from "./App"; |
import App from "./App"; |
||||||
import {MqttApiClient} from "./mqtt"; |
import { MqttApiClient } from "./mqtt"; |
||||||
|
|
||||||
const client = new MqttApiClient(); |
const client = new MqttApiClient(); |
||||||
client.start(); |
client.start(); |
||||||
const device = client.getDevice("grinklers"); |
const device = client.getDevice("grinklers"); |
||||||
|
|
||||||
const container = document.createElement("div"); |
const rootElem = document.createElement("div"); |
||||||
document.body.appendChild(container); |
document.body.appendChild(rootElem); |
||||||
|
|
||||||
ReactDOM.render(<App device={device} />, container); |
ReactDOM.render(<AppContainer> |
||||||
|
<App device={device} /> |
||||||
|
</AppContainer>, rootElem); |
||||||
|
|
||||||
|
if (module.hot) { |
||||||
|
module.hot.accept("./App", () => { |
||||||
|
const NextApp = require<any>("./App").default; |
||||||
|
ReactDOM.render(<AppContainer> |
||||||
|
<NextApp device={device} /> |
||||||
|
</AppContainer>, rootElem); |
||||||
|
}) |
||||||
|
} |
@ -1,7 +1,15 @@ |
|||||||
.device--connected { |
.device--connectedState-connected { |
||||||
color: #00FF00; |
color: #13D213; |
||||||
} |
} |
||||||
|
|
||||||
.device--disconnected { |
.device--connectedState-disconnected { |
||||||
color: #FF0000; |
color: #D20000; |
||||||
|
} |
||||||
|
|
||||||
|
.section--name { |
||||||
|
width: 200px; |
||||||
|
} |
||||||
|
|
||||||
|
.section--state { |
||||||
|
|
||||||
} |
} |
Loading…
Reference in new issue