Add email question, some tweaks

This commit is contained in:
Pieter Vander Vennet 2020-07-29 19:02:36 +02:00
commit f67508336a
12 changed files with 123 additions and 69 deletions

View file

@ -1,20 +1,33 @@
import {UIElement} from "../UIElement";
import Translations from "../i18n/Translations";
import Combine from "./Combine";
import {link} from "fs";
export class SubtleButton extends UIElement{
private imageUrl: string;
private message: UIElement;
private linkTo: string = undefined;
constructor(imageUrl: string, message: string | UIElement) {
constructor(imageUrl: string, message: string | UIElement, linkTo : string = undefined) {
super(undefined);
this.linkTo = linkTo;
this.message = Translations.W(message);
this.imageUrl = imageUrl;
}
InnerRender(): string {
if(this.linkTo != undefined){
return new Combine([
`<a class="subtle-button" href="${this.linkTo}" target="_blank">`,
this.imageUrl !== undefined ? `<img src='${this.imageUrl}'>` : "",
this.message,
'</a>'
]).Render();
}
return new Combine([
'<span class="subtle-button">',
this.imageUrl !== undefined ? `<img src='${this.imageUrl}'>` : "",