UNPKG

1.44 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 ListItemSubtitle = (_a) => {
18 var { style, right, children } = _a, props = __rest(_a, ["style", "right", "children"]);
19 return (<Text testID="listItemTitle" style={StyleSheet.flatten([
20 styles.subtitle,
21 right && styles.rightSubtitle,
22 style,
23 ])} {...props}>
24 {children}
25 </Text>);
26};
27const styles = StyleSheet.create({
28 subtitle: Object.assign({ backgroundColor: 'transparent' }, Platform.select({
29 ios: {
30 fontSize: 15,
31 },
32 default: {
33 color: ANDROID_SECONDARY,
34 fontSize: 14,
35 },
36 })),
37 rightSubtitle: {
38 color: ANDROID_SECONDARY,
39 },
40});
41export default withTheme(ListItemSubtitle, 'ListItemSubtitle');