Feature(grb): add popup feature to validate e.g. a user profile

This commit is contained in:
Pieter Vander Vennet 2025-03-17 01:17:02 +01:00
parent c3d905b26a
commit ecd8f5e1da
11 changed files with 247 additions and 64 deletions

View file

@ -111,12 +111,27 @@ export class SettingsVisualisations {
},
{
funcName: "login_button",
args: [],
args: [{
name: "force",
doc: "Always show this button, even if logged in"
}, {
name: "message",
doc: "Message to display on the button"
}],
docs: "Show a login button",
needsUrls: [],
group: "settings",
constr(state: SpecialVisualizationState): SvelteUIElement {
return new SvelteUIElement(LoginButton, { osmConnection: state.osmConnection })
constr(state: SpecialVisualizationState, _, args): SvelteUIElement {
const force = args[0].toLowerCase()
let msg = args[1]
if (msg === "") {
msg = undefined
}
return new SvelteUIElement(LoginButton, {
osmConnection: state.osmConnection,
msg,
forceShow: force === "yes" || force === "true"
})
},
},