@@ -3,27 +3,28 @@ import React, {Component} from 'react';
3
3
import { ScrollView , View , Text , StyleSheet , Dimensions } from 'react-native' ;
4
4
import { Colors , Shadows } from 'react-native-ui-lib' ; // eslint-disable-line
5
5
6
-
7
6
const { height} = Dimensions . get ( 'window' ) ;
8
7
const SHAPE_DIAMETER = 80 ;
9
8
10
- const shadowsOverWhiteBkg = _ . reduce ( Shadows , ( results , value , key ) => {
11
- if ( key . startsWith ( 'white' ) ) {
12
- results [ key ] = value ;
13
- }
14
- return results ;
15
- } , { } ) ;
16
-
17
- const shadowsOverDarkBkg = _ . reduce ( Shadows , ( results , value , key ) => {
18
- if ( key . startsWith ( 'dark' ) ) {
19
- results [ key ] = value ;
20
- }
21
- return results ;
22
- } , { } ) ;
9
+ const shadowsOverWhiteBkg = _ . reduce ( Shadows ,
10
+ ( results , value , key ) => {
11
+ if ( key . startsWith ( 'white' ) ) {
12
+ results [ key ] = value ;
13
+ }
14
+ return results ;
15
+ } ,
16
+ { } ) ;
23
17
18
+ const shadowsOverGreyBkg = _ . reduce ( Shadows ,
19
+ ( results , value , key ) => {
20
+ if ( key . startsWith ( 'grey' ) ) {
21
+ results [ key ] = value ;
22
+ }
23
+ return results ;
24
+ } ,
25
+ { } ) ;
24
26
25
27
export default class ShadowsScreen extends Component {
26
-
27
28
renderShadows ( shadowsList ) {
28
29
return [ ]
29
30
. concat ( _ . map ( shadowsList , ( value , key ) => this . renderCircleWithShadow ( value , key ) ) )
@@ -59,12 +60,8 @@ export default class ShadowsScreen extends Component {
59
60
</ View >
60
61
< ScrollView >
61
62
< View style = { styles . container } >
62
- < View style = { styles . subContainer } >
63
- { this . renderShadows ( shadowsOverDarkBkg ) }
64
- </ View >
65
- < View style = { styles . subContainer } >
66
- { this . renderShadows ( shadowsOverWhiteBkg ) }
67
- </ View >
63
+ < View style = { styles . subContainer } > { this . renderShadows ( shadowsOverGreyBkg ) } </ View >
64
+ < View style = { styles . subContainer } > { this . renderShadows ( shadowsOverWhiteBkg ) } </ View >
68
65
</ View >
69
66
</ ScrollView >
70
67
</ View >
@@ -76,14 +73,14 @@ const styles = StyleSheet.create({
76
73
container : {
77
74
flexDirection : 'row' ,
78
75
flex : 1 ,
79
- justifyContent : 'space-between' ,
76
+ justifyContent : 'space-between'
80
77
} ,
81
78
subContainer : {
82
79
flex : 1 ,
83
80
flexDirection : 'column' ,
84
81
minHeight : 0.8 * height ,
85
82
alignItems : 'center' ,
86
- justifyContent : 'space-between' ,
83
+ justifyContent : 'space-between'
87
84
} ,
88
85
shadowCircle : {
89
86
width : SHAPE_DIAMETER ,
@@ -92,32 +89,32 @@ const styles = StyleSheet.create({
92
89
backgroundColor : 'white' ,
93
90
margin : 40 ,
94
91
justifyContent : 'center' ,
95
- alignItems : 'center' ,
92
+ alignItems : 'center'
96
93
} ,
97
94
innerCircle : {
98
95
width : SHAPE_DIAMETER ,
99
96
height : SHAPE_DIAMETER ,
100
97
borderRadius : SHAPE_DIAMETER / 2 ,
101
98
backgroundColor : 'white' ,
102
- justifyContent : 'center' ,
99
+ justifyContent : 'center'
103
100
} ,
104
101
shadowSquare : {
105
102
width : SHAPE_DIAMETER ,
106
103
height : SHAPE_DIAMETER ,
107
104
borderRadius : 6 ,
108
105
backgroundColor : 'white' ,
109
106
margin : 40 ,
110
- justifyContent : 'center' ,
107
+ justifyContent : 'center'
111
108
} ,
112
109
innerSquare : {
113
110
width : SHAPE_DIAMETER ,
114
111
height : SHAPE_DIAMETER ,
115
112
borderRadius : 6 ,
116
113
backgroundColor : 'white' ,
117
- justifyContent : 'center' ,
114
+ justifyContent : 'center'
118
115
} ,
119
116
shadowLabel : {
120
117
fontSize : 9 ,
121
- textAlign : 'center' ,
122
- } ,
118
+ textAlign : 'center'
119
+ }
123
120
} ) ;
0 commit comments