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.

ProfileWelcomeCard.tsx 2.0KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. import { useNavigation } from '@react-navigation/core';
  2. import React from 'react';
  3. import { Button, Card, Divider, Paragraph } from 'react-native-paper';
  4. import Mascot, { MASCOT_STYLE } from '../../Mascot/Mascot';
  5. import i18n from 'i18n-js';
  6. import { StyleSheet } from 'react-native';
  7. import CardList from '../../Lists/CardList/CardList';
  8. import { getAmicaleServices, SERVICES_KEY } from '../../../utils/Services';
  9. type Props = {
  10. firstname?: string;
  11. };
  12. const styles = StyleSheet.create({
  13. card: {
  14. margin: 10,
  15. },
  16. editButton: {
  17. marginLeft: 'auto',
  18. },
  19. mascot: {
  20. width: 60,
  21. },
  22. title: {
  23. marginLeft: 10,
  24. },
  25. });
  26. function ProfileWelcomeCard(props: Props) {
  27. const navigation = useNavigation();
  28. return (
  29. <Card style={styles.card}>
  30. <Card.Title
  31. title={i18n.t('screens.profile.welcomeTitle', {
  32. name: props.firstname,
  33. })}
  34. left={() => (
  35. <Mascot
  36. style={styles.mascot}
  37. emotion={MASCOT_STYLE.COOL}
  38. animated
  39. entryAnimation={{
  40. animation: 'bounceIn',
  41. duration: 1000,
  42. }}
  43. />
  44. )}
  45. titleStyle={styles.title}
  46. />
  47. <Card.Content>
  48. <Divider />
  49. <Paragraph>{i18n.t('screens.profile.welcomeDescription')}</Paragraph>
  50. <CardList
  51. dataset={getAmicaleServices(navigation.navigate, [
  52. SERVICES_KEY.PROFILE,
  53. ])}
  54. isHorizontal={true}
  55. />
  56. <Paragraph>{i18n.t('screens.profile.welcomeFeedback')}</Paragraph>
  57. <Divider />
  58. <Card.Actions>
  59. <Button
  60. icon="bug"
  61. mode="contained"
  62. onPress={() => {
  63. navigation.navigate('feedback');
  64. }}
  65. style={styles.editButton}
  66. >
  67. {i18n.t('screens.feedback.homeButtonTitle')}
  68. </Button>
  69. </Card.Actions>
  70. </Card.Content>
  71. </Card>
  72. );
  73. }
  74. export default React.memo(
  75. ProfileWelcomeCard,
  76. (pp, np) => pp.firstname === np.firstname
  77. );