Show loading message
This commit is contained in:
@@ -98,8 +98,13 @@ export default class CycleChart extends Component {
|
|||||||
onLayout={this.onLayout}
|
onLayout={this.onLayout}
|
||||||
style={{ flexDirection: 'row', flex: 1 }}
|
style={{ flexDirection: 'row', flex: 1 }}
|
||||||
>
|
>
|
||||||
{!this.state.chartHeight && <Text>Loading...</Text>}
|
{!this.state.chartLoaded &&
|
||||||
{this.state.chartHeight &&
|
<View style={{width: '100%', justifyContent: 'center', alignItems: 'center'}}>
|
||||||
|
<Text>Loading...</Text>
|
||||||
|
</View>
|
||||||
|
}
|
||||||
|
|
||||||
|
{this.state.chartHeight && this.state.chartLoaded &&
|
||||||
<View
|
<View
|
||||||
style={[styles.yAxis, {
|
style={[styles.yAxis, {
|
||||||
height: columnHeight,
|
height: columnHeight,
|
||||||
@@ -109,7 +114,7 @@ export default class CycleChart extends Component {
|
|||||||
{makeYAxisLabels(columnHeight)}
|
{makeYAxisLabels(columnHeight)}
|
||||||
</View>}
|
</View>}
|
||||||
|
|
||||||
{this.state.chartHeight && makeHorizontalGrid(columnHeight, symptomRowHeight)}
|
{this.state.chartHeight && this.state.chartLoaded && makeHorizontalGrid(columnHeight, symptomRowHeight)}
|
||||||
|
|
||||||
{this.state.chartHeight &&
|
{this.state.chartHeight &&
|
||||||
<FlatList
|
<FlatList
|
||||||
@@ -121,6 +126,7 @@ export default class CycleChart extends Component {
|
|||||||
keyExtractor={item => item.dateString}
|
keyExtractor={item => item.dateString}
|
||||||
initialNumToRender={15}
|
initialNumToRender={15}
|
||||||
maxToRenderPerBatch={5}
|
maxToRenderPerBatch={5}
|
||||||
|
onLayout={() => this.setState({chartLoaded: true})}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
</View>
|
</View>
|
||||||
|
|||||||
Reference in New Issue
Block a user