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.

ActionsDashboardItem.js 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * Copyright (c) 2019 - 2020 Arnaud Vergnet.
  3. *
  4. * This file is part of Campus INSAT.
  5. *
  6. * Campus INSAT is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * Campus INSAT is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with Campus INSAT. If not, see <https://www.gnu.org/licenses/>.
  18. */
  19. // @flow
  20. import * as React from 'react';
  21. import {List, withTheme} from 'react-native-paper';
  22. import {View} from 'react-native';
  23. import i18n from 'i18n-js';
  24. import {StackNavigationProp} from '@react-navigation/stack';
  25. import type {CustomThemeType} from '../../managers/ThemeManager';
  26. import type {ListIconPropsType} from '../../constants/PaperStyles';
  27. type PropsType = {
  28. navigation: StackNavigationProp,
  29. theme: CustomThemeType,
  30. };
  31. class ActionsDashBoardItem extends React.Component<PropsType> {
  32. shouldComponentUpdate(nextProps: PropsType): boolean {
  33. const {props} = this;
  34. return nextProps.theme.dark !== props.theme.dark;
  35. }
  36. render(): React.Node {
  37. const {navigation} = this.props;
  38. return (
  39. <View>
  40. <List.Item
  41. title={i18n.t('screens.feedback.homeButtonTitle')}
  42. description={i18n.t('screens.feedback.homeButtonSubtitle')}
  43. left={(props: ListIconPropsType): React.Node => (
  44. <List.Icon
  45. color={props.color}
  46. style={props.style}
  47. icon="comment-quote"
  48. />
  49. )}
  50. right={(props: ListIconPropsType): React.Node => (
  51. <List.Icon
  52. color={props.color}
  53. style={props.style}
  54. icon="chevron-right"
  55. />
  56. )}
  57. onPress={(): void => navigation.navigate('feedback')}
  58. style={{
  59. paddingTop: 0,
  60. paddingBottom: 0,
  61. marginLeft: 10,
  62. marginRight: 10,
  63. }}
  64. />
  65. </View>
  66. );
  67. }
  68. }
  69. export default withTheme(ActionsDashBoardItem);