Compare commits

..

No commits in common. "f88c98537a5005885bbf19ca36311a30e1fd3a3b" and "fa42f09efb568055516c0b4fda1ba5525b8abc0f" have entirely different histories.

6 changed files with 16 additions and 79 deletions

View file

@ -29,14 +29,11 @@ class ProxiwashListItem extends React.Component<Props> {
(props.nbAvailable <= 1)
? i18n.t('proxiwashScreen.numAvailable')
: i18n.t('proxiwashScreen.numAvailablePlural'));
const iconColor = props.nbAvailable > 0
? this.props.theme.colors.success
: this.props.theme.colors.primary;
return (
<View style={styles.container}>
<Avatar.Icon
icon={props.isDryer ? 'tumble-dryer' : 'washing-machine'}
color={iconColor}
color={this.props.theme.colors.primary}
style={styles.icon}
/>
<View style={{justifyContent: 'center'}}>

View file

@ -4,7 +4,7 @@ import * as React from 'react';
import {ERROR_TYPE, readData} from "../../utils/WebData";
import i18n from "i18n-js";
import {Snackbar} from 'react-native-paper';
import {Animated, RefreshControl, View} from "react-native";
import {RefreshControl, SectionList, View} from "react-native";
import ErrorView from "../Custom/ErrorView";
import BasicLoadingScreen from "../Custom/BasicLoadingScreen";
@ -19,7 +19,6 @@ type Props = {
createDataset: Function,
updateData: number,
itemHeight: number | null,
onScroll: Function,
}
type State = {
@ -179,7 +178,7 @@ export default class WebSectionList extends React.PureComponent<Props, State> {
return (
<View>
{/*$FlowFixMe*/}
<Animated.SectionList
<SectionList
sections={dataset}
extraData={this.props.updateData}
refreshControl={
@ -204,8 +203,6 @@ export default class WebSectionList extends React.PureComponent<Props, State> {
}
removeClippedSubviews={true}
getItemLayout={this.props.itemHeight !== null ? this.itemLayout : undefined}
// Animations
onScroll={this.props.onScroll}
/>
<Snackbar
visible={this.state.snackbarVisible}

View file

@ -194,7 +194,7 @@ function HomeStackComponent(initialRoute: string | null, defaultData: Object) {
component={FeedItemScreen}
options={({navigation}) => {
return {
title: i18n.t('screens.feedDisplayScreen'),
title: 'FEEEEED',
...TransitionPresets.ModalSlideFromBottomIOS,
};
}}

View file

@ -1,7 +1,7 @@
// @flow
import * as React from 'react';
import {Animated, FlatList, StyleSheet, View} from 'react-native';
import {FlatList, StyleSheet, View} from 'react-native';
import i18n from "i18n-js";
import DashboardItem from "../components/Home/EventDashboardItem";
import WebSectionList from "../components/Lists/WebSectionList";
@ -14,7 +14,6 @@ import ActionsDashBoardItem from "../components/Home/ActionsDashboardItem";
import ConnectionManager from "../managers/ConnectionManager";
import {CommonActions} from '@react-navigation/native';
import MaterialHeaderButtons, {Item} from "../components/Custom/HeaderButton";
import {AnimatedValue} from "react-native-reanimated";
// import DATA from "../dashboard_data.json";
@ -27,8 +26,6 @@ const SECTIONS_ID = [
'news_feed'
];
const AnimatedFAB = Animated.createAnimatedComponent(FAB);
const REFRESH_TIME = 1000 * 20; // Refresh every 20 seconds
type Props = {
@ -37,35 +34,19 @@ type Props = {
theme: Object,
}
type State = {
showFab: boolean,
fabPosition: AnimatedValue
}
/**
* Class defining the app's home screen
*/
class HomeScreen extends React.Component<Props, State> {
class HomeScreen extends React.Component<Props> {
colors: Object;
isLoggedIn: boolean | null;
isAnimationDownPlaying: boolean;
isAnimationUpPlaying: boolean;
downAnimation;
upAnimation;
state = {
showFab: true,
fabPosition: new Animated.Value(0),
};
constructor(props) {
super(props);
this.colors = props.theme.colors;
this.isAnimationDownPlaying = false;
this.isAnimationUpPlaying = false;
this.isLoggedIn = null;
}
@ -398,7 +379,7 @@ class HomeScreen extends React.Component<Props, State> {
}
dashboardRowRenderItem = ({item}: Object) => {
return (
return(
<SquareDashboardItem
color={item.color}
icon={item.icon}
@ -417,14 +398,14 @@ class HomeScreen extends React.Component<Props, State> {
*/
getDashboardRow(content: Array<Object>) {
return <FlatList
data={content}
renderItem={this.dashboardRowRenderItem}
horizontal={true}
contentContainerStyle={{
data={content}
renderItem={this.dashboardRowRenderItem}
horizontal={true}
contentContainerStyle={{
marginLeft: 'auto',
marginRight: 'auto',
}}
/>;
}}
/>;
}
/**
@ -460,38 +441,6 @@ class HomeScreen extends React.Component<Props, State> {
openScanner = () => this.props.navigation.navigate("scanner");
onScroll = ({nativeEvent}: Object) => {
if (nativeEvent.velocity.y > 0.2) { // Go down
if (!this.isAnimationDownPlaying) {
this.isAnimationDownPlaying = true;
if (this.isAnimationUpPlaying)
this.upAnimation.stop();
this.downAnimation = Animated.spring(this.state.fabPosition, {
toValue: 100,
duration: 50,
useNativeDriver: true,
});
this.downAnimation.start(() => {
this.isAnimationDownPlaying = false
});
}
} else if (nativeEvent.velocity.y < -0.2) { // Go up
if (!this.isAnimationUpPlaying) {
this.isAnimationUpPlaying = true;
if (this.isAnimationDownPlaying)
this.downAnimation.stop();
this.upAnimation = Animated.spring(this.state.fabPosition, {
toValue: 0,
duration: 50,
useNativeDriver: true,
});
this.upAnimation.start(() => {
this.isAnimationUpPlaying = false
});
}
}
};
render() {
const nav = this.props.navigation;
return (
@ -504,13 +453,9 @@ class HomeScreen extends React.Component<Props, State> {
fetchUrl={DATA_URL}
renderItem={this.getRenderItem}
itemHeight={FEED_ITEM_HEIGHT}
onScroll={this.onScroll}
/>
<AnimatedFAB
style={{
...styles.fab,
transform: [{translateY: this.state.fabPosition}]
}}
<FAB
style={styles.fab}
icon="qrcode-scan"
onPress={this.openScanner}
/>

View file

@ -4,7 +4,6 @@
"planning": "Planning",
"planningDisplayScreen": "Event details",
"clubDisplayScreen": "Club details",
"feedDisplayScreen": "Details",
"clubsAbout": "Clubs",
"amicaleAbout": "The Amicale",
"proxiwash": "Proxiwash",

View file

@ -4,7 +4,6 @@
"planning": "Planning",
"planningDisplayScreen": "Détails",
"clubDisplayScreen": "Détails",
"feedDisplayScreen": "Détails",
"clubsAbout": "Les Clubs",
"amicaleAbout": "L' Amicale",
"proxiwash": "Proxiwash",