// @flow import * as React from 'react'; import {Animated} from "react-native"; import ImageListItem from "./ImageListItem"; import CardListItem from "./CardListItem"; type Props = { dataset: Array, isHorizontal: boolean, } export type cardItem = { title: string, subtitle: string, image: string | number, onPress: () => void, }; export type cardList = Array; export default class CardList extends React.Component { static defaultProps = { isHorizontal: false, } renderItem = ({item}: { item: cardItem }) => { if (this.props.isHorizontal) return ; else return ; }; keyExtractor = (item: cardItem) => item.title; render() { let containerStyle; if (this.props.isHorizontal) { containerStyle = { ...this.props.contentContainerStyle, height: 150, justifyContent: 'space-around', }; } else { containerStyle = { ...this.props.contentContainerStyle, } } return ( ); } }