Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

Swap theme and sign-out menu items

Richie McIlroyea0ebe4f3b66
diff --git a/apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx b/apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx
index 32aef8f64..c7abaaf0d 100644
--- a/apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx
+++ b/apps/web/app/(org)/dashboard/_components/Navbar/Top.tsx
@@ -227,11 +227,17 @@ const User = () => {
showCondition: true,
},
{
- name: "Sign Out",
- icon: <LogoutIcon />,
+ name: themeLabel,
+ icon: <ThemeMenuIcon />,
onClick: () => {
setMenuOpen(false);
- signOut();
+ if (document.startViewTransition) {
+ document.startViewTransition(() => {
+ setThemeHandler(nextTheme);
+ });
+ } else {
+ setThemeHandler(nextTheme);
+ }
},
iconClassName: "text-gray-11 group-hover:text-gray-12",
showCondition: true,
@@ -245,17 +251,11 @@ const User = () => {
showCondition: true,
},
{
- name: themeLabel,
- icon: <ThemeMenuIcon />,
+ name: "Sign Out",
+ icon: <LogoutIcon />,
onClick: () => {
setMenuOpen(false);
- if (document.startViewTransition) {
- document.startViewTransition(() => {
- setThemeHandler(nextTheme);
- });
- } else {
- setThemeHandler(nextTheme);
- }
+ signOut();
},
iconClassName: "text-gray-11 group-hover:text-gray-12",
showCondition: true,