2021-01-04 04:06:21 +01:00
|
|
|
import State from "../../State";
|
|
|
|
import Combine from "../Base/Combine";
|
|
|
|
import LanguagePicker from "../LanguagePicker";
|
|
|
|
import Translations from "../i18n/Translations";
|
2021-06-12 02:58:32 +02:00
|
|
|
import Toggle from "../Input/Toggle";
|
2021-06-16 21:23:03 +02:00
|
|
|
import {SubtleButton} from "../Base/SubtleButton";
|
|
|
|
import {UIEventSource} from "../../Logic/UIEventSource";
|
2022-01-12 02:31:51 +01:00
|
|
|
import {LoginToggle} from "../Popup/LoginButton";
|
2020-07-31 01:45:54 +02:00
|
|
|
|
2021-09-28 18:00:44 +02:00
|
|
|
export default class ThemeIntroductionPanel extends Combine {
|
2020-07-31 01:45:54 +02:00
|
|
|
|
2021-06-16 21:23:03 +02:00
|
|
|
constructor(isShown: UIEventSource<boolean>) {
|
2022-01-12 02:31:51 +01:00
|
|
|
const t = Translations.t.general
|
2021-09-28 18:00:44 +02:00
|
|
|
const layout = State.state.layoutToUse
|
2021-06-12 02:58:32 +02:00
|
|
|
|
2022-01-12 02:31:51 +01:00
|
|
|
const languagePicker = LanguagePicker.CreateLanguagePicker(layout.language, t.pickLanguage.Clone())
|
2021-09-09 00:05:51 +02:00
|
|
|
|
2021-06-16 21:23:03 +02:00
|
|
|
const toTheMap = new SubtleButton(
|
2021-06-18 01:25:13 +02:00
|
|
|
undefined,
|
2022-01-12 02:31:51 +01:00
|
|
|
t.openTheMap.Clone().SetClass("text-xl font-bold w-full text-center")
|
2021-09-09 00:05:51 +02:00
|
|
|
).onClick(() => {
|
2021-06-16 21:23:03 +02:00
|
|
|
isShown.setData(false)
|
|
|
|
}).SetClass("only-on-mobile")
|
2020-09-03 16:44:48 +02:00
|
|
|
|
2021-06-12 02:58:32 +02:00
|
|
|
|
|
|
|
const loginStatus =
|
|
|
|
new Toggle(
|
2022-01-12 02:31:51 +01:00
|
|
|
new LoginToggle(
|
2022-02-09 01:50:10 +01:00
|
|
|
undefined,
|
2022-01-12 02:31:51 +01:00
|
|
|
new Combine([Translations.t.general.loginWithOpenStreetMap.SetClass("text-xl font-bold"),
|
|
|
|
Translations.t.general.loginOnlyNeededToEdit.Clone().SetClass("font-bold")]
|
|
|
|
).SetClass("flex flex-col"),
|
|
|
|
State.state
|
2021-06-12 02:58:32 +02:00
|
|
|
),
|
|
|
|
undefined,
|
|
|
|
State.state.featureSwitchUserbadge
|
2021-01-07 04:50:12 +01:00
|
|
|
)
|
2020-08-27 18:44:16 +02:00
|
|
|
|
2021-09-28 18:00:44 +02:00
|
|
|
super([
|
2021-10-11 21:23:14 +02:00
|
|
|
layout.description.Clone().SetClass("blcok mb-4"),
|
2021-06-16 21:23:03 +02:00
|
|
|
toTheMap,
|
2021-10-11 21:23:14 +02:00
|
|
|
loginStatus.SetClass("block"),
|
|
|
|
layout.descriptionTail?.Clone().SetClass("block mt-4"),
|
2021-10-12 15:19:27 +02:00
|
|
|
languagePicker?.SetClass("block mt-4"),
|
2021-03-24 01:25:57 +01:00
|
|
|
...layout.CustomCodeSnippets()
|
2021-09-28 18:00:44 +02:00
|
|
|
])
|
2020-07-31 01:45:54 +02:00
|
|
|
|
2021-06-12 02:58:32 +02:00
|
|
|
this.SetClass("link-underline")
|
|
|
|
}
|
2020-11-24 14:36:43 +01:00
|
|
|
}
|