From 6b21ca3131c08506c1608f2bd388f7a3205e9cda Mon Sep 17 00:00:00 2001 From: naskya Date: Fri, 21 Jul 2023 13:18:21 +0000 Subject: [PATCH] fix: show correct software names (close #30) --- README.md | 1 + .../src/components/MkInstanceTicker.vue | 22 ++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index af2799c63..93ddc805a 100644 --- a/README.md +++ b/README.md @@ -17,6 +17,7 @@ ## 細かい変更点 +- インスタンスティッカーのツールチップに出るソフトウェア名で FoundKey, PeerTube, GNU Social, WriteFreely などを正しく表示する - 藍ちゃんウィジェットの復活 - インスタンスティッカーのツールチップにソフトウェアのバージョン番号も表示する - 気になるから diff --git a/packages/client/src/components/MkInstanceTicker.vue b/packages/client/src/components/MkInstanceTicker.vue index 47ad4d30f..336fb98db 100644 --- a/packages/client/src/components/MkInstanceTicker.vue +++ b/packages/client/src/components/MkInstanceTicker.vue @@ -42,7 +42,27 @@ const instance = props.instance ?? { softwareVersion: version, }; -const capitalize = (s: string) => s && s[0].toUpperCase() + s.slice(1); +const commonNames = new Map([ + ["birdsitelive", "BirdsiteLIVE"], + ["bookwyrm", "BookWyrm"], + ["foundkey", "FoundKey"], + ["gnusocial", "GNU social"], + ["gotosocial", "GoToSocial"], + ["microblogpub", "microblog.pub"], + ["nextcloud social" "Nextcloud Social"], + ["peertube", "PeerTube"], + ["snac", "snac"], + ["takahe", "Takahē"], + ["wordpress", "WordPress"], + ["writefreely", "WriteFreely"], + ["wxwclub", "wxwClub"], +]); + +const capitalize = (s: string) => { + if (s == null) return "Unknown"; + if (commonNames.has(s)) return commonNames.get(s); + return s[0].toUpperCase() + s.slice(1); +}; const computedStyle = getComputedStyle(document.documentElement); const themeColor =