Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Commit 45e8ce3

Browse files
committed
Replace CSS boxShadow with react native compatible params
1 parent 0c8dbc7 commit 45e8ce3

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

src/component/header.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,15 @@ const styles = StyleSheet.create({
1616
alignItems: 'center',
1717
},
1818
shadow: {
19-
boxShadow: '0 2px 4px 0 rgba(0,0,0,0.3)',
19+
shadowOffset: { width: 0, height: 2 },
20+
shadowRadius: 4,
21+
shadowColor: color.black,
22+
shadowOpacity: 0.3,
2023
zIndex: 1,
2124
},
2225
separator: {
23-
boxShadow: `0 0.25px ${color.white}`,
26+
shadowOffset: { width: 0, height: 0.25 },
27+
shadowColor: color.white,
2428
},
2529
centerTitle: {
2630
justifyContent: 'center',

src/component/list.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ const itemStyles = StyleSheet.create({
7474
alignItems: 'center',
7575
height: 40,
7676
marginTop: 1, // prevent box-shadow blinking when pressing item
77-
boxShadow: `0 0.5px ${color.greyBorder}`,
77+
shadowOffset: { width: 0, height: 0.5 },
78+
shadowColor: color.greyBorder,
7879
},
7980
});
8081

@@ -103,7 +104,7 @@ ListItem.propTypes = {
103104

104105
const headStyles = StyleSheet.create({
105106
head: {
106-
boxShadow: '0',
107+
shadowOffset: { width: 0, height: 0 },
107108
},
108109
});
109110

src/component/style.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
export const color = {
2+
black: '#000000',
23
white: '#FFFFFF',
34
whiteBg: '#F5F5F5',
45
grey: '#C5C8CF',

src/view/home.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,8 @@ const qrStyles = StyleSheet.create({
233233
separator: {
234234
flex: 1,
235235
height: 1,
236-
boxShadow: `0 0.25px ${color.white}`,
236+
shadowOffset: { width: 0, height: 0.25 },
237+
shadowColor: color.white,
237238
},
238239
button: {
239240
top: -19,

0 commit comments

Comments
 (0)