Skip to content

Commit 3ce8c70

Browse files
authored
Merge pull request #1227 from StoDevX/tableviewsimpletypes
Add typedef for react-native-tableview-simple
2 parents 33a2d87 + 56258ac commit 3ce8c70

File tree

6 files changed

+74
-25
lines changed

6 files changed

+74
-25
lines changed
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// flow-typed signature: d916d5f731b562dc8f43492510e541f5
2+
// flow-typed version: <<STUB>>/react-native-tableview-simple_v0.13.0/flow_v0.35.0
3+
4+
import {Image} from 'react-native'
5+
6+
type Style = Object | number | Array<Style>;
7+
8+
type TableviewProps = {||};
9+
10+
type SectionProps = {|
11+
allowFontScaling?: boolean,
12+
footerComponent?: React$Element<*>,
13+
headerComponent?: React$Element<*>,
14+
footer?: string,
15+
footerTextColor?: string,
16+
header?: string,
17+
headerTextColor?: string,
18+
hideSeparator?: boolean,
19+
sectionTintColor?: string,
20+
separatorInsetLeft?: number,
21+
separatorInsetRight?: number,
22+
separatorTintColor?: string,
23+
|};
24+
25+
type CellProps = {|
26+
accessory?: 'DisclosureIndicator' | 'Detail' | 'DetailDisclosure' | 'Checkmark',
27+
accessoryColor?: string,
28+
allowFontScaling?: boolean,
29+
backgroundColor?: string,
30+
cellStyle?: 'Basic' | 'RightDetail' | 'LeftDetail' | 'Subtitle',
31+
cellAccessoryView?: React$Element<*>,
32+
cellContentView?: React$Element<*>,
33+
cellImageView?: React$Element<*>,
34+
contentContainerStyle?: Style,
35+
detail?: string | number | React$Element<*>,
36+
detailTextStyle?: Style,
37+
disableImageResize?: boolean,
38+
highlightActiveOpacity?: number,
39+
highlightUnderlayColor?: string,
40+
isDisabled?: boolean,
41+
image?: Image,
42+
leftDetailColor?: string,
43+
rightDetailColor?: string,
44+
title?: string | number | React$Element<*>,
45+
titleTextColor?: string,
46+
titleTextStyle?: Style,
47+
titleTextStyleDisabled?: Style,
48+
onPress?: (e: any) => any,
49+
|};
50+
51+
/**
52+
* This is an autogenerated libdef stub for:
53+
*
54+
* 'react-native-tableview-simple'
55+
*
56+
* Fill this stub out by replacing all the `any` types.
57+
*
58+
* Once filled out, we encourage you to share your work with the
59+
* community by sending a pull request to:
60+
* https://github.com/flowtype/flow-typed
61+
*/
62+
63+
declare module 'react-native-tableview-simple' {
64+
declare export var TableView: Class<React$Component<void, TableviewProps, any>>;
65+
declare export var Section: Class<React$Component<void, SectionProps, any>>;
66+
declare export var Cell: Class<React$Component<void, CellProps, any>>;
67+
}

flow-typed/npm/react-native-tableview-simple_vx.x.x.js

Lines changed: 0 additions & 18 deletions
This file was deleted.

source/views/building-hours/detail/schedule-row.ios.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export class ScheduleRow extends React.PureComponent {
2424
<Cell
2525
cellStyle="RightDetail"
2626
title={summarizeDays(set.days)}
27-
titleTextStyle={isActive ? styles.bold : null}
27+
titleTextStyle={isActive ? styles.bold : undefined}
2828
detail={formatBuildingTimes(set, now)}
29-
detailTextStyle={isActive ? styles.bold : null}
29+
detailTextStyle={isActive ? styles.bold : undefined}
3030
/>
3131
)
3232
}

source/views/calendar/event-detail.ios.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ function Links({header, content}: {header: string, content: string}) {
4747
{links.map(url =>
4848
<Cell
4949
key={url}
50-
cellStyle="Title"
5150
title={url}
5251
accessory="DisclosureIndicator"
5352
onPress={() => openUrl(url)}

source/views/components/filter/section-list.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,11 @@ export function ListSection({filter, onChange}: PropsType) {
7070
onPress={() => buttonPushed(val)}
7171
disableImageResize={true}
7272
image={
73-
spec.showImages && <Image style={styles.icon} source={val.image} />
73+
spec.showImages
74+
? <Image style={styles.icon} source={val.image} />
75+
: undefined
7476
}
75-
accessory={includes(selected, val) && 'Checkmark'}
77+
accessory={includes(selected, val) ? 'Checkmark' : undefined}
7678
cellStyle="RightDetail"
7779
cellContentView={
7880
<Column style={styles.content}>
@@ -89,7 +91,7 @@ export function ListSection({filter, onChange}: PropsType) {
8991
key="__show_all"
9092
title="Show All"
9193
onPress={showAll}
92-
accessory={selected.length === options.length ? 'Checkmark' : null}
94+
accessory={selected.length === options.length ? 'Checkmark' : undefined}
9395
/>
9496
)
9597
buttons = [showAllButton].concat(buttons)

source/views/sis/student-work/detail.ios.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ function Links({job}: {job: JobType}) {
8888
{links.map(url =>
8989
<Cell
9090
key={url}
91-
cellStyle="Title"
9291
title={url}
9392
accessory="DisclosureIndicator"
9493
onPress={() => openUrl(url)}

0 commit comments

Comments
 (0)