Improve the entire icon logic
- Tree Shaking for Icons (Closes #53) - New API for the config (See https://github.com/uwap/mqtt-control-map/wiki/Icons) - Icons can now be colored everywhere, not just on the map
This commit is contained in:
parent
43a33c3ab3
commit
856aab41ad
18 changed files with 288 additions and 269 deletions
|
|
@ -39,6 +39,14 @@ export type AppState = {
|
|||
error: ?string
|
||||
};
|
||||
|
||||
/*
|
||||
const App = (props: AppProps) => {
|
||||
const topics = Array.isArray(props.config.topics) ?
|
||||
Object.assign({}, ...props.config.topics) : props.config.topics;
|
||||
const [mqttConnected, setMqttConnected] = useState(false);
|
||||
};
|
||||
*/
|
||||
|
||||
class App extends React.PureComponent<AppProps & Classes, AppState> {
|
||||
controlMap: React.Node
|
||||
|
||||
|
|
@ -171,7 +179,7 @@ class App extends React.PureComponent<AppProps & Classes, AppState> {
|
|||
control={this.state.selectedControl}
|
||||
onCloseRequest={this.closeDrawer}
|
||||
icon={this.state.selectedControl == null ? null :
|
||||
this.state.selectedControl.icon(this.state.mqttState)}
|
||||
this.state.selectedControl.icon.render(this.state.mqttState)}
|
||||
>
|
||||
{this.state.selectedControl == null
|
||||
|| <UiItemList controls={this.state.selectedControl.ui} />}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue