Remove loading screen again
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
import React, { Component } from 'react'
|
import React, { Component } from 'react'
|
||||||
import { View, FlatList, Dimensions } from 'react-native'
|
import { View, FlatList } from 'react-native'
|
||||||
import range from 'date-range'
|
import range from 'date-range'
|
||||||
import { LocalDate } from 'js-joda'
|
import { LocalDate } from 'js-joda'
|
||||||
import { yAxis, normalizeToScale } from './y-axis'
|
import { yAxis, normalizeToScale } from './y-axis'
|
||||||
@@ -29,11 +29,9 @@ export default class CycleChart extends Component {
|
|||||||
constructor(props) {
|
constructor(props) {
|
||||||
super(props)
|
super(props)
|
||||||
this.state = {
|
this.state = {
|
||||||
columns: makeColumnInfo(config.xAxisRangeInDays),
|
columns: makeColumnInfo(config.xAxisRangeInDays)
|
||||||
loading: true
|
|
||||||
}
|
}
|
||||||
this.renderColumn = ({item, index}) => {
|
this.renderColumn = ({item, index}) => {
|
||||||
if (index === 15 + 1 && this.state.loading) this.setState({loading: false})
|
|
||||||
return (
|
return (
|
||||||
<DayColumn
|
<DayColumn
|
||||||
item={item}
|
item={item}
|
||||||
@@ -59,15 +57,7 @@ export default class CycleChart extends Component {
|
|||||||
|
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const {height, width} = Dimensions.get('window')
|
|
||||||
return (
|
return (
|
||||||
<View>
|
|
||||||
{this.state.loading &&
|
|
||||||
<View
|
|
||||||
width={width}
|
|
||||||
height={height}
|
|
||||||
backgroundColor='lightblue'
|
|
||||||
/>}
|
|
||||||
<View style={{ flexDirection: 'row' }}>
|
<View style={{ flexDirection: 'row' }}>
|
||||||
{yAxisView}
|
{yAxisView}
|
||||||
<FlatList
|
<FlatList
|
||||||
@@ -80,7 +70,6 @@ export default class CycleChart extends Component {
|
|||||||
>
|
>
|
||||||
</FlatList>
|
</FlatList>
|
||||||
</View>
|
</View>
|
||||||
</View>
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user