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