forked from MapComplete/MapComplete
Add image support in notes
This commit is contained in:
parent
e8d1d5422e
commit
b15eaff55e
8 changed files with 195 additions and 66 deletions
26
UI/Popup/LoginButton.ts
Normal file
26
UI/Popup/LoginButton.ts
Normal file
|
@ -0,0 +1,26 @@
|
|||
import {SubtleButton} from "../Base/SubtleButton";
|
||||
import BaseUIElement from "../BaseUIElement";
|
||||
import Svg from "../../Svg";
|
||||
import {OsmConnection} from "../../Logic/Osm/OsmConnection";
|
||||
import Toggle from "../Input/Toggle";
|
||||
|
||||
export default class LoginButton extends SubtleButton {
|
||||
|
||||
constructor(text: BaseUIElement | string, state: {
|
||||
osmConnection: OsmConnection
|
||||
}) {
|
||||
super(Svg.osm_logo_svg(), text);
|
||||
this.onClick(() => {
|
||||
state.osmConnection.AttemptLogin()
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
export class LoginToggle extends Toggle {
|
||||
constructor(el, text: BaseUIElement | string, state: {
|
||||
osmConnection: OsmConnection
|
||||
}) {
|
||||
super(el, new LoginButton(text, state), state.osmConnection.isLoggedIn)
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue