Skip to content

Commit

Permalink
ListView added noTopBorder props and fix style prop
Browse files Browse the repository at this point in the history
  • Loading branch information
budiadiono committed Oct 4, 2018
1 parent 86ce058 commit 81b10cf
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/components/ListView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React from 'react'
import {
FlatList,
RefreshControl,
StyleProp,
StyleSheet,
Text,
ViewStyle
Expand All @@ -13,8 +14,9 @@ export interface ListViewProps<T> {
key?: keyof T
renderItem: (item: T) => React.ReactElement<any>
onRefresh?: () => Promise<any>
containerStyle?: ViewStyle
containerStyle?: StyleProp<ViewStyle>
title?: string
noTopBorder?: boolean
}

interface ListViewState {
Expand All @@ -39,11 +41,18 @@ export class ListView<T> extends React.Component<
data,
renderItem,
onRefresh,
title
title,
noTopBorder
} = this.props

return (
<List containerStyle={[styles.container, containerStyle]}>
<List
containerStyle={[
styles.container,
noTopBorder ? { borderTopWidth: 0 } : {},
containerStyle
]}
>
{title && (
<Text style={{ marginHorizontal: 20, marginTop: 10, fontSize: 18 }}>
{title}
Expand Down

0 comments on commit 81b10cf

Please sign in to comment.