UNPKG

1.17 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 { TouchableWithoutFeedback, StyleSheet } from 'react-native';
14import { withTheme } from '../config';
15import Button from './Button';
16const Chip = (props) => {
17 const { titleStyle, buttonStyle } = props, rest = __rest(props, ["titleStyle", "buttonStyle"]);
18 return (<Button titleStyle={StyleSheet.flatten([
19 { fontSize: 14, paddingHorizontal: 2 },
20 titleStyle,
21 ])} buttonStyle={StyleSheet.flatten([{ borderRadius: 30 }, buttonStyle])} {...(props.onPress === undefined && {
22 TouchableComponent: TouchableWithoutFeedback,
23 })} {...rest}/>);
24};
25export { Chip };
26export default withTheme(Chip, 'Chip');
27
\No newline at end of file