From 2da2b631ee0d158183ef4c7c0a41fd589daeaf0f Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Tue, 7 Apr 2020 00:31:07 +0200 Subject: [PATCH] Fixed scrollView warning --- src/screens/Amicale/ProfileScreen.js | 32 ++++++++++++++++++++++------ 1 file changed, 26 insertions(+), 6 deletions(-) diff --git a/src/screens/Amicale/ProfileScreen.js b/src/screens/Amicale/ProfileScreen.js index b01d17b..774b6c9 100644 --- a/src/screens/Amicale/ProfileScreen.js +++ b/src/screens/Amicale/ProfileScreen.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import {FlatList, ScrollView, StyleSheet} from "react-native"; +import {FlatList, StyleSheet, View} from "react-native"; import {Avatar, Button, Card, Divider, List, withTheme} from 'react-native-paper'; import AuthenticatedScreen from "../../components/Amicale/AuthenticatedScreen"; import {openBrowser} from "../../utils/WebBrowser"; @@ -28,9 +28,16 @@ class ProfileScreen extends React.Component { data: Object; + flatListData: Array; + constructor(props) { super(props); this.colors = props.theme.colors; + this.flatListData = [ + {id: '0'}, + {id: '1'}, + {id: '2'}, + ] } componentDidMount() { @@ -51,19 +58,32 @@ class ProfileScreen extends React.Component { getScreen = (data: Object) => { this.data = data[0]; return ( - - {this.getPersonalCard()} - {this.getClubCard()} - {this.getMembershipCar()} + + {/*$FlowFixMe*/} + - + ) }; + getRenderItem = ({item}: Object) => { + switch (item.id) { + case '0': + return this.getPersonalCard(); + case '1': + return this.getClubCard(); + case '2': + return this.getMembershipCar(); + } + }; + getPersonalCard() { return (