Compare commits

...

2 commits

Author SHA1 Message Date
835656bb30 Use Image instead of avatar
This removes round corners
2020-08-09 20:47:41 +02:00
14e5b01341 Fix feed item screen page source 2020-08-09 20:44:25 +02:00
2 changed files with 16 additions and 13 deletions

View file

@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import {FlatList, Linking, Platform} from 'react-native';
import {FlatList, Linking, Platform, Image} from 'react-native';
import i18n from 'i18n-js';
import {Avatar, Card, List, Title, withTheme} from 'react-native-paper';
import {StackNavigationProp} from '@react-navigation/stack';
@ -222,10 +222,10 @@ class AboutScreen extends React.Component<PropsType> {
title="Campus"
subtitle={packageJson.version}
left={(iconProps: CardTitleIconPropsType): React.Node => (
<Avatar.Image
<Image
size={iconProps.size}
source={APP_LOGO}
style={{backgroundColor: 'transparent'}}
style={{width: iconProps.size, height: iconProps.size}}
/>
)}
/>

View file

@ -1,8 +1,8 @@
// @flow
import * as React from 'react';
import {Linking} from 'react-native';
import {Avatar, Card, Text, withTheme} from 'react-native-paper';
import {Linking, Image} from 'react-native';
import {Card, Text, withTheme} from 'react-native-paper';
import Autolink from 'react-native-autolink';
import {StackNavigationProp} from '@react-navigation/stack';
import MaterialHeaderButtons, {
@ -12,16 +12,14 @@ import CustomTabBar from '../../components/Tabbar/CustomTabBar';
import type {FeedItemType} from './HomeScreen';
import CollapsibleScrollView from '../../components/Collapsible/CollapsibleScrollView';
import ImageGalleryButton from '../../components/Media/ImageGalleryButton';
import NewsSourcesConstants from '../../constants/NewsSourcesConstants';
import type {NewsSourceType} from '../../constants/NewsSourcesConstants';
type PropsType = {
navigation: StackNavigationProp,
route: {params: {data: FeedItemType, date: string}},
};
const ICON_AMICALE = require('../../../assets/amicale.png');
const NAME_AMICALE = 'Amicale INSA Toulouse';
/**
* Class defining a feed item page.
*/
@ -72,16 +70,21 @@ class FeedItemScreen extends React.Component<PropsType> {
const {navigation} = this.props;
const hasImage =
this.displayData.image !== '' && this.displayData.image != null;
const pageSource: NewsSourceType =
NewsSourcesConstants[this.displayData.page_id];
return (
<CollapsibleScrollView style={{margin: 5}} hasTab>
<Card.Title
title={NAME_AMICALE}
title={pageSource.name}
subtitle={this.date}
left={(): React.Node => (
<Avatar.Image
<Image
size={48}
source={ICON_AMICALE}
style={{backgroundColor: 'transparent'}}
source={pageSource.icon}
style={{
width: 48,
height: 48,
}}
/>
)}
/>