From ddfcffeda59c2d2503645b36aba423eff9e2b5b9 Mon Sep 17 00:00:00 2001 From: Innei Date: Thu, 10 Oct 2024 17:20:09 +0800 Subject: [PATCH] fix: dropmenu icon prop passive, profile avatar button cls Signed-off-by: Innei --- .../ui/dropdown-menu/dropdown-menu.tsx | 8 +- .../src/modules/user/ProfileButton.tsx | 177 +++++++++--------- 2 files changed, 94 insertions(+), 91 deletions(-) diff --git a/apps/renderer/src/components/ui/dropdown-menu/dropdown-menu.tsx b/apps/renderer/src/components/ui/dropdown-menu/dropdown-menu.tsx index 7ae426c02..e9aa770b9 100644 --- a/apps/renderer/src/components/ui/dropdown-menu/dropdown-menu.tsx +++ b/apps/renderer/src/components/ui/dropdown-menu/dropdown-menu.tsx @@ -76,7 +76,7 @@ const DropdownMenuItem = React.forwardRef< inset?: boolean icon?: React.ReactNode } ->(({ className, inset, ...props }, ref) => ( +>(({ className, inset, icon, ...props }, ref) => ( - {!!props.icon && ( - {props.icon} + {!!icon && ( + {icon} )} {props.children} {/* Justify Fill */} - {!!props.icon && } + {!!icon && } )) DropdownMenuItem.displayName = DropdownMenuPrimitive.Item.displayName diff --git a/apps/renderer/src/modules/user/ProfileButton.tsx b/apps/renderer/src/modules/user/ProfileButton.tsx index 1b389898e..615248f68 100644 --- a/apps/renderer/src/modules/user/ProfileButton.tsx +++ b/apps/renderer/src/modules/user/ProfileButton.tsx @@ -48,107 +48,110 @@ export const ProfileButton: FC = memo((props) => { } return ( - - - - - - + <> + + + + + + + + +
+
{user?.name}
+
{user?.handle}
+
+
+ + { + nextFrame(presentPowerModal) + }} + > +
+ + +
+
+ + + + { + presentUserProfile(user?.id) + }} + icon={} + > + {t("user_button.profile")} + + + { + presentAchievement() + }} + icon={} + > + {t("user_button.achievement")} + + + + { + nextFrame(settingModalPresent) + }} + icon={} + > + {t("user_button.preferences")} + + + {!window.electron && ( + <> + { + window.open(`${repository.url}/releases`) + }} + icon={} + > + {t("user_button.download_desktop_app")} + + + + )} + } + > + {t("user_button.log_out")} + +
+
{x !== 0 && y !== 0 && ( )} - - -
-
{user?.name}
-
{user?.handle}
-
-
- - { - nextFrame(presentPowerModal) - }} - > -
- - -
-
- - - - { - presentUserProfile(user?.id) - }} - icon={} - > - {t("user_button.profile")} - - - { - presentAchievement() - }} - icon={} - > - {t("user_button.achievement")} - - - - { - nextFrame(settingModalPresent) - }} - icon={} - > - {t("user_button.preferences")} - - - {!window.electron && ( - <> - { - window.open(`${repository.url}/releases`) - }} - icon={} - > - {t("user_button.download_desktop_app")} - - - - )} - } - > - {t("user_button.log_out")} - -
-
+ ) }) ProfileButton.displayName = "ProfileButton"