From 2f3e171b084d86856fd56e2bd1631c9e0a383efc Mon Sep 17 00:00:00 2001 From: keplyx Date: Sun, 8 Mar 2020 12:05:22 +0100 Subject: [PATCH] Improved planning display --- screens/PlanningDisplayScreen.js | 30 ++++++++++++++---------------- screens/PlanningScreen.js | 19 +++++++++++-------- 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/screens/PlanningDisplayScreen.js b/screens/PlanningDisplayScreen.js index 530326c..ffb96e5 100644 --- a/screens/PlanningDisplayScreen.js +++ b/screens/PlanningDisplayScreen.js @@ -6,7 +6,7 @@ import ThemeManager from "../utils/ThemeManager"; import HTML from "react-native-render-html"; import {Linking} from "expo"; import PlanningEventManager from '../utils/PlanningEventManager'; -import {Subheading, Title} from 'react-native-paper'; +import {Card} from 'react-native-paper'; type Props = { navigation: Object, @@ -28,14 +28,12 @@ export default class PlanningDisplayScreen extends React.Component { // console.log("rendering planningDisplayScreen"); return ( - - {this.displayData.title} - - - {PlanningEventManager.getFormattedTime(this.displayData)} - + {this.displayData.logo !== null ? - + @@ -43,14 +41,14 @@ export default class PlanningDisplayScreen extends React.Component { {this.displayData.description !== null ? // Surround description with div to allow text styling if the description is not html - " + this.displayData.description + ""} - tagsStyles={{ - p: { - color: ThemeManager.getCurrentThemeVariables().text, - }, - div: {color: ThemeManager.getCurrentThemeVariables().text} - }} - onLinkPress={openWebLink}/> + + " + this.displayData.description + ""} + tagsStyles={{ + p: {color: ThemeManager.getCurrentThemeVariables().text,}, + div: {color: ThemeManager.getCurrentThemeVariables().text} + }} + onLinkPress={openWebLink}/> + : } ); diff --git a/screens/PlanningScreen.js b/screens/PlanningScreen.js index 6281ff9..c61b97a 100644 --- a/screens/PlanningScreen.js +++ b/screens/PlanningScreen.js @@ -1,13 +1,12 @@ // @flow import * as React from 'react'; -import {BackHandler, Image, View} from 'react-native'; +import {BackHandler, View} from 'react-native'; import i18n from "i18n-js"; -import ThemeManager from "../utils/ThemeManager"; import {LocaleConfig} from 'react-native-calendars'; import WebDataManager from "../utils/WebDataManager"; import PlanningEventManager from '../utils/PlanningEventManager'; -import {Text, Title, List, Avatar, Divider} from 'react-native-paper'; +import {Avatar, Divider, List} from 'react-native-paper'; import CustomAgenda from "../components/CustomAgenda"; LocaleConfig.locales['fr'] = { @@ -31,7 +30,7 @@ type State = { const FETCH_URL = "https://amicale-insat.fr/event/json/list"; -const AGENDA_MONTH_SPAN = 6; +const AGENDA_MONTH_SPAN = 3; /** * Class defining the app's planning screen @@ -138,7 +137,10 @@ export default class PlanningScreen extends React.Component { } + left={props => } onPress={onPress} /> @@ -164,9 +166,10 @@ export default class PlanningScreen extends React.Component { } rowHasChanged(r1: Object, r2: Object) { - if (r1 !== undefined && r2 !== undefined) - return r1.title !== r2.title; - else return !(r1 === undefined && r2 === undefined); + return false; + // if (r1 !== undefined && r2 !== undefined) + // return r1.title !== r2.title; + // else return !(r1 === undefined && r2 === undefined); } /**