feat: add add page selected state for add button in sidebar header
This commit is contained in:
parent
755aeafa23
commit
d31d20364e
@ -9,6 +9,7 @@ import { useEvent } from '@/hooks/useEvent';
|
||||
import { LayoutV2 } from '@/pages/LayoutV2';
|
||||
import { useCurrentWorkspaceId } from '@/store/user';
|
||||
import { routeAuthBeforeLoad } from '@/utils/route';
|
||||
import { cn } from '@/utils/style';
|
||||
import { useTranslation } from '@i18next-toolkit/react';
|
||||
import {
|
||||
createFileRoute,
|
||||
@ -78,6 +79,7 @@ function MonitorComponent() {
|
||||
title={t('Monitor')}
|
||||
actions={
|
||||
<Button
|
||||
className={cn(pathname === '/monitor/add' && '!bg-muted')}
|
||||
variant="outline"
|
||||
Icon={LuPlus}
|
||||
onClick={handleClickAdd}
|
||||
|
@ -8,6 +8,7 @@ import { useEvent } from '@/hooks/useEvent';
|
||||
import { LayoutV2 } from '@/pages/LayoutV2';
|
||||
import { useCurrentWorkspaceId } from '@/store/user';
|
||||
import { routeAuthBeforeLoad } from '@/utils/route';
|
||||
import { cn } from '@/utils/style';
|
||||
import { useTranslation } from '@i18next-toolkit/react';
|
||||
import {
|
||||
createFileRoute,
|
||||
@ -68,6 +69,7 @@ function PageComponent() {
|
||||
title={t('Pages')}
|
||||
actions={
|
||||
<Button
|
||||
className={cn(pathname === '/page/add' && '!bg-muted')}
|
||||
variant="outline"
|
||||
Icon={LuPlus}
|
||||
onClick={handleClickAdd}
|
||||
|
@ -8,6 +8,7 @@ import { useEvent } from '@/hooks/useEvent';
|
||||
import { LayoutV2 } from '@/pages/LayoutV2';
|
||||
import { useCurrentWorkspaceId } from '@/store/user';
|
||||
import { routeAuthBeforeLoad } from '@/utils/route';
|
||||
import { cn } from '@/utils/style';
|
||||
import { Trans, useTranslation } from '@i18next-toolkit/react';
|
||||
import {
|
||||
createFileRoute,
|
||||
@ -101,6 +102,7 @@ function TelemetryComponent() {
|
||||
}
|
||||
actions={
|
||||
<Button
|
||||
className={cn(pathname === '/telemetry/add' && '!bg-muted')}
|
||||
variant="outline"
|
||||
Icon={LuPlus}
|
||||
onClick={handleClickAdd}
|
||||
|
@ -81,6 +81,7 @@ function WebsiteComponent() {
|
||||
{t('Overview')}
|
||||
</Button>
|
||||
<Button
|
||||
className={cn(pathname === '/website/add' && '!bg-muted')}
|
||||
variant="outline"
|
||||
size="icon"
|
||||
Icon={LuPlus}
|
||||
|
Loading…
Reference in New Issue
Block a user