Center label if no icon is present, add login button to index page

This commit is contained in:
Pieter Vander Vennet 2021-11-22 00:50:29 +01:00
parent 7a45477ae2
commit 4366366586
10 changed files with 283 additions and 387 deletions

View file

@ -8,6 +8,8 @@ import {Utils} from "../Utils";
import LanguagePicker from "./LanguagePicker";
import IndexText from "./BigComponents/IndexText";
import FeaturedMessage from "./BigComponents/FeaturedMessage";
import Toggle from "./Input/Toggle";
import {SubtleButton} from "./Base/SubtleButton";
export default class AllThemesGui {
constructor() {
@ -15,16 +17,22 @@ export default class AllThemesGui {
try {
new FixedUiElement("").AttachTo("centermessage")
const state = new UserRelatedState(undefined, undefined);
const state = new UserRelatedState(undefined);
const intro = new Combine([
LanguagePicker.CreateLanguagePicker(Translations.t.index.title.SupportedLanguages())
.SetClass("absolute top-2 right-3"),
.SetClass("flex absolute top-2 right-3"),
new IndexText()
]);
new Combine([
intro,
new FeaturedMessage(),
new MoreScreen(state, true),
new Toggle(
undefined,
new SubtleButton(undefined, Translations.t.index.logIn).SetStyle("height:min-content").onClick(() => state.osmConnection.AttemptLogin()),
state.osmConnection.isLoggedIn),
Translations.t.general.aboutMapcomplete
.Subs({"osmcha_link": Utils.OsmChaLinkFor(7)})
.SetClass("link-underline"),

View file

@ -33,16 +33,11 @@ export default class FeaturedMessage extends Combine {
public static WelcomeMessages(): { start_date: Date, end_date: Date, message: string, featured_theme?: string }[] {
const all_messages: { start_date: Date, end_date: Date, message: string, featured_theme?: string }[] = []
console.log("Constructing the list...", welcome_messages)
for (const i in welcome_messages) {
console.log(i)
if (isNaN(Number(i))) {
continue
}
console.log("> ", i)
const wm = welcome_messages[i]
console.log(wm)
if (wm === null) {
continue
}