Remove obsolete, legacy class

This commit is contained in:
Pieter Vander Vennet 2023-12-09 16:51:42 +01:00
parent 6205da9d41
commit 2147661601
2 changed files with 1 additions and 42 deletions

View file

@ -62,6 +62,7 @@ function genImages(dryrun = false) {
"brick_wall_round", "brick_wall_round",
"bug", "bug",
"back", "back",
"person",
].map((s) => s.toLowerCase()) ].map((s) => s.toLowerCase())
const dir = fs.readdirSync("./assets/svg") const dir = fs.readdirSync("./assets/svg")

View file

@ -1,42 +0,0 @@
import { VariableUiElement } from "./Base/VariableUIElement"
import { OsmConnection } from "../Logic/Osm/OsmConnection"
import Svg from "../Svg"
import Img from "./Base/Img"
import Combine from "./Base/Combine"
import { FixedUiElement } from "./Base/FixedUiElement"
import BaseUIElement from "./BaseUIElement"
export default class LoggedInUserIndicator extends VariableUiElement {
constructor(
osmConnection: OsmConnection,
options?: {
size?: "small" | "medium" | "large"
firstLine?: BaseUIElement
}
) {
options = options ?? {}
let size = "w-8 h-8 mr-2"
if (options.size == "medium") {
size = "w-16 h-16 mr-4"
} else if (options.size == "large") {
size = "w-32 h-32 mr-6"
}
super(
osmConnection.userDetails.mapD((ud) => {
let img = Svg.person_svg().SetClass(
"rounded-full border border-black overflow-hidden"
)
if (ud.img) {
img = new Img(ud.img)
}
let contents: BaseUIElement = new FixedUiElement(ud.name).SetClass("font-bold")
if (options?.firstLine) {
contents = new Combine([options.firstLine, contents]).SetClass("flex flex-col")
}
return new Combine([img.SetClass("rounded-full " + size), contents]).SetClass(
"flex items-center"
)
})
)
}
}