Change 'cancel'-text in simpleUI with 'Select a different category'

This commit is contained in:
Pieter Vander Vennet 2022-11-14 01:22:38 +01:00
parent 5d1496ad5b
commit 3baaff1324
2 changed files with 12 additions and 3 deletions

View file

@ -157,6 +157,10 @@ export default class SimpleAddUI extends Toggle {
cancel,
() => {
isShown.setData(false)
},
{
cancelIcon: Svg.back_svg(),
cancelText: Translations.t.general.add.backToSelect
}
)
})

View file

@ -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