Application Android et IOS pour l'amicale des élèves
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ImageGalleryButton.js 974B

1234567891011121314151617181920212223242526272829303132333435363738
  1. // @flow
  2. import * as React from 'react';
  3. import {TouchableRipple} from 'react-native-paper';
  4. import {StackNavigationProp} from '@react-navigation/stack';
  5. import {Image} from 'react-native-animatable';
  6. import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet';
  7. type PropsType = {
  8. navigation: StackNavigationProp,
  9. images: Array<{url: string}>,
  10. style: ViewStyleProp,
  11. };
  12. class ImageGalleryButton extends React.Component<PropsType> {
  13. onPress = () => {
  14. const {navigation, images} = this.props;
  15. navigation.navigate('gallery', {images});
  16. };
  17. render(): React.Node {
  18. const {style, images} = this.props;
  19. return (
  20. <TouchableRipple onPress={this.onPress} style={style}>
  21. <Image
  22. resizeMode="contain"
  23. source={{uri: images[0].url}}
  24. style={{
  25. width: '100%',
  26. height: '100%',
  27. }}
  28. />
  29. </TouchableRipple>
  30. );
  31. }
  32. }
  33. export default ImageGalleryButton;