Skip to content

Commit add268a

Browse files
author
Duncan Hsu
committed
feat(sidebar-nav): update skills and docgen icons to BP (WEBAPP-42958)
1 parent 03bd678 commit add268a

File tree

4 files changed

+38
-5
lines changed

4 files changed

+38
-5
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
@@ -9,12 +9,15 @@ declare module '@box/blueprint-web-assets/icons/Medium' {
99
declare export var XMark: React$ComponentType<any>;
1010
declare export var Comment: React$ComponentType<any>;
1111
declare export var Metadata: React$ComponentType<any>;
12+
declare export var MagicWand: React$ComponentType<any>;
13+
declare export var DocGen: React$ComponentType<any>;
1214
}
1315

1416
declare module '@box/blueprint-web-assets/icons/MediumFilled' {
1517
declare export var Comment: React$ComponentType<any>;
1618
declare export var InformationCircle: React$ComponentType<any>;
1719
declare export var Metadata: React$ComponentType<any>;
20+
declare export var MagicWand: React$ComponentType<any>;
1821
}
1922

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
"@babel/template": "^7.24.7",
126126
"@babel/types": "^7.24.7",
127127
"@box/blueprint-web": "^12.98.0",
128-
"@box/blueprint-web-assets": "^4.80.4",
128+
"@box/blueprint-web-assets": "4.88.2",
129129
"@box/box-ai-agent-selector": "^0.53.0",
130130
"@box/box-ai-content-answers": "^0.139.0",
131131
"@box/box-item-type-selector": "^0.73.1",

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 MagicWandIconWrapper = ({ 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+
<MagicWandIconWrapper 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>

yarn.lock

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,12 @@
14191419
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
14201420
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
14211421

1422-
"@box/blueprint-web-assets@^4.80.0", "@box/blueprint-web-assets@^4.80.4":
1422+
"@box/blueprint-web-assets@4.88.2":
1423+
version "4.88.2"
1424+
resolved "https://registry.yarnpkg.com/@box/blueprint-web-assets/-/blueprint-web-assets-4.88.2.tgz#cb98f14dcd5a072d7c97be31030485cf9219478e"
1425+
integrity sha512-TAtiYWvudxj3i5GAa4NsiHzlF9WcIARBbp1dCxgwsFP652NEamo/3SH2wyhcc/5u1bJJLftxe5xsTv6a7dpj0w==
1426+
1427+
"@box/blueprint-web-assets@^4.80.0":
14231428
version "4.80.4"
14241429
resolved "https://registry.yarnpkg.com/@box/blueprint-web-assets/-/blueprint-web-assets-4.80.4.tgz#3db74e9c1006d2eb86ddc7e4caa23a4f0376cf92"
14251430
integrity sha512-zXIUfIC+RgzpQkA6KtLi0M5gtbXjNO3orWPNsVaJgEbYjrKahC4AejL2j4/XNaxt7AO0Xvz6vRr1Zjn1Byu4YA==
@@ -14400,7 +14405,7 @@ node-fetch@^2.6.12, node-fetch@^2.6.7:
1440014405
dependencies:
1440114406
whatwg-url "^5.0.0"
1440214407

14403-
node-forge@1.3.2, node-forge@^1:
14408+
node-forge@^1:
1440414409
version "1.3.2"
1440514410
resolved "https://registry.yarnpkg.com/node-forge/-/node-forge-1.3.2.tgz#d0d2659a26eef778bf84d73e7f55c08144ee7750"
1440614411
integrity sha512-6xKiQ+cph9KImrRh0VsjH2d8/GXA4FIMlgU4B757iI1ApvcyA9VlouP0yZJha01V+huImO+kKMU7ih+2+E14fw==

0 commit comments

Comments
 (0)