From 863ac6b122fc93d8cda9e601876235931f28b904 Mon Sep 17 00:00:00 2001 From: Julia Friesel <julia.friesel@gmail.com> Date: Fri, 10 Aug 2018 13:26:34 +0200 Subject: [PATCH] Remove loading screen again --- components/chart/chart.js | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) diff --git a/components/chart/chart.js b/components/chart/chart.js index 604966eb..6e7da685 100644 --- a/components/chart/chart.js +++ b/components/chart/chart.js @@ -1,5 +1,5 @@ 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> ) } -- GitLab