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