Update StackViewCard.js

This commit is contained in:
Brent Vatne 2018-11-26 09:24:47 -08:00 committed by GitHub
parent eb22958703
commit 1c374ae1f1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 5 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 ? (
@ -65,9 +67,11 @@ class Card extends React.Component {
<Animated.View
{...getAccessibilityProps(isActive)}
style={[
transparent ? styles.transparent : styles.card,
style ? { backgroundColor: style.backgroundColor } : {}
]}
transparent ? styles.transparent : styles.card,
backgroundColor && backgroundColor !== 'transparent'
? { backgroundColor }
: null,
]}
>
{children}
</Animated.View>