mirror of
https://github.com/zhigang1992/react-navigation.git
synced 2026-02-12 09:21:09 +08:00
* Remove flow types from src * Finish removing Flow * Clear out flow-typed, some flow mentions in docs, website flow usage, and some other config
41 lines
903 B
JavaScript
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;
|