summaryrefslogtreecommitdiff
path: root/web/source/settings/lib/navigation/menu.tsx
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/navigation/menu.tsx
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/navigation/menu.tsx')
-rw-r--r--web/source/settings/lib/navigation/menu.tsx19
1 files changed, 13 insertions, 6 deletions
diff --git a/web/source/settings/lib/navigation/menu.tsx b/web/source/settings/lib/navigation/menu.tsx
index 514e3ea2f..2bd07a055 100644
--- a/web/source/settings/lib/navigation/menu.tsx
+++ b/web/source/settings/lib/navigation/menu.tsx
@@ -110,12 +110,19 @@ export function MenuItem(props: PropsWithChildren<MenuItemProps>) {
if (topLevel) {
classNames.push("category", "top-level");
} else {
- if (thisLevel === 1 && hasChildren) {
- classNames.push("category", "expanding");
- } else if (thisLevel === 1 && !hasChildren) {
- classNames.push("view", "expanding");
- } else if (thisLevel === 2) {
- classNames.push("view", "nested");
+ switch (true) {
+ case thisLevel === 1 && hasChildren:
+ classNames.push("category", "expanding");
+ break;
+ case thisLevel === 1 && !hasChildren:
+ classNames.push("view", "expanding");
+ break;
+ case thisLevel >= 2 && hasChildren:
+ classNames.push("nested", "category");
+ break;
+ case thisLevel >= 2 && !hasChildren:
+ classNames.push("nested", "view");
+ break;
}
}