Files
react-navigation/src/views/CardStack/Card.js
Brent Vatne ecfa38bfd2 Remove flow (#3350)
* Remove flow types from src

* Finish removing Flow

* Clear out flow-typed, some flow mentions in docs, website flow usage, and some other config
2018-01-24 17:52:09 -08:00

41 lines
903 B
JavaScript

import React from 'react';
import { Animated, StyleSheet } from 'react-native';
import createPointerEventsContainer from './PointerEventsContainer';
/**
* Component that renders the scene as card for the <NavigationCardStack />.
*/
class Card extends React.Component {
render() {
const { children, pointerEvents, style } = this.props;
return (
<Animated.View
pointerEvents={pointerEvents}
ref={this.props.onComponentRef}
style={[styles.main, style]}
>
{children}
</Animated.View>
);
}
}
const styles = StyleSheet.create({
main: {
backgroundColor: '#E9E9EF',
bottom: 0,
left: 0,
position: 'absolute',
right: 0,
shadowColor: 'black',
shadowOffset: { width: 0, height: 0 },
shadowOpacity: 0.2,
shadowRadius: 5,
top: 0,
},
});
Card = createPointerEventsContainer(Card);
export default Card;