Browse Source

Added mascot to profile screen

Arnaud Vergnet 3 years ago
parent
commit
99ff524d53
1 changed files with 18 additions and 8 deletions
  1. 18
    8
      src/screens/Amicale/ProfileScreen.js

+ 18
- 8
src/screens/Amicale/ProfileScreen.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import * as React from 'react';
3
 import * as React from 'react';
4
-import {Animated, FlatList, Image, StyleSheet, View} from "react-native";
4
+import {Animated, FlatList, StyleSheet, View} from "react-native";
5
 import {Avatar, Button, Card, Divider, List, Paragraph, withTheme} from 'react-native-paper';
5
 import {Avatar, Button, Card, Divider, List, Paragraph, withTheme} from 'react-native-paper';
6
 import AuthenticatedScreen from "../../components/Amicale/AuthenticatedScreen";
6
 import AuthenticatedScreen from "../../components/Amicale/AuthenticatedScreen";
7
 import i18n from 'i18n-js';
7
 import i18n from 'i18n-js';
15
 import {StackNavigationProp} from "@react-navigation/stack";
15
 import {StackNavigationProp} from "@react-navigation/stack";
16
 import type {CustomTheme} from "../../managers/ThemeManager";
16
 import type {CustomTheme} from "../../managers/ThemeManager";
17
 import AvailableWebsites from "../../constants/AvailableWebsites";
17
 import AvailableWebsites from "../../constants/AvailableWebsites";
18
+import Mascot, {MASCOT_STYLE} from "../../components/Mascot/Mascot";
18
 
19
 
19
 type Props = {
20
 type Props = {
20
     navigation: StackNavigationProp,
21
     navigation: StackNavigationProp,
84
                 title: i18n.t('screens.websites.amicale'),
85
                 title: i18n.t('screens.websites.amicale'),
85
                 subtitle: i18n.t('screens.services.descriptions.amicaleWebsite'),
86
                 subtitle: i18n.t('screens.services.descriptions.amicaleWebsite'),
86
                 image: ICON_AMICALE,
87
                 image: ICON_AMICALE,
87
-                onPress: () => this.props.navigation.navigate("website", {host: AvailableWebsites.websites.AMICALE, title: i18n.t('screens.websites.amicale')}),
88
+                onPress: () => this.props.navigation.navigate("website", {
89
+                    host: AvailableWebsites.websites.AMICALE,
90
+                    title: i18n.t('screens.websites.amicale')
91
+                }),
88
             },
92
             },
89
         ];
93
         ];
90
     }
94
     }
179
             <Card style={styles.card}>
183
             <Card style={styles.card}>
180
                 <Card.Title
184
                 <Card.Title
181
                     title={i18n.t("screens.profile.welcomeTitle", {name: this.data.first_name})}
185
                     title={i18n.t("screens.profile.welcomeTitle", {name: this.data.first_name})}
182
-                    left={() => <Image
183
-                        style={{
184
-                            width: 50,
185
-                            height: 50,
186
+                    left={() => <Mascot
187
+                        emotion={MASCOT_STYLE.COOL}
188
+                        size={60}
189
+                        animated={true}
190
+                        entryAnimation={{
191
+                            animation: "bounceIn",
192
+                            duration: 1000
186
                         }}
193
                         }}
187
-                        source={ICON_AMICALE}
188
                     />}
194
                     />}
189
                     titleStyle={{marginLeft: 10}}
195
                     titleStyle={{marginLeft: 10}}
190
                 />
196
                 />
290
                         <Button
296
                         <Button
291
                             icon="account-edit"
297
                             icon="account-edit"
292
                             mode="contained"
298
                             mode="contained"
293
-                            onPress={() => this.props.navigation.navigate("website", {host: AvailableWebsites.websites.AMICALE, path: this.data.link, title: i18n.t('screens.websites.amicale')})}
299
+                            onPress={() => this.props.navigation.navigate("website", {
300
+                                host: AvailableWebsites.websites.AMICALE,
301
+                                path: this.data.link,
302
+                                title: i18n.t('screens.websites.amicale')
303
+                            })}
294
                             style={styles.editButton}>
304
                             style={styles.editButton}>
295
                             {i18n.t("screens.profile.editInformation")}
305
                             {i18n.t("screens.profile.editInformation")}
296
                         </Button>
306
                         </Button>

Loading…
Cancel
Save