1 | import React from 'react';
|
2 | import { View, } from 'react-native';
|
3 | export class CheckboxDefaultProps {
|
4 | constructor() {
|
5 | this.checked = false;
|
6 | }
|
7 | }
|
8 | const Checkbox = ({ checked, }) => {
|
9 | return (React.createElement(View, { style: Style[checked ? 'active' : 'normal'] }, checked && (React.createElement(View, { style: Style.check }))));
|
10 | };
|
11 | const Style = {
|
12 | normal: {
|
13 | width: 16,
|
14 | height: 16,
|
15 | borderRadius: 8,
|
16 | borderWidth: 1,
|
17 | borderColor: '#9c9c9c',
|
18 | },
|
19 | active: {
|
20 | width: 16,
|
21 | height: 16,
|
22 | backgroundColor: '#fc5100',
|
23 | borderRadius: 8,
|
24 | alignItems: 'center',
|
25 | justifyContent: 'center',
|
26 | },
|
27 | check: {
|
28 | width: 9,
|
29 | height: 6,
|
30 | borderLeftWidth: 1,
|
31 | borderBottomWidth: 1,
|
32 | borderColor: '#fff',
|
33 | transform: [
|
34 | { translateY: -2 },
|
35 | { rotate: '-44deg' },
|
36 | ],
|
37 | },
|
38 | };
|
39 | export default Checkbox;
|
40 |
|
\ | No newline at end of file |