Refactoring: convert qr_code to Svelte, deprecate Img.ts

This commit is contained in:
Pieter Vander Vennet 2024-08-09 14:40:07 +02:00
parent a7c7064636
commit c892022073
5 changed files with 64 additions and 46 deletions

View file

@ -1,11 +1,15 @@
import { Utils } from "../../Utils"
import BaseUIElement from "../BaseUIElement"
/**
* @deprecated
*/
export default class Img extends BaseUIElement {
private readonly _src: string
private readonly _rawSvg: boolean
private readonly _options: { readonly fallbackImage?: string }
/** @deprecated
*/
constructor(
src: string,
rawSvg = false,

View file

@ -20,10 +20,17 @@
</script>
{#if $txt}
{#if cls}
<span class={cls}>
<span lang={$lang}>
{@html Utils.purify($txt)}
</span>
<WeblateLink context={t?.context} />
</span>
{:else}
<span lang={$lang}>
{@html Utils.purify($txt)}
</span>
<WeblateLink context={t?.context} />
{/if}
{/if}