fix: show correct software names (close #30)

This commit is contained in:
naskya 2023-07-21 13:18:21 +00:00 committed by ThatOneCalculator
parent 055bec56c7
commit b164984abb
No known key found for this signature in database
GPG key ID: 8703CACD01000000

View file

@ -38,7 +38,29 @@ const instance = props.instance ?? {
softwareName: Instance.softwareName || "Firefish",
};
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"],
["snac2", "snac2"],
["takahe", "Takahē"],
["wafrn", "WAFRN"],
["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 =