summaryrefslogtreecommitdiff
path: root/web/source/settings/lib/util/index.ts
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-11-21 14:09:58 +0100
committerLibravatar GitHub <noreply@github.com>2024-11-21 13:09:58 +0000
commit301543616b5376585a7caff097499421acdf1806 (patch)
tree4cac6aea2c33687b1339fc3bc18e6eb64def6f9a /web/source/settings/lib/util/index.ts
parent[feature] Allow emoji shortcode to be 1-character length (#3556) (diff)
downloadgotosocial-301543616b5376585a7caff097499421acdf1806.tar.xz
[feature] Add domain permission drafts and excludes (#3547)
* [feature] Add domain permission drafts and excludes * fix typescript complaining * lint * make filenames more consistent * test own domain excluded
Diffstat (limited to 'web/source/settings/lib/util/index.ts')
-rw-r--r--web/source/settings/lib/util/index.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/source/settings/lib/util/index.ts b/web/source/settings/lib/util/index.ts
index d016f3398..4c8a90626 100644
--- a/web/source/settings/lib/util/index.ts
+++ b/web/source/settings/lib/util/index.ts
@@ -41,3 +41,16 @@ export function UseOurInstanceAccount(account: AdminAccount): boolean {
return !account.domain && account.username == ourDomain;
}
+
+/**
+ * Uppercase first letter of given string.
+ */
+export function useCapitalize(i?: string): string {
+ return useMemo(() => {
+ if (i === undefined) {
+ return "";
+ }
+
+ return i.charAt(0).toUpperCase() + i.slice(1);
+ }, [i]);
+}