1 | function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
2 |
|
3 | import * as React from 'react';
|
4 | import color from 'color';
|
5 | import { StyleSheet, View } from 'react-native';
|
6 | import { withTheme } from '../core/theming';
|
7 | import { black, white } from '../styles/colors';
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 | const Divider = _ref => {
|
37 | let {
|
38 | inset,
|
39 | style,
|
40 | theme,
|
41 | ...rest
|
42 | } = _ref;
|
43 | const {
|
44 | dark: isDarkTheme
|
45 | } = theme;
|
46 | return React.createElement(View, _extends({}, rest, {
|
47 | style: [isDarkTheme ? styles.dark : styles.light, inset && styles.inset, style]
|
48 | }));
|
49 | };
|
50 |
|
51 | const styles = StyleSheet.create({
|
52 | light: {
|
53 | backgroundColor: color(black).alpha(0.12).rgb().string(),
|
54 | height: StyleSheet.hairlineWidth
|
55 | },
|
56 | dark: {
|
57 | backgroundColor: color(white).alpha(0.12).rgb().string(),
|
58 | height: StyleSheet.hairlineWidth
|
59 | },
|
60 | inset: {
|
61 | marginLeft: 72
|
62 | }
|
63 | });
|
64 | export default withTheme(Divider);
|
65 |
|
\ | No newline at end of file |