From 2147661601259d9bdb79e40b6fef3f57634e309c Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Sat, 9 Dec 2023 16:51:42 +0100 Subject: [PATCH] Remove obsolete, legacy class --- scripts/generateIncludedImages.ts | 1 + src/UI/LoggedInUserIndicator.ts | 42 ------------------------------- 2 files changed, 1 insertion(+), 42 deletions(-) delete mode 100644 src/UI/LoggedInUserIndicator.ts diff --git a/scripts/generateIncludedImages.ts b/scripts/generateIncludedImages.ts index 6e0d64348..a497d58ac 100644 --- a/scripts/generateIncludedImages.ts +++ b/scripts/generateIncludedImages.ts @@ -62,6 +62,7 @@ function genImages(dryrun = false) { "brick_wall_round", "bug", "back", + "person", ].map((s) => s.toLowerCase()) const dir = fs.readdirSync("./assets/svg") diff --git a/src/UI/LoggedInUserIndicator.ts b/src/UI/LoggedInUserIndicator.ts deleted file mode 100644 index 4d0ca0ac4..000000000 --- a/src/UI/LoggedInUserIndicator.ts +++ /dev/null @@ -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" - ) - }) - ) - } -}