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

Commit da1f85d

Browse files
Merge pull request #788 from lightninglabs/fix-responsive-list-item
Fix touchable list item
2 parents 3fc4bad + 1a7deff commit da1f85d

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

src/component/list.js

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import React, { Component, PureComponent } from 'react';
22
import { View, ListView, TouchableOpacity, StyleSheet } from 'react-native';
33
import PropTypes from 'prop-types';
4-
import { createStyles, maxWidth } from './media-query';
54
import Text from './text';
65
import ForwardIcon from '../asset/icon/forward';
7-
import { color, font, breakWidth } from './style';
6+
import { color, font } from './style';
87

98
//
109
// List Content
@@ -69,30 +68,16 @@ List.propTypes = {
6968
// List Item
7069
//
7170

72-
const itemBaseStyles = {
71+
const itemStyles = StyleSheet.create({
7372
item: {
7473
alignSelf: 'stretch',
7574
flexDirection: 'row',
7675
alignItems: 'center',
7776
height: 40,
78-
marginTop: 1, // prevent box-shadow blinking when pressing item
79-
shadowOffset: { width: 0, height: 0.5 },
80-
shadowColor: color.greyBorder,
77+
borderBottomWidth: StyleSheet.hairlineWidth,
78+
borderBottomColor: color.greyBorder,
8179
},
82-
};
83-
84-
const itemStyles = createStyles(
85-
itemBaseStyles,
86-
87-
maxWidth(breakWidth, {
88-
item: {
89-
marginTop: 0,
90-
shadowOffset: { width: 0, height: 0 },
91-
borderBottomWidth: StyleSheet.hairlineWidth,
92-
borderBottomColor: color.greyBorder,
93-
},
94-
})
95-
);
80+
});
9681

9782
export class ListItem extends PureComponent {
9883
render() {
@@ -119,7 +104,6 @@ ListItem.propTypes = {
119104

120105
const headStyles = StyleSheet.create({
121106
head: {
122-
shadowOffset: { width: 0, height: 0 },
123107
borderBottomWidth: 0,
124108
},
125109
});

0 commit comments

Comments
 (0)