Skip to content
Snippets Groups Projects
Commit 863ac6b1 authored by Julia Friesel's avatar Julia Friesel
Browse files

Remove loading screen again

parent 611e9057
No related branches found
No related tags found
No related merge requests found
import React, { Component } from 'react'
import { View, FlatList, Dimensions } from 'react-native'
import { View, FlatList } from 'react-native'
import range from 'date-range'
import { LocalDate } from 'js-joda'
import { yAxis, normalizeToScale } from './y-axis'
......@@ -29,11 +29,9 @@ export default class CycleChart extends Component {
constructor(props) {
super(props)
this.state = {
columns: makeColumnInfo(config.xAxisRangeInDays),
loading: true
columns: makeColumnInfo(config.xAxisRangeInDays)
}
this.renderColumn = ({item, index}) => {
if (index === 15 + 1 && this.state.loading) this.setState({loading: false})
return (
<DayColumn
item={item}
......@@ -59,27 +57,18 @@ export default class CycleChart extends Component {
render() {
const {height, width} = Dimensions.get('window')
return (
<View>
{this.state.loading &&
<View
width={width}
height={height}
backgroundColor='lightblue'
/>}
<View style={{ flexDirection: 'row' }}>
{yAxisView}
<FlatList
horizontal={true}
inverted={true}
showsHorizontalScrollIndicator={false}
data={this.state.columns}
renderItem={this.renderColumn}
keyExtractor={item => item.dateString}
>
</FlatList>
</View>
<View style={{ flexDirection: 'row' }}>
{yAxisView}
<FlatList
horizontal={true}
inverted={true}
showsHorizontalScrollIndicator={false}
data={this.state.columns}
renderItem={this.renderColumn}
keyExtractor={item => item.dateString}
>
</FlatList>
</View>
)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment