Browse Source

Use square image for amicale logo across the app

Arnaud Vergnet 3 years ago
parent
commit
ea19ca3ade

+ 7
- 7
src/components/Amicale/Vote/VoteTitle.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import * as React from 'react';
3
 import * as React from 'react';
4
-import {Avatar, Card, Paragraph} from "react-native-paper";
5
-import {StyleSheet} from "react-native";
4
+import {Card, Paragraph} from "react-native-paper";
5
+import {Image, StyleSheet} from "react-native";
6
 import i18n from 'i18n-js';
6
 import i18n from 'i18n-js';
7
 
7
 
8
 const ICON_AMICALE = require('../../../../assets/amicale.png');
8
 const ICON_AMICALE = require('../../../../assets/amicale.png');
19
                 <Card.Title
19
                 <Card.Title
20
                     title={i18n.t('screens.vote.main.title')}
20
                     title={i18n.t('screens.vote.main.title')}
21
                     subtitle={i18n.t('screens.vote.main.subtitle')}
21
                     subtitle={i18n.t('screens.vote.main.subtitle')}
22
-                    left={(props) => <Avatar.Image
22
+                    left={(props) => <Image
23
                         {...props}
23
                         {...props}
24
+                        style={{
25
+                            width: props.size,
26
+                            height: props.size,
27
+                        }}
24
                         source={ICON_AMICALE}
28
                         source={ICON_AMICALE}
25
-                        style={styles.icon}
26
                     />}
29
                     />}
27
                 />
30
                 />
28
                 <Card.Content>
31
                 <Card.Content>
42
     card: {
45
     card: {
43
         margin: 10,
46
         margin: 10,
44
     },
47
     },
45
-    icon: {
46
-        backgroundColor: 'transparent'
47
-    },
48
 });
48
 });

+ 9
- 5
src/components/Home/FeedItem.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import * as React from 'react';
3
 import * as React from 'react';
4
-import {Avatar, Button, Card, Text} from 'react-native-paper';
5
-import {View} from "react-native";
4
+import {Button, Card, Text} from 'react-native-paper';
5
+import {Image, View} from "react-native";
6
 import Autolink from "react-native-autolink";
6
 import Autolink from "react-native-autolink";
7
 import i18n from "i18n-js";
7
 import i18n from "i18n-js";
8
 import ImageModal from 'react-native-image-modal';
8
 import ImageModal from 'react-native-image-modal';
38
      */
38
      */
39
     getAvatar() {
39
     getAvatar() {
40
         return (
40
         return (
41
-            <Avatar.Image
42
-                size={48} source={ICON_AMICALE}
43
-                style={{backgroundColor: 'transparent'}}/>
41
+            <Image
42
+                size={48}
43
+                source={ICON_AMICALE}
44
+                style={{
45
+                    width: 48,
46
+                    height: 48,
47
+                }}/>
44
         );
48
         );
45
     }
49
     }
46
 
50
 

+ 2
- 7
src/components/Lists/CardList/CardList.js View File

36
     keyExtractor = (item: cardItem) => item.title;
36
     keyExtractor = (item: cardItem) => item.title;
37
 
37
 
38
     render() {
38
     render() {
39
-        let containerStyle;
39
+        let containerStyle = {};
40
         if (this.props.isHorizontal) {
40
         if (this.props.isHorizontal) {
41
             containerStyle = {
41
             containerStyle = {
42
-                ...this.props.contentContainerStyle,
43
                 height: 150,
42
                 height: 150,
44
                 justifyContent: 'space-around',
43
                 justifyContent: 'space-around',
45
             };
44
             };
46
-        } else {
47
-            containerStyle = {
48
-                ...this.props.contentContainerStyle,
49
-            }
50
         }
45
         }
51
         return (
46
         return (
52
             <Animated.FlatList
47
             <Animated.FlatList
60
             />
55
             />
61
         );
56
         );
62
     }
57
     }
63
-}
58
+}

+ 7
- 4
src/screens/Amicale/Equipment/EquipmentListScreen.js View File

1
 // @flow
1
 // @flow
2
 
2
 
3
 import * as React from 'react';
3
 import * as React from 'react';
