From 69b0f0090ebd1a61da23c3ddd0d64b25f4a25410 Mon Sep 17 00:00:00 2001 From: El-Magico777 Date: Tue, 15 Jul 2025 19:08:42 +0200 Subject: [PATCH 1/2] feat: Implement prominent Discord button with icon --- src/client/Main.ts | 7 +++++++ src/client/components/baseComponents/Button.ts | 16 +++++++++++++--- src/client/index.html | 14 +++++++------- src/client/styles/components/button.css | 15 ++++++++++++++- 4 files changed, 41 insertions(+), 11 deletions(-) diff --git a/src/client/Main.ts b/src/client/Main.ts index ab636db0c..18fa9cc3b 100644 --- a/src/client/Main.ts +++ b/src/client/Main.ts @@ -107,6 +107,13 @@ class Client { "logout-discord", ) as OButton; + const joinDiscordButton = document.getElementById( + "join-discord-button", + ) as OButton; + joinDiscordButton.addEventListener("click", () => { + window.open("https://discord.gg/w8HXjhaBkU", "_blank"); + }); + this.usernameInput = document.querySelector( "username-input", ) as UsernameInput; diff --git a/src/client/components/baseComponents/Button.ts b/src/client/components/baseComponents/Button.ts index 019d9adbd..7bcf10d4e 100644 --- a/src/client/components/baseComponents/Button.ts +++ b/src/client/components/baseComponents/Button.ts @@ -11,6 +11,7 @@ export class OButton extends LitElement { @property({ type: Boolean }) block = false; @property({ type: Boolean }) blockDesktop = false; @property({ type: Boolean }) disable = false; + @property({ type: String }) iconSrc = ""; createRenderRoot() { return this; @@ -28,9 +29,18 @@ export class OButton extends LitElement { })} ?disabled=${this.disable} > - ${`${this.translationKey}` === "" - ? `${this.title}` - : `${translateText(this.translationKey)}`} + + ${this.iconSrc + ? html`icon` + : ""} + ${`${this.translationKey}` === "" + ? `${this.title}` + : `${translateText(this.translationKey)}`} + `; } diff --git a/src/client/index.html b/src/client/index.html index b9d8b653a..18cecf4ed 100644 --- a/src/client/index.html +++ b/src/client/index.html @@ -205,6 +205,13 @@ block > + +
@@ -326,13 +333,6 @@ > Wiki - - Join the Discord! -