Skip to content
This repository was archived by the owner on Feb 26, 2025. It is now read-only.

Commit 398dc0a

Browse files
authored
Add enhanced support for external subapp (#1171)
- support description property to use as title when hovering over app - use a different default icon as previous default icon is used by studios
1 parent 837d99f commit 398dc0a

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/shared/components/Header/Navigation.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,19 @@ const ExternalNavigationItem: React.FC<{
2727
onClickNavigationItem: () => void;
2828
appIcon: string;
2929
appLabel: string;
30-
}> = ({ appKey, appURL, onClickNavigationItem, appIcon, appLabel }) => {
30+
appDescription: string;
31+
}> = ({
32+
appKey,
33+
appURL,
34+
onClickNavigationItem,
35+
appIcon,
36+
appLabel,
37+
appDescription,
38+
}) => {
3139
return (
3240
<NavigationItemContainer appKey={appKey}>
3341
<a
34-
title=""
42+
title={appDescription}
3543
target="_blank"
3644
href={appURL || ''}
3745
onClick={onClickNavigationItem}
@@ -76,6 +84,7 @@ const Navigation: React.FC<{ subApps: any; authenticated: boolean }> = ({
7684
appURL={app.url}
7785
appIcon={app.icon}
7886
appLabel={app.label}
87+
appDescription={app.description}
7988
onClickNavigationItem={() => setNavMenuVisible(false)}
8089
/>
8190
) : app.requireLogin && !authenticated ? (

src/shared/hooks/useSubApps.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ function addExternalSubApps(
77
subApps: Map<string, SubAppObject>,
88
eSubbApps: ExternalSubApp[]
99
) {
10-
const icon = require('../images/gridIcon.svg');
10+
const defaultIcon = require('../images/noteIcon.svg');
1111
eSubbApps.forEach(e => {
1212
subApps.set(e.title, {
13-
icon,
13+
icon: e.icon ? e.icon : defaultIcon,
14+
description: e.description,
1415
namespace: e.title,
1516
routes: [],
1617
subAppType: 'external',
@@ -23,6 +24,8 @@ function addExternalSubApps(
2324
type ExternalSubApp = {
2425
title: string;
2526
url: string;
27+
icon?: string;
28+
description?: string;
2629
};
2730

2831
const useSubApps = () => {

0 commit comments

Comments
 (0)