From 3baaff132470a6f1fe7ad22b6516c1bc40e5472f Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 14 Nov 2022 01:22:38 +0100 Subject: [PATCH] Change 'cancel'-text in simpleUI with 'Select a different category' --- UI/BigComponents/SimpleAddUI.ts | 4 ++++ UI/NewPoint/ConfirmLocationOfPoint.ts | 11 ++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/UI/BigComponents/SimpleAddUI.ts b/UI/BigComponents/SimpleAddUI.ts index 091db06e5..1fbe2fe10 100644 --- a/UI/BigComponents/SimpleAddUI.ts +++ b/UI/BigComponents/SimpleAddUI.ts @@ -157,6 +157,10 @@ export default class SimpleAddUI extends Toggle { cancel, () => { isShown.setData(false) + }, + { + cancelIcon: Svg.back_svg(), + cancelText: Translations.t.general.add.backToSelect } ) }) diff --git a/UI/NewPoint/ConfirmLocationOfPoint.ts b/UI/NewPoint/ConfirmLocationOfPoint.ts index 373dd8ea3..0cdf61193 100644 --- a/UI/NewPoint/ConfirmLocationOfPoint.ts +++ b/UI/NewPoint/ConfirmLocationOfPoint.ts @@ -19,6 +19,7 @@ import { GlobalFilter } from "../../Logic/State/MapState" import { VariableUiElement } from "../Base/VariableUIElement" import { Tag } from "../../Logic/Tags/Tag" import { WayId } from "../../Models/OsmFeature" +import {Translation} from "../i18n/Translation"; export default class ConfirmLocationOfPoint extends Combine { constructor( @@ -39,7 +40,11 @@ export default class ConfirmLocationOfPoint extends Combine { snapOntoWayId: WayId | undefined ) => void, cancel: () => void, - closePopup: () => void + closePopup: () => void, + options?: { + cancelIcon: BaseUIElement, + cancelText?: string | Translation + } ) { let preciseInput: LocationInput = undefined if (preset.preciseInput !== undefined) { @@ -222,8 +227,8 @@ export default class ConfirmLocationOfPoint extends Combine { const tagInfo = SimpleAddUI.CreateTagInfoFor(preset, state.osmConnection) const cancelButton = new SubtleButton( - Svg.close_ui(), - Translations.t.general.cancel + options?.cancelIcon ?? Svg.close_ui(), + options?.cancelText ?? Translations.t.general.cancel ).onClick(cancel) let examples: BaseUIElement = undefined