Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions flow-typed/npm/@box/blueprint-web-assets_vx.x.x.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,15 @@ declare module '@box/blueprint-web-assets/icons/Medium' {
declare export var ChevronUp: React$ComponentType<any>;
declare export var RightSidebarChevronClose: React$ComponentType<any>;
declare export var RightSidebarChevronOpen: React$ComponentType<any>;
declare export var MagicWand: React$ComponentType<any>;
declare export var DocGen: React$ComponentType<any>;
}

declare module '@box/blueprint-web-assets/icons/MediumFilled' {
declare export var Comment: React$ComponentType<any>;
declare export var InformationCircle: React$ComponentType<any>;
declare export var Metadata: React$ComponentType<any>;
declare export var MagicWand: React$ComponentType<any>;
}

declare module '@box/blueprint-web-assets/icons/Content' {
Expand Down
29 changes: 27 additions & 2 deletions src/elements/content-sidebar/SidebarNav.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,14 @@ import {
Comment as CommentIcon,
InformationCircle as InformationCircleIcon,
Metadata as MetadataIcon,
MagicWand as MagicWandIcon,
DocGen as BPDocGenIcon,
} from '@box/blueprint-web-assets/icons/Medium';
import {
Comment as CommentIconFilled,
InformationCircle as InformationCircleIconFilled,
Metadata as MetadataIconFilled,
MagicWand as MagicWandIconFilled,
} from '@box/blueprint-web-assets/icons/MediumFilled';
import { Size6, Size5, IconIconBlue } from '@box/blueprint-web-assets/tokens/tokens';
import { usePromptFocus } from '@box/box-ai-content-answers';
Expand Down Expand Up @@ -92,6 +95,28 @@ const MetadataIconWrapper = ({ isActive, isPreviewModernizationEnabled }: IconWr
);
};

const SkillsIconWrapper = ({ isActive, isPreviewModernizationEnabled }: IconWrapperProps) => {
if (!isPreviewModernizationEnabled) {
return <IconMagicWand className="bcs-SidebarNav-icon" />;
}
return isActive ? (
<MagicWandIconFilled {...SIDEBAR_TAB_ICON_PROPS} color={IconIconBlue} />
) : (
<MagicWandIcon {...SIDEBAR_TAB_ICON_PROPS} />
);
};

const DocGenIconWrapper = ({ isActive, isPreviewModernizationEnabled }: IconWrapperProps) => {
if (!isPreviewModernizationEnabled) {
return <DocGenIcon className="bcs-SidebarNav-icon" />;
}
return isActive ? (
<BPDocGenIcon {...SIDEBAR_TAB_ICON_PROPS} color={IconIconBlue} />
) : (
<BPDocGenIcon {...SIDEBAR_TAB_ICON_PROPS} />
);
};

type Props = {
additionalTabs?: Array<AdditionalSidebarTab>,
elementId: string,
Expand Down Expand Up @@ -223,7 +248,7 @@ const SidebarNav = ({
sidebarView={SIDEBAR_VIEW_SKILLS}
tooltip={intl.formatMessage(messages.sidebarSkillsTitle)}
>
<IconMagicWand className="bcs-SidebarNav-icon" />
<SkillsIconWrapper isPreviewModernizationEnabled={isPreviewModernizationEnabled} />
</SidebarNavButton>
)}
{hasMetadata && (
Expand All @@ -250,7 +275,7 @@ const SidebarNav = ({
sidebarView={SIDEBAR_VIEW_DOCGEN}
tooltip={intl.formatMessage(messages.sidebarDocGenTooltip)}
>
<DocGenIcon className="bcs-SidebarNav-icon" />
<DocGenIconWrapper isPreviewModernizationEnabled={isPreviewModernizationEnabled} />
</SidebarNavButton>
)}
</SidebarNavTablist>
Expand Down