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,7 +1,7 @@
1 1
 // @flow
2 2
 
3 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 5
 import {Avatar, Button, Card, Divider, List, Paragraph, withTheme} from 'react-native-paper';
6 6
 import AuthenticatedScreen from "../../components/Amicale/AuthenticatedScreen";
7 7
 import i18n from 'i18n-js';
@@ -15,6 +15,7 @@ import CardList from "../../components/Lists/CardList/CardList";
15 15
 import {StackNavigationProp} from "@react-navigation/stack";
16 16
 import type {CustomTheme} from "../../managers/ThemeManager";
17 17
 import AvailableWebsites from "../../constants/AvailableWebsites";
18
+import Mascot, {MASCOT_STYLE} from "../../components/Mascot/Mascot";
18 19
 
19 20
 type Props = {
20 21
     navigation: StackNavigationProp,
@@ -84,7 +85,10 @@ class ProfileScreen extends React.Component<Props, State> {
84 85
                 title: i18n.t('screens.websites.amicale'),
85 86
                 subtitle: i18n.t('screens.services.descriptions.amicaleWebsite'),
86 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,12 +183,14 @@ class ProfileScreen extends React.Component<Props, State> {
179 183
             <Card style={styles.card}>
180 184
                 <Card.Title
181 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 195
                     titleStyle={{marginLeft: 10}}
190 196
                 />
@@ -290,7 +296,11 @@ class ProfileScreen extends React.Component<Props, State> {
290 296
                         <Button
291 297
                             icon="account-edit"
292 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 304
                             style={styles.editButton}>
295 305
                             {i18n.t("screens.profile.editInformation")}
296 306
                         </Button>

Loading…
Cancel
Save