|
@@ -4,18 +4,37 @@ import * as React from 'react';
|
4
|
4
|
import {View} from 'react-native';
|
5
|
5
|
import {withTheme} from 'react-native-paper';
|
6
|
6
|
|
7
|
|
-function Cell(props) {
|
8
|
|
- const colors = props.theme.colors;
|
9
|
|
- return (
|
10
|
|
- <View style={{
|
11
|
|
- flex: 1,
|
12
|
|
- backgroundColor: props.color,
|
13
|
|
- borderColor: props.isEmpty ? props.color : "#393939",
|
14
|
|
- borderStyle: 'solid',
|
15
|
|
- borderWidth: 1,
|
16
|
|
- aspectRatio: 1,
|
17
|
|
- }}/>
|
18
|
|
- );
|
|
7
|
+type Props = {
|
|
8
|
+ color: string,
|
|
9
|
+ isEmpty: boolean,
|
|
10
|
+ id: string,
|
|
11
|
+}
|
|
12
|
+
|
|
13
|
+class Cell extends React.PureComponent<Props> {
|
|
14
|
+
|
|
15
|
+ colors: Object;
|
|
16
|
+
|
|
17
|
+ constructor(props) {
|
|
18
|
+ super(props);
|
|
19
|
+ this.colors = props.theme.colors;
|
|
20
|
+ }
|
|
21
|
+
|
|
22
|
+ render() {
|
|
23
|
+ return (
|
|
24
|
+ <View
|
|
25
|
+ style={{
|
|
26
|
+ flex: 1,
|
|
27
|
+ backgroundColor: this.props.color,
|
|
28
|
+ borderColor: this.props.isEmpty ? this.props.color : "#393939",
|
|
29
|
+ borderStyle: 'solid',
|
|
30
|
+ borderWidth: 1,
|
|
31
|
+ aspectRatio: 1,
|
|
32
|
+ }}
|
|
33
|
+ />
|
|
34
|
+ );
|
|
35
|
+ }
|
|
36
|
+
|
|
37
|
+
|
19
|
38
|
}
|
20
|
39
|
|
21
|
40
|
export default withTheme(Cell);
|