fix: show correct software names (close #30)

This commit is contained in:
naskya 2023-07-21 13:18:21 +00:00
parent de18274a75
commit 6b21ca3131
Signed by: naskya
GPG key ID: 164DFF24E2D40139
2 changed files with 22 additions and 1 deletions

View file

@ -17,6 +17,7 @@
## 細かい変更点
- インスタンスティッカーのツールチップに出るソフトウェア名で FoundKey, PeerTube, GNU Social, WriteFreely などを正しく表示する
- 藍ちゃんウィジェットの復活
- インスタンスティッカーのツールチップにソフトウェアのバージョン番号も表示する
- 気になるから

View file

@ -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<string, string>([
["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 =