mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Bold text for selected items in SideNav and WebsiteNav.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3467184b8f
commit
5f404f62d8
2 changed files with 14 additions and 2 deletions
|
|
@ -98,6 +98,7 @@ export function SideNav(props: any) {
|
||||||
) : (
|
) : (
|
||||||
<Column gap="2">
|
<Column gap="2">
|
||||||
{links.map(({ id, path, label, icon }) => {
|
{links.map(({ id, path, label, icon }) => {
|
||||||
|
const isSelected = pathname.startsWith(renderUrl(path, false));
|
||||||
return (
|
return (
|
||||||
<Link key={id} href={renderUrl(path, false)} role="button">
|
<Link key={id} href={renderUrl(path, false)} role="button">
|
||||||
<TooltipTrigger isDisabled={!isCollapsed} delay={0}>
|
<TooltipTrigger isDisabled={!isCollapsed} delay={0}>
|
||||||
|
|
@ -105,10 +106,16 @@ export function SideNav(props: any) {
|
||||||
<Row
|
<Row
|
||||||
alignItems="center"
|
alignItems="center"
|
||||||
hover={{ backgroundColor: 'surface-sunken' }}
|
hover={{ backgroundColor: 'surface-sunken' }}
|
||||||
|
backgroundColor={isSelected ? 'surface-sunken' : undefined}
|
||||||
borderRadius
|
borderRadius
|
||||||
minHeight="40px"
|
minHeight="40px"
|
||||||
>
|
>
|
||||||
<IconLabel icon={icon} label={isCollapsed ? '' : label} padding />
|
<IconLabel
|
||||||
|
icon={icon}
|
||||||
|
label={isCollapsed ? '' : label}
|
||||||
|
weight={isSelected ? 'bold' : undefined}
|
||||||
|
padding
|
||||||
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
</Focusable>
|
</Focusable>
|
||||||
<Tooltip placement="right">{label}</Tooltip>
|
<Tooltip placement="right">{label}</Tooltip>
|
||||||
|
|
|
||||||
|
|
@ -93,7 +93,12 @@ export function WebsiteNav({
|
||||||
borderRadius
|
borderRadius
|
||||||
minHeight="40px"
|
minHeight="40px"
|
||||||
>
|
>
|
||||||
<IconLabel icon={icon} label={isCollapsed ? '' : label} padding />
|
<IconLabel
|
||||||
|
icon={icon}
|
||||||
|
label={isCollapsed ? '' : label}
|
||||||
|
weight={isSelected ? 'bold' : undefined}
|
||||||
|
padding
|
||||||
|
/>
|
||||||
</Row>
|
</Row>
|
||||||
</Focusable>
|
</Focusable>
|
||||||
<Tooltip placement="right">{label}</Tooltip>
|
<Tooltip placement="right">{label}</Tooltip>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue