Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: Mobile back button was shown where not applicable #2414

Merged
merged 1 commit into from Jan 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -59,15 +59,17 @@ export class BottomToolBar extends React.Component<{
const actionButtonsState = geScreenActionButtonsState(this.props.ctx);
const buttons = [];
if (this.props.mobileState.layoutState.showCloseButton(!!this.activeScreen)) {
buttons.push(
<BottomButton
key={"back"}
disabled={!this.activeScreen || !this.props.mobileState.breadCrumbsState.canGoBack}
caption={T("Back", "back_tool_tip")}
iconPath={"./icons/back-mobile.svg"}
onClick={() => this.props.mobileState.breadCrumbsState.goBack()}
/>
);
{ this.props.mobileState.layoutState.showBackButton &&
buttons.push(
<BottomButton
key={"back"}
disabled={!this.activeScreen || !this.props.mobileState.breadCrumbsState.canGoBack}
caption={T("Back", "back_tool_tip")}
iconPath={"./icons/back-mobile.svg"}
onClick={() => this.props.mobileState.breadCrumbsState.goBack()}
/>
);
}
buttons.push(
<BottomButton
key={"close"}
Expand Down
Expand Up @@ -13,6 +13,7 @@ export interface IMobileLayoutState {
showHamburgerMenuButton: boolean;
heading: string;
showOkButton: boolean;
showBackButton: boolean;

showCloseButton(someScreensAreOpen: boolean): boolean;

Expand All @@ -29,6 +30,7 @@ export class MenuLayoutState implements IMobileLayoutState {
showSearchButton = true;
showHamburgerMenuButton = false;
showOkButton = false;
showBackButton = false;
heading = T("Menu", "menu");

showCloseButton(someScreensAreOpen: boolean) {
Expand All @@ -52,6 +54,7 @@ export class AboutLayoutState implements IMobileLayoutState {
showSearchButton = true;
showHamburgerMenuButton = true;
showOkButton = false;
showBackButton = false;
heading = T("About", "about_application");

showCloseButton(someScreensAreOpen: boolean) {
Expand All @@ -75,6 +78,7 @@ export class SearchLayoutState implements IMobileLayoutState {
showSearchButton = false;
showHamburgerMenuButton = true;
showOkButton = false;
showBackButton = false;
heading = T("Search", "mobile_search_title");

showCloseButton(someScreensAreOpen: boolean) {
Expand All @@ -98,6 +102,7 @@ export class EditLayoutState implements IMobileLayoutState {
showSearchButton = false;
showHamburgerMenuButton = false;
showOkButton = true;
showBackButton = false;
private readonly showCloseButton_: boolean;

constructor(
Expand Down Expand Up @@ -132,6 +137,7 @@ export class ScreenLayoutState implements IMobileLayoutState {
showSearchButton = true;
showHamburgerMenuButton = true;
showOkButton = false;
showBackButton = true;
heading = "";

showCloseButton(someScreensAreOpen: boolean) {
Expand Down