diff --git a/UI/BigComponents/ExtraLinkButton.ts b/UI/BigComponents/ExtraLinkButton.ts index ff9f90f069..102204e8de 100644 --- a/UI/BigComponents/ExtraLinkButton.ts +++ b/UI/BigComponents/ExtraLinkButton.ts @@ -19,7 +19,7 @@ export default class ExtraLinkButton extends UIElement { featureSwitchWelcomeMessage: UIEventSource, locationControl: UIEventSource }; - constructor(state: { featureSwitchWelcomeMessage: UIEventSource, locationControl: UIEventSource, layoutToUse: { id: string, title: Translations } }, + constructor(state: { featureSwitchWelcomeMessage: UIEventSource, locationControl: UIEventSource, layoutToUse: { id: string, title: Translation } }, config: ExtraLinkConfig) { super(); this.state = state; diff --git a/UI/DefaultGUI.ts b/UI/DefaultGUI.ts index a02bfbc722..3d0e2cacdd 100644 --- a/UI/DefaultGUI.ts +++ b/UI/DefaultGUI.ts @@ -25,7 +25,6 @@ import Combine from "./Base/Combine"; import AddNewMarker from "./BigComponents/AddNewMarker"; import FilteredLayer from "../Models/FilteredLayer"; import ExtraLinkButton from "./BigComponents/ExtraLinkButton"; -import {SubtleButton} from "./Base/SubtleButton"; /** @@ -164,19 +163,13 @@ export default class DefaultGUI { () => new UserBadge(state) ), Toggle.If(state.featureSwitchExtraLinkEnabled, - () => { - if (state.layoutToUse.extraLink.text === undefined) { - return Translations.t.general.screenToSmall - } - return new ExtraLinkButton(state, state.layoutToUse.extraLink); - } + () => new ExtraLinkButton(state, state.layoutToUse.extraLink) ) ]).SetClass("flex flex-col") .AttachTo("userbadge") - const el = state.layoutToUse.extraLink new Combine([ - new ExtraLinkButton(state, {...state.layoutToUse.extraLink, newTab: true}) + new ExtraLinkButton(state, {...state.layoutToUse.extraLink, newTab: true, requirements: new Set<"iframe" | "no-iframe" | "welcome-message" | "no-welcome-message">( ) }) ]).SetClass("flex items-center justify-center normal-background h-full") .AttachTo("on-small-screen")