Small cleanup, only hide images in the label
This commit is contained in:
parent
400756cdea
commit
ad2f7b2bd6
1 changed files with 11 additions and 11 deletions
|
@ -21,7 +21,7 @@ export class SubtleButton extends UIElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected InnerRender(): string | BaseUIElement {
|
protected InnerRender(): string | BaseUIElement {
|
||||||
const classes = "no-images block flex p-3 my-2 bg-subtle rounded-lg hover:shadow-xl hover:bg-unsubtle transition-colors transition-shadow link-no-underline";
|
const classes = "block flex p-3 my-2 bg-subtle rounded-lg hover:shadow-xl hover:bg-unsubtle transition-colors transition-shadow link-no-underline";
|
||||||
const message = Translations.W(this.message);
|
const message = Translations.W(this.message);
|
||||||
let img;
|
let img;
|
||||||
if ((this.imageUrl ?? "") === "") {
|
if ((this.imageUrl ?? "") === "") {
|
||||||
|
@ -31,24 +31,24 @@ export class SubtleButton extends UIElement {
|
||||||
} else {
|
} else {
|
||||||
img = this.imageUrl;
|
img = this.imageUrl;
|
||||||
}
|
}
|
||||||
img?.SetClass("block flex items-center justify-center h-11 w-11 flex-shrink0 mr-4")
|
const image = new Combine([img?.SetClass("block flex items-center justify-center h-11 w-11 flex-shrink0 mr-4")])
|
||||||
const image = new Combine([img])
|
|
||||||
.SetClass("flex-shrink-0");
|
.SetClass("flex-shrink-0");
|
||||||
|
|
||||||
|
message?.SetClass("block overflow-ellipsis no-images")
|
||||||
|
|
||||||
|
const button = new Combine([
|
||||||
|
image,
|
||||||
|
message
|
||||||
|
]).SetClass("flex group w-full")
|
||||||
|
|
||||||
if (this.linkTo == undefined) {
|
if (this.linkTo == undefined) {
|
||||||
this.SetClass(classes)
|
this.SetClass(classes)
|
||||||
return new Combine([
|
return button
|
||||||
image,
|
|
||||||
message?.SetClass("block overflow-ellipsis"),
|
|
||||||
]).SetClass("flex group w-full");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return new Link(
|
return new Link(
|
||||||
new Combine([
|
button,
|
||||||
image,
|
|
||||||
message?.SetClass("block overflow-ellipsis")
|
|
||||||
]).SetClass("flex group w-full"),
|
|
||||||
this.linkTo.url,
|
this.linkTo.url,
|
||||||
this.linkTo.newTab ?? false
|
this.linkTo.newTab ?? false
|
||||||
).SetClass(classes)
|
).SetClass(classes)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue