Add image support in notes

This commit is contained in:
Pieter Vander Vennet 2022-01-08 14:08:04 +01:00
parent e8d1d5422e
commit b15eaff55e
8 changed files with 195 additions and 66 deletions

26
UI/Popup/LoginButton.ts Normal file
View 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)
}
}