update design build
This commit is contained in:
@@ -26,6 +26,14 @@ class LayoutComponent extends React.Component {
|
||||
return this.state_manager && this.state_manager.state.house;
|
||||
}
|
||||
|
||||
get should_show_energy_data(){
|
||||
return this.state.dataset === 'energy' && this.house && this.house.energy_data;
|
||||
}
|
||||
|
||||
get should_show_power_data(){
|
||||
return this.state.dataset === 'power' && this.house && this.house.power_data;
|
||||
}
|
||||
|
||||
componentDidMount() {
|
||||
var layout = this;
|
||||
House.ensureHouses().then((houses)=>{
|
||||
@@ -83,4 +91,6 @@ class LayoutComponent extends React.Component {
|
||||
}
|
||||
}
|
||||
|
||||
export default LayoutComponent;
|
||||
LayoutComponent.NAME = 'Layout';
|
||||
|
||||
module.exports = LayoutComponent;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<rt-require dependency="./../energy/energy.component" as="EnergyComponent"/>
|
||||
<rt-require dependency="./../power/power.component" as="PowerComponent"/>
|
||||
<rt-require dependency="./../energy/energy.component" as="Energy"/>
|
||||
<rt-require dependency="./../power/power.component" as="Power"/>
|
||||
<div id="layout">
|
||||
<div rt-if="!this.house" id="about">
|
||||
<div class="panel panel-default">
|
||||
@@ -75,16 +75,16 @@
|
||||
</div>
|
||||
</div><br/>
|
||||
|
||||
<EnergyComponent
|
||||
rt-if="this.state.dataset === 'energy'"
|
||||
<Energy
|
||||
rt-if="this.should_show_energy_data"
|
||||
house="{this.state.house}"
|
||||
loading_energy_data="{this.state.loading_energy_data}"
|
||||
state_manager="{this.state_manager}"
|
||||
view="{this.state.view}"
|
||||
graph_attr="{this.state.graph_attr}"
|
||||
year="{this.state.year}" />
|
||||
<PowerComponent
|
||||
rt-if="this.state.dataset === 'power'"
|
||||
<Power
|
||||
rt-if="this.should_show_power_data"
|
||||
house="{this.state.house}"
|
||||
loading_power_data="{this.state.loading_power_data}"
|
||||
state_manager="{this.state_manager}"
|
||||
|
||||
Reference in New Issue
Block a user