Skip to content

Commit ba89adf

Browse files
committed
fix(sidebar): refine return link style
1 parent 89cf0f0 commit ba89adf

File tree

2 files changed

+32
-7
lines changed

2 files changed

+32
-7
lines changed

bricks/ai-portal/src/elevo-sidebar/SpaceNav.tsx

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,17 @@ import { NavLink } from "./NavLink.js";
88
import type { SidebarLink } from "./interfaces.js";
99
import { ADD_ICON, MODEL_ICON } from "./constants.js";
1010
import { useNavLinkActive } from "./useNavLinkActive.js";
11+
import type { GeneralIconProps } from "@next-bricks/icons/general-icon";
1112

1213
export interface SpaceNavProps {
1314
returnUrl: string;
1415
introUrl: string;
1516
spaceDetail: {
1617
instanceId: string;
1718
name: string;
19+
icon?: GeneralIconProps & {
20+
color?: string;
21+
};
1822
};
1923
spaceObjects?: SidebarLink[];
2024
spaceServiceflows?: SidebarLink[];
@@ -39,14 +43,26 @@ export function SpaceNav({
3943
const [serviceflowsCollapsed, setServiceflowsCollapsed] = useState(false);
4044
const introActive = useNavLinkActive(introUrl);
4145

46+
const avatarIcon = spaceDetail?.icon;
47+
const avatarColor = avatarIcon?.color || "gray";
48+
const { color, ...iconProps } = avatarIcon || {};
49+
4250
return (
4351
<>
4452
<WrappedLink url={returnUrl} className="return-link">
53+
<WrappedIcon className="icon" lib="lucide" icon="chevron-left" />
54+
<div
55+
className="avatar"
56+
style={{
57+
color: `var(--theme-${avatarColor}-color)`,
58+
}}
59+
>
60+
<WrappedIcon {...iconProps} />
61+
</div>
4562
<div className="heading">
4663
<div className="title">{spaceDetail?.name}</div>
4764
<div className="sub-title">{t(K.COLLABORATION_SPACES)}</div>
4865
</div>
49-
<WrappedIcon className="icon" lib="lucide" icon="arrow-left" />
5066
</WrappedLink>
5167
<div className="divider" />
5268
<div className="history" ref={rootRef}>

bricks/ai-portal/src/elevo-sidebar/styles.shadow.css

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -395,31 +395,40 @@
395395

396396
.title {
397397
font-weight: 500;
398-
font-size: 18px;
398+
font-size: 14px;
399399
}
400400

401401
.sub-title {
402402
font-size: 12px;
403-
color: #8c8c8c;
403+
color: rgba(0, 0, 0, 0.45);
404404
}
405405

406406
.icon {
407407
font-size: 16px;
408-
color: #8c8c8c;
408+
color: #646a73;
409409
}
410410

411-
&:not(:hover) .icon {
412-
display: none;
411+
.avatar {
412+
background: #fff;
413+
border-radius: 8px;
414+
border: 1px solid rgba(0, 0, 0, 0.1);
415+
width: 36px;
416+
height: 36px;
417+
display: flex;
418+
align-items: center;
419+
justify-content: center;
420+
font-size: 18px;
413421
}
414422
}
415423

416424
.return-link::part(link) {
417425
display: flex;
418426
align-items: center;
419427
justify-content: center;
428+
gap: 10px;
420429
padding: 6px 8px;
421430
border-radius: 8px;
422-
color: #000;
431+
color: #262626;
423432
}
424433

425434
.return-link::part(link):hover {

0 commit comments

Comments
 (0)