Compare commits

...

3 commits

Author SHA1 Message Date
Arnaud Vergnet
faac5688f8 Improve equipment confirm screen dates display 2020-09-23 18:58:13 +02:00
Arnaud Vergnet
346b00defd Fix group accordions expanding incorrectly 2020-09-23 18:47:00 +02:00
Arnaud Vergnet
11609f8277 Fix props equality checking functions 2020-09-23 18:40:22 +02:00
7 changed files with 8 additions and 16 deletions

View file

@ -98,7 +98,7 @@ function EventDashBoardItem(props: PropsType) {
}
const areEqual = (prevProps: PropsType, nextProps: PropsType): boolean => {
return nextProps.eventNumber !== prevProps.eventNumber;
return nextProps.eventNumber === prevProps.eventNumber;
};
export default React.memo(EventDashBoardItem, areEqual);

View file

@ -88,7 +88,7 @@ function SmallDashboardItem(props: PropsType) {
}
const areEqual = (prevProps: PropsType, nextProps: PropsType): boolean => {
return nextProps.badgeCount !== prevProps.badgeCount;
return nextProps.badgeCount === prevProps.badgeCount;
};
export default React.memo(SmallDashboardItem, areEqual);

View file

@ -70,7 +70,7 @@ function DashboardEditItem(props: PropsType) {
}
const areEqual = (prevProps: PropsType, nextProps: PropsType): boolean => {
return nextProps.isActive !== prevProps.isActive;
return nextProps.isActive === prevProps.isActive;
};
export default React.memo(DashboardEditItem, areEqual);

View file

@ -130,7 +130,7 @@ function EquipmentListItem(props: PropsType) {
}
const areEqual = (prevProps: PropsType, nextProps: PropsType): boolean => {
return nextProps.userDeviceRentDates !== prevProps.userDeviceRentDates;
return nextProps.userDeviceRentDates === prevProps.userDeviceRentDates;
};
export default React.memo(EquipmentListItem, areEqual);

View file

@ -34,7 +34,6 @@ type PropsType = {
onGroupPress: (data: PlanexGroupType) => void;
onFavoritePress: (data: PlanexGroupType) => void;
currentSearchString: string;
height: number;
theme: ReactNativePaper.Theme;
};
@ -101,7 +100,6 @@ class GroupListAccordion extends React.Component<PropsType> {
<AnimatedAccordion
title={item.name.replace(REPLACE_REGEX, ' ')}
style={{
height: props.height,
justifyContent: 'center',
}}
left={(iconProps) =>

View file

@ -19,11 +19,11 @@
import * as React from 'react';
import {
Button,
Caption,
Card,
Headline,
Paragraph,
Title,
useTheme,
} from 'react-native-paper';
import {View} from 'react-native';
@ -61,6 +61,7 @@ function EquipmentConfirmScreen(props: Props) {
date: getRelativeDateString(start),
});
}
console.log(buttonText);
return (
<CollapsibleScrollView>
<Card style={{margin: 5}}>
@ -84,12 +85,9 @@ function EquipmentConfirmScreen(props: Props) {
</Caption>
</View>
</View>
<Button
icon="check-circle-outline"
color={theme.colors.success}
mode="text">
<Title style={{color: theme.colors.success, textAlign: 'center'}}>
{buttonText}
</Button>
</Title>
<Paragraph style={{textAlign: 'center'}}>
{i18n.t('screens.equipment.bookingConfirmedMessage')}
</Paragraph>

View file

@ -27,8 +27,6 @@ import WebSectionList from '../../components/Screens/WebSectionList';
import GroupListAccordion from '../../components/Lists/PlanexGroups/GroupListAccordion';
import AsyncStorageManager from '../../managers/AsyncStorageManager';
const LIST_ITEM_HEIGHT = 70;
export type PlanexGroupType = {
name: string;
id: number;
@ -127,7 +125,6 @@ class GroupSelectionScreen extends React.Component<PropsType, StateType> {
onGroupPress={this.onListItemPress}
onFavoritePress={this.onListFavoritePress}
currentSearchString={currentSearchString}
height={LIST_ITEM_HEIGHT}
/>
);
}
@ -311,7 +308,6 @@ class GroupSelectionScreen extends React.Component<PropsType, StateType> {
fetchUrl={GROUPS_URL}
renderItem={this.getRenderItem}
updateData={state.currentSearchString + state.favoriteGroups.length}
itemHeight={LIST_ITEM_HEIGHT}
/>
);
}