Show loading screen when logging in

This commit is contained in:
Pieter Vander Vennet 2022-02-15 15:42:09 +01:00
parent 0a43a69a0c
commit e721146ca1
7 changed files with 75 additions and 353 deletions

View file

@ -8,20 +8,12 @@ import Link from "../Base/Link";
import Toggle from "../Input/Toggle";
import Img from "../Base/Img";
import MapState from "../../Logic/State/MapState";
import {LoginToggle} from "../Popup/LoginButton";
export default class UserBadge extends Toggle {
export default class UserBadge extends LoginToggle {
constructor(state: MapState) {
const userDetails = state.osmConnection.userDetails;
const loginButton = Translations.t.general.loginWithOpenStreetMap
.Clone()
.SetClass("userbadge-login inline-flex justify-center items-center w-full h-full text-lg font-bold min-w-[20em]")
.onClick(() => state.osmConnection.AttemptLogin());
const logout =
Svg.logout_svg()
.onClick(() => {
@ -126,16 +118,14 @@ export default class UserBadge extends Toggle {
}
}));
userBadge.SetClass("inline-block m-0 w-full").SetStyle("pointer-events: all")
super(
userBadge,
loginButton,
state.osmConnection.isLoggedIn
new Combine([userBadge.SetClass("inline-block m-0 w-full").SetStyle("pointer-events: all")])
.SetClass("shadow rounded-full h-min overflow-hidden block w-full md:w-max"),
Translations.t.general.loginWithOpenStreetMap,
state
)
this.SetClass("shadow rounded-full h-min overflow-hidden block w-full md:w-max")
}