Adds sl-copy-button fontawesome icons (#302)
- Changes `sl-copy-button` icons to use fontawesome equivalents so they fit in with everything else in ReplayWebpage - Converts sl-icon to use fa-icon for error icon - Adds missing whitespace Co-authored-by: Ilya Kreymer <ikreymer@gmail.com>
This commit is contained in:
co-authored by
Ilya Kreymer
parent
858f9d61bb
commit
00f01222a7
@@ -2,8 +2,27 @@ import { LitElement, css, html, nothing } from "lit";
|
|||||||
import { customElement, property } from "lit/decorators.js";
|
import { customElement, property } from "lit/decorators.js";
|
||||||
|
|
||||||
import { wrapCss } from "./../misc";
|
import { wrapCss } from "./../misc";
|
||||||
|
import faClone from "@fortawesome/fontawesome-free/svgs/regular/clone.svg";
|
||||||
|
import faCheck from "@fortawesome/fontawesome-free/svgs/solid/check.svg";
|
||||||
|
import faX from "@fortawesome/fontawesome-free/svgs/solid/times.svg";
|
||||||
|
|
||||||
import "@shoelace-style/shoelace/dist/components/copy-button/copy-button.js";
|
import "@shoelace-style/shoelace/dist/components/copy-button/copy-button.js";
|
||||||
|
|
||||||
|
import { registerIconLibrary } from "@shoelace-style/shoelace/dist/utilities/icon-library.js";
|
||||||
|
|
||||||
|
import systemLibrary from "@shoelace-style/shoelace/dist/components/icon/library.system";
|
||||||
|
|
||||||
|
// disable system library to prevent loading of unused data: URLs
|
||||||
|
// allow only "x-lg" as it is needed for sl-dialog
|
||||||
|
registerIconLibrary("system", {
|
||||||
|
resolver: (name) => {
|
||||||
|
if (name === "x-lg") {
|
||||||
|
return systemLibrary.resolver(name);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
@customElement("wr-labeled-field")
|
@customElement("wr-labeled-field")
|
||||||
class LabeledField extends LitElement {
|
class LabeledField extends LitElement {
|
||||||
@property({ type: String })
|
@property({ type: String })
|
||||||
@@ -48,7 +67,23 @@ class LabeledField extends LitElement {
|
|||||||
<div class="col-content">
|
<div class="col-content">
|
||||||
<slot></slot>
|
<slot></slot>
|
||||||
${this.copy
|
${this.copy
|
||||||
? html` <sl-copy-button .value=${this.copy || ""}></sl-copy-button>`
|
? html` <sl-copy-button .value=${this.copy || ""}>
|
||||||
|
<fa-icon
|
||||||
|
slot="copy-icon"
|
||||||
|
.svg=${faClone}
|
||||||
|
aria-hidden="true"
|
||||||
|
></fa-icon>
|
||||||
|
<fa-icon
|
||||||
|
slot="success-icon"
|
||||||
|
.svg=${faCheck}
|
||||||
|
aria-hidden="true"
|
||||||
|
></fa-icon>
|
||||||
|
<fa-icon
|
||||||
|
slot="error-icon"
|
||||||
|
.svg=${faX}
|
||||||
|
aria-hidden="true"
|
||||||
|
></fa-icon>
|
||||||
|
</sl-copy-button>`
|
||||||
: nothing}
|
: nothing}
|
||||||
</div>`;
|
</div>`;
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -181,7 +181,7 @@ class ItemInfo extends LitElement {
|
|||||||
${certFingerprintUrl
|
${certFingerprintUrl
|
||||||
? html`<span
|
? html`<span
|
||||||
><a target="_blank" href="${certFingerprintUrl}"
|
><a target="_blank" href="${certFingerprintUrl}"
|
||||||
>View Certificate</a
|
> View Certificate</a
|
||||||
></span
|
></span
|
||||||
>`
|
>`
|
||||||
: nothing}
|
: nothing}
|
||||||
|
|||||||
+6
-1
@@ -32,6 +32,7 @@ import {
|
|||||||
getDateFromTS,
|
getDateFromTS,
|
||||||
} from "./pageutils";
|
} from "./pageutils";
|
||||||
|
|
||||||
|
import fasTriangleExclamation from "@fortawesome/fontawesome-free/svgs/solid/exclamation-triangle.svg";
|
||||||
import fasBook from "@fortawesome/fontawesome-free/svgs/solid/book.svg";
|
import fasBook from "@fortawesome/fontawesome-free/svgs/solid/book.svg";
|
||||||
|
|
||||||
import fasDownload from "@fortawesome/fontawesome-free/svgs/solid/download.svg";
|
import fasDownload from "@fortawesome/fontawesome-free/svgs/solid/download.svg";
|
||||||
@@ -1478,7 +1479,11 @@ class Item extends LitElement {
|
|||||||
renderItemInfo() {
|
renderItemInfo() {
|
||||||
if (!this.itemInfo)
|
if (!this.itemInfo)
|
||||||
return html`<sl-alert open variant="warning">
|
return html`<sl-alert open variant="warning">
|
||||||
<sl-icon slot="icon" name="exclamation-triangle"></sl-icon>
|
<fa-icon
|
||||||
|
slot="icon"
|
||||||
|
.svg=${fasTriangleExclamation}
|
||||||
|
aria-hidden="true"
|
||||||
|
></fa-icon>
|
||||||
<strong>Archive info is not available</strong><br />
|
<strong>Archive info is not available</strong><br />
|
||||||
Please reload and try again.
|
Please reload and try again.
|
||||||
</sl-alert>`;
|
</sl-alert>`;
|
||||||
|
|||||||
Reference in New Issue
Block a user