1
- import React , { Component } from 'react' ;
2
- import { ScrollView , StyleSheet } from 'react-native' ;
3
1
import _ from 'lodash' ;
4
- import { View , Assets , Constants , Card , Button , Colors , Typography , Text } from 'react-native-ui-lib' ; //eslint-disable-line
2
+ import React , { Component } from 'react' ;
3
+ import { StyleSheet , ScrollView } from 'react-native' ;
4
+ import { Colors , View , Card , Button , Text } from 'react-native-ui-lib' ; //eslint-disable-line
5
5
import posts from '../../data/posts' ;
6
6
7
+
7
8
const featureIcon = require ( '../../assets/icons/star.png' ) ;
8
9
const shareIcon = require ( '../../assets/icons/share.png' ) ;
9
10
const cardImage = require ( '../../assets/images/card-example.jpg' ) ;
10
11
const cardImage2 = require ( '../../assets/images/empty-state.jpg' ) ;
11
12
12
- export default class ButtonsScreen extends Component {
13
+ export default class CardsScreen extends Component {
14
+
13
15
render ( ) {
14
16
return (
15
17
< ScrollView contentContainerStyle = { styles . container } >
16
- < ScrollView
17
- horizontal
18
- height = { 100 }
19
- style = { { marginBottom : 20 , padding : 10 } }
20
- showsHorizontalScrollIndicator = { false }
21
- >
22
- { _ . times ( 4 , ( i ) => {
23
- return (
24
- < Card shadowType = "white10" key = { i } width = { 100 } containerStyle = { { marginRight : 20 } } >
25
- < View padding-15 >
26
- < Text text30 dark30 >
27
- { i }
28
- </ Text >
29
- </ View >
30
- </ Card >
31
- ) ;
32
- } ) }
33
- </ ScrollView >
18
+ < View flex >
19
+ < View style = { { backgroundColor : 'red' , width : 50 , height : '100%' , position : 'absolute' , top : 0 , left : 200 , bottom : 0 } } />
20
+ < ScrollView
21
+ horizontal
22
+ height = { 100 }
23
+ style = { { marginBottom : 20 , padding : 10 } }
24
+ showsHorizontalScrollIndicator = { false }
25
+ >
26
+ { _ . times ( 4 , ( i ) => {
27
+ return (
28
+ < Card shadowType = "white10" key = { i } width = { 100 } containerStyle = { { marginRight : 20 } } >
29
+ < View padding-15 >
30
+ < Text text30 dark30 >
31
+ { i }
32
+ </ Text >
33
+ </ View >
34
+ </ Card >
35
+ ) ;
36
+ } ) }
37
+ </ ScrollView >
34
38
35
- < View marginV-20 >
36
- < Card height = { 120 } width = { 120 } >
39
+ < Card height = { 120 } width = { 120 } marginV-20 >
37
40
< Card . Image height = { '100%' } imageSource = { cardImage } />
38
41
</ Card >
39
- </ View >
40
-
41
- < View marginB-20 >
42
+
42
43
< Card
44
+ marginB-20
43
45
height = { 150 }
44
46
shadowType = "white10"
45
- style = { { backgroundColor : Colors . dark60 } }
47
+ style = { { backgroundColor : Colors . rgba ( Colors . dark60 , 0.75 ) } }
48
+ // containerStyle={{backgroundColor: 'transparent'}}
46
49
shadowColor = { Colors . purple10 }
47
50
>
48
51
< View flex padding-20 >
@@ -51,103 +54,123 @@ export default class ButtonsScreen extends Component {
51
54
</ Text >
52
55
</ View >
53
56
</ Card >
54
- </ View >
55
57
56
- < Card row height = { 160 } containerStyle = { { marginBottom : 15 } } onPress = { ( ) => { } } >
57
- < Card . Image width = { 115 } imageSource = { cardImage } />
58
- < Card . Section body >
59
- < Card . Section >
60
- < Text text70 dark10 >
61
- You’re Invited!
62
- </ Text >
63
- </ Card . Section >
64
- < Card . Section >
65
- < Text text80 dark10 >
66
- Join Old The Town Barbershop Official Store. Download the Wix app to...
58
+ < Card
59
+ marginB-20
60
+ height = { 80 }
61
+ shadowType = "white10"
62
+ style = { { backgroundColor : Colors . rgba ( Colors . dark60 , 0.5 ) } }
63
+ // containerStyle={{backgroundColor: 'transparent'}}
64
+ shadowColor = { Colors . purple10 }
65
+ enableBlur
66
+ onPress = { ( ) => { } }
67
+ >
68
+ < View flex padding-20 >
69
+ < Text text50 dark20 >
70
+ With Blue effect
67
71
</ Text >
68
- </ Card . Section >
69
- < Card . Section footer >
70
- < Text text90 dark50 >
71
- wix.to/A465c
72
+ < Text text80 dark20 >
73
+ Must pass style backgroundColor as rgba
72
74
</ Text >
73
- </ Card . Section >
74
- </ Card . Section >
75
- </ Card >
75
+ </ View >
76
+ </ Card >
76
77
77
- < Card shadowType = "white10" row height = { 160 } containerStyle = { { marginBottom : 15 } } onPress = { ( ) => { } } br10 >
78
- < Card . Section body >
79
- < Card . Section >
80
- < Text text70 dark10 >
81
- You’re Invited!
82
- </ Text >
83
- </ Card . Section >
84
- < Card . Section >
85
- < Text text80 dark10 >
86
- Join Old The Town Barbershop Official Store. Download the Wix app to...
87
- </ Text >
88
- </ Card . Section >
89
- < Card . Section footer >
90
- < Text text90 dark50 >
91
- wix.to/A465c
92
- </ Text >
78
+ < Card row height = { 160 } containerStyle = { { marginBottom : 15 } } onPress = { ( ) => { } } enableBlur >
79
+ < Card . Image width = { 115 } imageSource = { cardImage } />
80
+ < Card . Section body >
81
+ < Card . Section >
82
+ < Text text70 dark10 >
83
+ You’re Invited!
84
+ </ Text >
85
+ </ Card . Section >
86
+ < Card . Section >
87
+ < Text text80 dark10 >
88
+ Join Old The Town Barbershop Official Store. Download the Wix app to...
89
+ </ Text >
90
+ </ Card . Section >
91
+ < Card . Section footer >
92
+ < Text text90 dark50 >
93
+ wix.to/A465c
94
+ </ Text >
95
+ </ Card . Section >
93
96
</ Card . Section >
94
- </ Card . Section >
95
- < Card . Image width = { 115 } imageSource = { cardImage } />
96
- </ Card >
97
+ </ Card >
97
98
98
- < Card containerStyle = { { marginBottom : 15 } } onPress = { ( ) => { } } >
99
- < Card . Section body >
100
- < Card . Section >
101
- < Text text70 dark10 >
102
- You’re Invited!
103
- </ Text >
99
+ < Card shadowType = "white10" row height = { 160 } containerStyle = { { marginBottom : 15 } } onPress = { ( ) => { } } br10 >
100
+ < Card . Section body >
101
+ < Card . Section >
102
+ < Text text70 dark10 >
103
+ You’re Invited!
104
+ </ Text >
105
+ </ Card . Section >
106
+ < Card . Section >
107
+ < Text text80 dark10 >
108
+ Join Old The Town Barbershop Official Store. Download the Wix app to...
109
+ </ Text >
110
+ </ Card . Section >
111
+ < Card . Section footer >
112
+ < Text text90 dark50 >
113
+ wix.to/A465c
114
+ </ Text >
115
+ </ Card . Section >
104
116
</ Card . Section >
105
- < Card . Section footer >
106
- < Text text90 dark50 >
107
- join now
108
- </ Text >
117
+ < Card . Image width = { 115 } imageSource = { cardImage } />
118
+ </ Card >
119
+
120
+ < Card containerStyle = { { marginBottom : 15 } } onPress = { ( ) => { } } >
121
+ < Card . Section body >
122
+ < Card . Section >
123
+ < Text text70 dark10 >
124
+ You’re Invited!
125
+ </ Text >
126
+ </ Card . Section >
127
+ < Card . Section footer >
128
+ < Text text90 dark50 >
129
+ join now
130
+ </ Text >
131
+ </ Card . Section >
109
132
</ Card . Section >
110
- </ Card . Section >
111
- < Card . Image height = { 120 } imageSource = { cardImage2 } />
112
- </ Card >
133
+ < Card . Image height = { 120 } imageSource = { cardImage2 } />
134
+ </ Card >
113
135
114
- { _ . map ( posts , ( post , i ) => {
115
- const statusColor = post . status === 'Published' ? Colors . green30 : Colors . orange30 ;
116
- return (
117
- < Card key = { i } containerStyle = { { marginBottom : 15 } } onPress = { ( ) => console . log ( 'press on a card' ) } >
118
- < Card . Image height = { 160 } imageSource = { post . coverImage } />
119
- < Card . Section body >
120
- < Card . Section >
121
- < Text text40 color = { Colors . dark10 } >
122
- { post . title }
123
- </ Text >
124
- </ Card . Section >
125
- < Card . Section >
126
- < Card . Item >
127
- < Text text90 color = { statusColor } >
128
- { post . status }
136
+ { _ . map ( posts , ( post , i ) => {
137
+ const statusColor = post . status === 'Published' ? Colors . green30 : Colors . orange30 ;
138
+ return (
139
+ < Card key = { i } containerStyle = { { marginBottom : 15 } } onPress = { ( ) => console . log ( 'press on a card' ) } >
140
+ < Card . Image height = { 160 } imageSource = { post . coverImage } />
141
+ < Card . Section body >
142
+ < Card . Section >
143
+ < Text text40 color = { Colors . dark10 } >
144
+ { post . title }
129
145
</ Text >
130
- < Text text90 > | { post . timestamp } </ Text >
131
- </ Card . Item >
132
- </ Card . Section >
133
- < Card . Section >
134
- < Text text70 color = { Colors . dark10 } >
135
- { post . description }
136
- </ Text >
137
- </ Card . Section >
138
- < Card . Section footer >
139
- < Text text90 color = { Colors . dark50 } >
140
- { post . likes } Likes
141
- </ Text >
142
- < Card . Item >
143
- < Button style = { { marginRight : 10 } } text90 link iconSource = { featureIcon } label = "Feature" />
144
- < Button text90 link iconSource = { shareIcon } label = "Share" />
145
- </ Card . Item >
146
+ </ Card . Section >
147
+ < Card . Section >
148
+ < Card . Item >
149
+ < Text text90 color = { statusColor } >
150
+ { post . status }
151
+ </ Text >
152
+ < Text text90 > | { post . timestamp } </ Text >
153
+ </ Card . Item >
154
+ </ Card . Section >
155
+ < Card . Section >
156
+ < Text text70 color = { Colors . dark10 } >
157
+ { post . description }
158
+ </ Text >
159
+ </ Card . Section >
160
+ < Card . Section footer >
161
+ < Text text90 color = { Colors . dark50 } >
162
+ { post . likes } Likes
163
+ </ Text >
164
+ < Card . Item >
165
+ < Button style = { { marginRight : 10 } } text90 link iconSource = { featureIcon } label = "Feature" />
166
+ < Button text90 link iconSource = { shareIcon } label = "Share" />
167
+ </ Card . Item >
168
+ </ Card . Section >
146
169
</ Card . Section >
147
- </ Card . Section >
148
- </ Card >
149
- ) ;
150
- } ) }
170
+ </ Card >
171
+ ) ;
172
+ } ) }
173
+ </ View >
151
174
</ ScrollView >
152
175
) ;
153
176
}
@@ -156,6 +179,6 @@ export default class ButtonsScreen extends Component {
156
179
const styles = StyleSheet . create ( {
157
180
container : {
158
181
padding : 15 ,
159
- backgroundColor : Colors . white ,
182
+ backgroundColor : Colors . yellow80 ,
160
183
} ,
161
184
} ) ;
0 commit comments