Skip to content

Commit f126dbe

Browse files
author
Lucas Araujo
committed
[DDW-738] Review changes
1 parent 60ce375 commit f126dbe

File tree

2 files changed

+7
-16
lines changed

2 files changed

+7
-16
lines changed

source/renderer/app/components/sidebar/Sidebar.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,10 @@ type Props = {
2626
isShelleyActivated: boolean,
2727
};
2828

29-
const getCategoryContent = (categoryName: string, network) => {
30-
if (categoryName === 'NETWORK_INFO') {
31-
return <SidebarCategoryNetworkInfo network={network} />;
32-
}
33-
return null;
34-
};
29+
const getCategoryContent = (categoryName: string, network) =>
30+
categoryName === 'NETWORK_INFO' ? (
31+
<SidebarCategoryNetworkInfo network={network} />
32+
) : null;
3533

3634
const Sidebar = ({
3735
menus,
@@ -81,10 +79,8 @@ const Sidebar = ({
8179
<SidebarWalletsMenu
8280
wallets={menus?.wallets?.items || []}
8381
onAddWallet={onAddWallet}
84-
onWalletItemClick={menus?.wallets?.actions?.onWalletItemClick || null}
85-
isActiveWallet={(id) =>
86-
id === (menus?.wallets?.activeWalletId || null)
87-
}
82+
onWalletItemClick={menus?.wallets?.actions?.onWalletItemClick}
83+
isActiveWallet={(id) => id === menus?.wallets?.activeWalletId}
8884
isAddWalletButtonActive={pathname === ROUTES.WALLETS.ADD}
8985
isShelleyActivated={isShelleyActivated}
9086
visible={isShowingSubMenus}
Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
// @flow
22
import type { ShouldShowWalletSubMenu } from './types';
33

4-
export const isCategoryActive = (
5-
activeSidebarCategory: string,
6-
currentRoute: string
7-
) => activeSidebarCategory === currentRoute;
8-
94
export const shouldShowWalletSubMenu = ({
105
activeSidebarCategory,
116
walletRoute,
127
menus,
138
}: ShouldShowWalletSubMenu) =>
14-
menus?.wallets?.items && isCategoryActive(activeSidebarCategory, walletRoute);
9+
menus?.wallets?.items && activeSidebarCategory === walletRoute;

0 commit comments

Comments
 (0)