Skip to content

Commit

Permalink
Merge pull request #996 from sap-labs-france/navigation
Browse files Browse the repository at this point in the history
Prevent drawer from opening where it shouldn't
  • Loading branch information
AlixH authored Apr 7, 2023
2 parents 3584c8a + 5e620ee commit 14b65a0
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ export default class ChargingStationConnectorComponent extends React.Component<P
const { connector, navigation, chargingStation, onNavigate, listed } = this.props;
return (
<TouchableOpacity
style={[style.container, listed && style.borderedTopContainer]}
style={[style.container, listed && style.borderedBottomContainer]}
disabled={chargingStation.inactive || !listed}
onPress={() => {
if (onNavigate) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ export default function computeStyleSheet(): StyleSheet.NamedStyles<any> {
width: '100%',
justifyContent: 'center',
alignItems: 'stretch',
borderStyle: 'solid',
borderBottomWidth: 1,
borderColor: commonColor.listBorderColor
borderStyle: 'solid'
},
borderedTopContainer: {
borderTopColor: commonColor.listBorderColor
borderedBottomContainer: {
borderBottomWidth: 1,
borderBottomColor: commonColor.listBorderColor
},
connectorContainer: {
flexDirection: 'row',
Expand Down
2 changes: 1 addition & 1 deletion src/screens/base-screen/BaseScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default class BaseScreen<P, S> extends React.Component<Props, State> {
this.backHandler?.remove();
}

private setDrawerStatus(): void {
protected setDrawerStatus(): void {
const drawer = this.props?.navigation?.getParent('drawer');
drawer?.setOptions({
swipeEnabled: this.canOpenDrawer
Expand Down
8 changes: 7 additions & 1 deletion src/screens/base-screen/SelectableList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,5 +95,11 @@ export default class SelectableList<T extends ListItem> extends BaseScreen<Selec
await this.refresh();
// Hide spinner
this.setState({ refreshing: false });
};
}

protected setDrawerStatus() {
if (!this.props.isModal) {
super.setDrawerStatus();
}
}
}

0 comments on commit 14b65a0

Please sign in to comment.