UNPKG

1.38 kBJavaScriptView Raw
1var __rest = (this && this.__rest) || function (s, e) {
2 var t = {};
3 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4 t[p] = s[p];
5 if (s != null && typeof Object.getOwnPropertySymbols === "function")
6 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8 t[p[i]] = s[p[i]];
9 }
10 return t;
11};
12import React from 'react';
13import { StyleSheet, Platform } from 'react-native';
14import { withTheme } from '../config';
15import Text from '../text/Text';
16const ANDROID_SECONDARY = 'rgba(0, 0, 0, 0.54)';
17const ListItemTitle = (_a) => {
18 var { style, right, children } = _a, props = __rest(_a, ["style", "right", "children"]);
19 return (<Text testID="listItemTitle" style={StyleSheet.flatten([
20 styles.title,
21 right && styles.rightTitle,
22 style,
23 ])} {...props}>
24 {children}
25 </Text>);
26};
27const styles = StyleSheet.create({
28 title: Object.assign({ backgroundColor: 'transparent' }, Platform.select({
29 ios: {
30 fontSize: 17,
31 },
32 default: {
33 fontSize: 16,
34 },
35 })),
36 rightTitle: {
37 color: ANDROID_SECONDARY,
38 },
39});
40export default withTheme(ListItemTitle, 'ListItemTitle');