diff options
| author | mo khan <mo@mokhan.ca> | 2016-12-24 15:53:57 -0700 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2016-12-24 15:53:57 -0700 |
| commit | 64d2f004a49ef340e921edc2dd6c04abda83c339 (patch) | |
| tree | a3c9ca60fea1de9200ebe301b8bee20bbf57f74c | |
| parent | 7508e1515d4cec84aba59df8d36816ea77c0a474 (diff) | |
do not use deckswiper on android.
| -rw-r--r-- | app/screens/dashboard-screen.js | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/app/screens/dashboard-screen.js b/app/screens/dashboard-screen.js index 7c346b5..ca3bc04 100644 --- a/app/screens/dashboard-screen.js +++ b/app/screens/dashboard-screen.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { Image } from 'react-native'; +import { Platform, View, Image } from 'react-native'; import { Container, Header, Title, Content, Footer, FooterTab, Button, Icon, Spinner, DeckSwiper } from 'native-base'; import ApplicationComponent from '../components/application-component'; import WorkoutSummary from '../components/workout-summary'; @@ -52,9 +52,15 @@ export default class DashboardScreen extends ApplicationComponent { renderWorkouts(workouts) { let renderEach = (workout) => <WorkoutSummary key={workout.id} {...workout} />; - return ( - <DeckSwiper dataSource={workouts} renderItem={renderEach} /> - ); + if (Platform.OS == 'ios') { + return ( + <DeckSwiper dataSource={workouts} renderItem={renderEach} /> + ); + } else { + return ( + <View>{workouts.map(renderEach)}</View> + ); + } } onLoadHistory() { |
