From aeb66195a0d54c2d2b4a266934b71c29ee923f7f Mon Sep 17 00:00:00 2001 From: kangfenmao Date: Thu, 24 Apr 2025 17:03:00 +0800 Subject: [PATCH] feat: enhance MinAppIcon component with sidebar prop - Added optional sidebar prop to MinAppIcon for conditional styling. - Updated Sidebar component to pass sidebar prop to MinAppIcon for consistent appearance in sidebar context. --- src/renderer/src/components/Icons/MinAppIcon.tsx | 5 +++-- src/renderer/src/components/app/Sidebar.tsx | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/renderer/src/components/Icons/MinAppIcon.tsx b/src/renderer/src/components/Icons/MinAppIcon.tsx index ea7da8a05c..c9612416bb 100644 --- a/src/renderer/src/components/Icons/MinAppIcon.tsx +++ b/src/renderer/src/components/Icons/MinAppIcon.tsx @@ -5,11 +5,12 @@ import styled from 'styled-components' interface Props { app: MinAppType + sidebar?: boolean size?: number style?: React.CSSProperties } -const MinAppIcon: FC = ({ app, size = 48, style }) => { +const MinAppIcon: FC = ({ app, size = 48, style, sidebar = false }) => { const _app = DEFAULT_MIN_APPS.find((item) => item.id === app.id) if (!_app) { @@ -24,7 +25,7 @@ const MinAppIcon: FC = ({ app, size = 48, style }) => { width: `${size}px`, height: `${size}px`, backgroundColor: _app.background, - ...app.style, + ...(sidebar ? {} : app.style), ...style }} /> diff --git a/src/renderer/src/components/app/Sidebar.tsx b/src/renderer/src/components/app/Sidebar.tsx index 198e49a43b..d63c7b9992 100644 --- a/src/renderer/src/components/app/Sidebar.tsx +++ b/src/renderer/src/components/app/Sidebar.tsx @@ -248,7 +248,7 @@ const SidebarOpenedMinappTabs: FC = () => { theme={theme} onClick={() => handleOnClick(app)} className={`${isActive ? 'opened-active' : ''}`}> - + @@ -290,7 +290,7 @@ const PinnedApps: FC = () => { theme={theme} onClick={() => openMinappKeepAlive(app)} className={`${isActive ? 'active' : ''} ${openedKeepAliveMinapps.some((item) => item.id === app.id) ? 'opened-minapp' : ''}`}> - +