Skip to content

Commit e63cd39

Browse files
kduncanhsuDuncan Hsu
andauthored
feat(sidebar-nav): update skills and docgen icons to BP (WEBAPP-42958) (#4399)
* feat(sidebar-nav): update skills and docgen icons to BP (WEBAPP-42958) * feat(sidebar-nav): update skills and docgen icons to BP (WEBAPP-42958) --------- Co-authored-by: Duncan Hsu <[email protected]>
1 parent 8aaa6a1 commit e63cd39

File tree

2 files changed

+30
-2
lines changed

2 files changed

+30
-2
lines changed

flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,15 @@ declare module '@box/blueprint-web-assets/icons/Medium' {
1313
declare export var ChevronUp: React$ComponentType<any>;
1414
declare export var RightSidebarChevronClose: React$ComponentType<any>;
1515
declare export var RightSidebarChevronOpen: React$ComponentType<any>;
16+
declare export var MagicWand: React$ComponentType<any>;
17+
declare export var DocGen: React$ComponentType<any>;
1618
}
1719

1820
declare module '@box/blueprint-web-assets/icons/MediumFilled' {
1921
declare export var Comment: React$ComponentType<any>;
2022
declare export var InformationCircle: React$ComponentType<any>;
2123
declare export var Metadata: React$ComponentType<any>;
24+
declare export var MagicWand: React$ComponentType<any>;
2225
}
2326

2427
declare module '@box/blueprint-web-assets/icons/Content' {

src/elements/content-sidebar/SidebarNav.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ import {
1414
Comment as CommentIcon,
1515
InformationCircle as InformationCircleIcon,
1616
Metadata as MetadataIcon,
17+
MagicWand as MagicWandIcon,
18+
DocGen as BPDocGenIcon,
1719
} from '@box/blueprint-web-assets/icons/Medium';
1820
import {
1921
Comment as CommentIconFilled,
2022
InformationCircle as InformationCircleIconFilled,
2123
Metadata as MetadataIconFilled,
24+
MagicWand as MagicWandIconFilled,
2225
} from '@box/blueprint-web-assets/icons/MediumFilled';
2326
import { Size6, Size5, IconIconBlue } from '@box/blueprint-web-assets/tokens/tokens';
2427
import { usePromptFocus } from '@box/box-ai-content-answers';
@@ -92,6 +95,28 @@ const MetadataIconWrapper = ({ isActive, isPreviewModernizationEnabled }: IconWr
9295
);
9396
};
9497

98+
const SkillsIconWrapper = ({ isActive, isPreviewModernizationEnabled }: IconWrapperProps) => {
99+
if (!isPreviewModernizationEnabled) {
100+
return <IconMagicWand className="bcs-SidebarNav-icon" />;
101+
}
102+
return isActive ? (
103+
<MagicWandIconFilled {...SIDEBAR_TAB_ICON_PROPS} color={IconIconBlue} />
104+
) : (
105+
<MagicWandIcon {...SIDEBAR_TAB_ICON_PROPS} />
106+
);
107+
};
108+
109+
const DocGenIconWrapper = ({ isActive, isPreviewModernizationEnabled }: IconWrapperProps) => {
110+
if (!isPreviewModernizationEnabled) {
111+
return <DocGenIcon className="bcs-SidebarNav-icon" />;
112+
}
113+
return isActive ? (
114+
<BPDocGenIcon {...SIDEBAR_TAB_ICON_PROPS} color={IconIconBlue} />
115+
) : (
116+
<BPDocGenIcon {...SIDEBAR_TAB_ICON_PROPS} />
117+
);
118+
};
119+
95120
type Props = {
96121
additionalTabs?: Array<AdditionalSidebarTab>,
97122
elementId: string,
@@ -223,7 +248,7 @@ const SidebarNav = ({
223248
sidebarView={SIDEBAR_VIEW_SKILLS}
224249
tooltip={intl.formatMessage(messages.sidebarSkillsTitle)}
225250
>
226-
<IconMagicWand className="bcs-SidebarNav-icon" />
251+
<SkillsIconWrapper isPreviewModernizationEnabled={isPreviewModernizationEnabled} />
227252
</SidebarNavButton>
228253
)}
229254
{hasMetadata && (
@@ -250,7 +275,7 @@ const SidebarNav = ({
250275
sidebarView={SIDEBAR_VIEW_DOCGEN}
251276
tooltip={intl.formatMessage(messages.sidebarDocGenTooltip)}
252277
>
253-
<DocGenIcon className="bcs-SidebarNav-icon" />
278+
<DocGenIconWrapper isPreviewModernizationEnabled={isPreviewModernizationEnabled} />
254279
</SidebarNavButton>
255280
)}
256281
</SidebarNavTablist>

0 commit comments

Comments
 (0)