UNPKG

1.23 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, View } from 'react-native';
14import { withTheme } from '../config';
15const ListItemContent = (_a) => {
16 var { style, right, children } = _a, props = __rest(_a, ["style", "right", "children"]);
17 const containerStyle = right ? styles.rightContainer : styles.container;
18 return (<View style={[containerStyle, style]} {...props}>
19 {children}
20 </View>);
21};
22const styles = StyleSheet.create({
23 container: {
24 flex: 1,
25 justifyContent: 'center',
26 alignItems: 'flex-start',
27 },
28 rightContainer: {
29 flex: 0.5,
30 justifyContent: 'center',
31 alignItems: 'flex-end',
32 },
33});
34export default withTheme(ListItemContent, 'ListItemContent');