4
-import {Animated} from "react-native";
5
-import {Avatar, Card, Paragraph, withTheme} from 'react-native-paper';
4
+import {Animated, Image} from "react-native";
5
+import {Card, Paragraph, withTheme} from 'react-native-paper';
6
 import AuthenticatedScreen from "../../../components/Amicale/AuthenticatedScreen";
6
 import AuthenticatedScreen from "../../../components/Amicale/AuthenticatedScreen";
7
 import {Collapsible} from "react-navigation-collapsible";
7
 import {Collapsible} from "react-navigation-collapsible";
8
 import {withCollapsible} from "../../../utils/withCollapsible";
8
 import {withCollapsible} from "../../../utils/withCollapsible";
87
         return <Card style={{margin: 5}}>
87
         return <Card style={{margin: 5}}>
88
             <Card.Title
88
             <Card.Title
89
                 title={i18n.t('screens.equipment.title')}
89
                 title={i18n.t('screens.equipment.title')}
90
-                left={(props) => <Avatar.Image
90
+                left={(props) => <Image
91
                     {...props}
91
                     {...props}
92
+                    style={{
93
+                        width: props.size,
94
+                        height: props.size,
95
+                    }}
92
                     source={ICON_AMICALE}
96
                     source={ICON_AMICALE}
93
-                    style={{backgroundColor: 'transparent'}}
94
                 />}
97
                 />}
95
             />
98
             />
96
             <Card.Content>
99
             <Card.Content>

+ 6
- 4
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, StyleSheet, View} from "react-native";
4
+import {Animated, FlatList, Image, 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';
179
             <Card style={styles.card}>
179
             <Card style={styles.card}>
180
                 <Card.Title
180
                 <Card.Title
181
                     title={i18n.t("screens.profile.welcomeTitle", {name: this.data.first_name})}
181
                     title={i18n.t("screens.profile.welcomeTitle", {name: this.data.first_name})}
182
-                    left={() => <Avatar.Image
183
-                        size={64}
182
+                    left={() => <Image
183
+                        style={{
184
+                            width: 50,
185
+                            height: 50,
186
+                        }}
184
                         source={ICON_AMICALE}
187
                         source={ICON_AMICALE}
185
-                        style={{backgroundColor: 'transparent',}}
186
                     />}
188
                     />}
187
                     titleStyle={{marginLeft: 10}}
189
                     titleStyle={{marginLeft: 10}}
188
                 />
190
                 />

+ 6
- 5
src/screens/Services/ServicesScreen.js View File

6
 import CustomTabBar from "../../components/Tabbar/CustomTabBar";
6
 import CustomTabBar from "../../components/Tabbar/CustomTabBar";
7
 import {withCollapsible} from "../../utils/withCollapsible";
7
 import {withCollapsible} from "../../utils/withCollapsible";
8
 import {Collapsible} from "react-navigation-collapsible";
8
 import {Collapsible} from "react-navigation-collapsible";
9
-import {Animated, View} from "react-native";
9
+import {Animated, Image, View} from "react-native";
10
 import {Avatar, Card, Divider, List, TouchableRipple, withTheme} from "react-native-paper";
10
 import {Avatar, Card, Divider, List, TouchableRipple, withTheme} from "react-native-paper";
11
 import type {CustomTheme} from "../../managers/ThemeManager";
11
 import type {CustomTheme} from "../../managers/ThemeManager";
12
 import i18n from 'i18n-js';
12
 import i18n from 'i18n-js';
227
      */
227
      */
228
     getListTitleImage(props, source: string | number) {
228
     getListTitleImage(props, source: string | number) {
229
         if (typeof source === "number")
229
         if (typeof source === "number")
230
-            return <Avatar.Image
231
-                {...props}
230
+            return <Image
232
                 size={48}
231
                 size={48}
233
                 source={source}
232
                 source={source}
234
-                style={{backgroundColor: 'transparent'}}
235
-            />
233
+                style={{
234
+                    width: 48,
235
+                    height: 48,
236
+                }}/>
236
         else
237
         else
237
             return <Avatar.Icon
238
             return <Avatar.Icon
238
                 {...props}
239
                 {...props}

Loading…
Cancel
Save