Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/improsocial/impro
An extensible Bluesky client for web impro.social
Something went wrong. Try again.
599 B · 29 lines
JavaScript
123456789101112131415161718192021222324252627282930import { Component } from "/js/components/component.js";import { html, render } from "/js/lib/lit-html.js";
export class AppIcon extends Component { static observedAttributes = ["icon"];
connectedCallback() { if (this.getAttribute("icon")) { this.render(); } }
attributeChangedCallback() { if (this.isConnected) { this.render(); } }
render() { const icon = this.getAttribute("icon"); if (!icon) { render(html``, this); return; } render(html`<svg><use href="/img/icons.svg#${icon}" /></svg>`, this); }}
AppIcon.register();