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

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

@@ -1,8 +1,8 @@
1 1
 // @flow
2 2
 
3 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 6
 import Autolink from "react-native-autolink";
7 7
 import i18n from "i18n-js";
8 8
 import ImageModal from 'react-native-image-modal';
@@ -38,9 +38,13 @@ class FeedItem extends React.Component<Props> {
38 38
      */
39 39
     getAvatar() {
40 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,17 +36,12 @@ export default class CardList extends React.Component<Props> {
36 36
     keyExtractor = (item: cardItem) => item.title;
37 37
 
38 38
     render() {
39
-        let containerStyle;
39
+        let containerStyle = {};
40 40
         if (this.props.isHorizontal) {
41 41
             containerStyle = {
42
-                ...this.props.contentContainerStyle,
43 42
                 height: 150,
44 43
                 justifyContent: 'space-around',
45 44
             };
46
-        } else {
47
-            containerStyle = {
48
-                ...this.props.contentContainerStyle,
49
-            }
50 45
         }
51 46
         return (
52 47
             <Animated.FlatList
@@ -60,4 +55,4 @@ export default class CardList extends React.Component<Props> {
60 55
             />
61 56
         );
62 57
     }
63
-}
58
+}

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

@@ -1,8 +1,8 @@
1 1
 // @flow
2 2
 
3 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 6
 import AuthenticatedScreen from "../../../components/Amicale/AuthenticatedScreen";
7 7
 import {Collapsible} from "react-navigation-collapsible";
8 8
 import {withCollapsible} from "../../../utils/withCollapsible";
@@ -87,10 +87,13 @@ class EquipmentListScreen extends React.Component<Props> {
87 87
         return <Card style={{margin: 5}}>
88 88
             <Card.Title
89 89
                 title={i18n.t('screens.equipment.title')}
90
-                left={(props) => <Avatar.Image
90
+                left={(props) => <Image
91 91
                     {...props}
92
+                    style={{
93
+                        width: props.size,
94
+                        height: props.size,
95
+                    }}
92 96
                     source={ICON_AMICALE}
93
-                    style={{backgroundColor: 'transparent'}}
94 97
                 />}
95 98
             />
96 99
             <Card.Content>

+ 6
- 4
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, StyleSheet, View} from "react-native";
4
+import {Animated, FlatList, Image, 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';
@@ -179,10 +179,12 @@ class ProfileScreen extends React.Component<Props, State> {
179 179
             <Card style={styles.card}>
180 180
                 <Card.Title
181 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 187
                         source={ICON_AMICALE}
185
-                        style={{backgroundColor: 'transparent',}}
186 188
                     />}
187 189
                     titleStyle={{marginLeft: 10}}
188 190
                 />

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

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

Loading…
Cancel
Save