From 7b9a74819993b00f01a22aae0ffe6776419ac3a2 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Thu, 11 Jan 2024 02:20:29 +0100 Subject: [PATCH] Refactoring: remove obsolete class --- src/Models/ThemeConfig/TagRenderingConfig.ts | 11 +++---- src/UI/Base/Paragraph.ts | 30 -------------------- 2 files changed, 4 insertions(+), 37 deletions(-) delete mode 100644 src/UI/Base/Paragraph.ts diff --git a/src/Models/ThemeConfig/TagRenderingConfig.ts b/src/Models/ThemeConfig/TagRenderingConfig.ts index 06106a7de..384c43912 100644 --- a/src/Models/ThemeConfig/TagRenderingConfig.ts +++ b/src/Models/ThemeConfig/TagRenderingConfig.ts @@ -15,7 +15,6 @@ import { QuestionableTagRenderingConfigJson, } from "./Json/QuestionableTagRenderingConfigJson" import { FixedUiElement } from "../../UI/Base/FixedUiElement" -import { Paragraph } from "../../UI/Base/Paragraph" import Validators, { ValidatorType } from "../../UI/InputElement/Validators" import { TagRenderingConfigJson } from "./Json/TagRenderingConfigJson" import Constants from "../Constants" @@ -754,12 +753,10 @@ export default class TagRenderingConfig { withRender = [ `This rendering asks information about the property `, Link.OsmWiki(this.freeform.key), - new Paragraph( - new Combine([ - "This is rendered with ", - new FixedUiElement(this.render.txt).SetClass("code font-bold"), - ]) - ), + new Combine([ + "This is rendered with ", + new FixedUiElement(this.render.txt).SetClass("code font-bold"), + ]), ] } diff --git a/src/UI/Base/Paragraph.ts b/src/UI/Base/Paragraph.ts deleted file mode 100644 index 4a8d4546a..000000000 --- a/src/UI/Base/Paragraph.ts +++ /dev/null @@ -1,30 +0,0 @@ -import BaseUIElement from "../BaseUIElement" - -export class Paragraph extends BaseUIElement { - public readonly content: string | BaseUIElement - - constructor(html: string | BaseUIElement) { - super() - this.content = html ?? "" - } - - AsMarkdown(): string { - let c: string - if (typeof this.content !== "string") { - c = this.content.AsMarkdown() - } else { - c = this.content - } - return "\n\n" + c + "\n\n" - } - - protected InnerConstructElement(): HTMLElement { - const e = document.createElement("p") - if (typeof this.content !== "string") { - e.appendChild(this.content.ConstructElement()) - } else { - e.innerHTML = this.content - } - return e - } -}