Fix the icon color + allow changing icons depending on the state
This commit is contained in:
parent
2c433c7df0
commit
bcb35877c1
7 changed files with 47 additions and 13 deletions
|
|
@ -13,6 +13,7 @@ import TopBar from "components/TopBar";
|
|||
import UiItemList from "components/UiItemList";
|
||||
|
||||
import keyOf from "utils/keyOf";
|
||||
import { controlGetIcon } from "utils/parseIconName";
|
||||
|
||||
export type AppProps = {
|
||||
config: Config
|
||||
|
|
@ -79,11 +80,15 @@ class App extends React.Component<AppProps & Classes, AppState> {
|
|||
<SideBar open={this.state.drawerOpened}
|
||||
control={this.state.selectedControl}
|
||||
onCloseRequest={this.closeDrawer.bind(this)}
|
||||
icon={this.state.selectedControl == null ? null :
|
||||
controlGetIcon(this.state.selectedControl,
|
||||
this.state.mqttState)}
|
||||
>
|
||||
{this.state.selectedControl == null
|
||||
|| <UiItemList state={this.state.mqttState}
|
||||
controls={this.state.selectedControl.ui}
|
||||
onChangeState={this.changeState.bind(this)} />}
|
||||
onChangeState={this.changeState.bind(this)}
|
||||
/>}
|
||||
</SideBar>
|
||||
</div>
|
||||
</MuiThemeProvider>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue