Application Android et IOS pour l'amicale des élèves https://play.google.com/store/apps/details?id=fr.amicaleinsat.application
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 1.1KB

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