Merge pull request #62 from BrendonSled/patch-1

Bugfix - Card style background
This commit is contained in:
Brent Vatne 2018-11-27 00:25:14 +07:00 committed by GitHub
commit af83d75731
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 3 deletions

View File

@ -4,7 +4,6 @@ import { Screen } from 'react-native-screens';
import createPointerEventsContainer from './createPointerEventsContainer';
const EPS = 1e-5;
function getAccessibilityProps(isActive) {
if (Platform.OS === 'ios') {
return {
@ -49,11 +48,14 @@ class Card extends React.Component {
...containerAnimatedStyle
} = animatedStyle;
let flattenedStyle = StyleSheet.flatten(style) || {};
let { backgroundColor, ...screenStyle } = flattenedStyle;
return (
<Screen
pointerEvents={pointerEvents}
onComponentRef={this.props.onComponentRef}
style={[StyleSheet.absoluteFill, containerAnimatedStyle, style]}
style={[StyleSheet.absoluteFill, containerAnimatedStyle, screenStyle]}
active={active}
>
{shadowOpacity ? (
@ -64,7 +66,12 @@ class Card extends React.Component {
) : null}
<Animated.View
{...getAccessibilityProps(isActive)}
style={[transparent ? styles.transparent : styles.card]}
style={[
transparent ? styles.transparent : styles.card,
backgroundColor && backgroundColor !== 'transparent'
? { backgroundColor }
: null,
]}
>
{children}
</Animated.View>