add icon to mode test
This commit is contained in:
@@ -5,7 +5,6 @@ import {
|
|||||||
BadgeCheckIcon,
|
BadgeCheckIcon,
|
||||||
CheckIcon,
|
CheckIcon,
|
||||||
ChevronsUpDownIcon,
|
ChevronsUpDownIcon,
|
||||||
FlaskConicalIcon,
|
|
||||||
PlusIcon
|
PlusIcon
|
||||||
} from 'lucide-react'
|
} from 'lucide-react'
|
||||||
import { createContext, use } from 'react'
|
import { createContext, use } from 'react'
|
||||||
@@ -55,8 +54,7 @@ export function WorkspaceProvider({
|
|||||||
export function WorkspaceSwitcher() {
|
export function WorkspaceSwitcher() {
|
||||||
const location = useLocation()
|
const location = useLocation()
|
||||||
const { isMobile, state } = useSidebar()
|
const { isMobile, state } = useSidebar()
|
||||||
const { activeWorkspace, workspaces, subscription, test_mode } =
|
const { activeWorkspace, workspaces, subscription } = useWorksapce()
|
||||||
useWorksapce()
|
|
||||||
const [, fragment, _] = location.pathname.slice(1).split('/')
|
const [, fragment, _] = location.pathname.slice(1).split('/')
|
||||||
|
|
||||||
const onSelect = (workspace: Workspace) => {
|
const onSelect = (workspace: Workspace) => {
|
||||||
@@ -76,14 +74,10 @@ export function WorkspaceSwitcher() {
|
|||||||
className="aria-expanded:border flex aspect-square size-8 items-center justify-center rounded-lg relative"
|
className="aria-expanded:border flex aspect-square size-8 items-center justify-center rounded-lg relative"
|
||||||
aria-expanded={state === 'expanded'}
|
aria-expanded={state === 'expanded'}
|
||||||
>
|
>
|
||||||
{subscription && !test_mode ? (
|
{subscription ? (
|
||||||
<BadgeCheckIcon className="fill-blue-500 stroke-white absolute size-4 dark:size-3.5 -top-1.5 -right-1.5" />
|
<BadgeCheckIcon className="fill-blue-500 stroke-white absolute size-4 dark:size-3.5 -top-1.5 -right-1.5" />
|
||||||
) : null}
|
) : null}
|
||||||
|
|
||||||
{test_mode ? (
|
|
||||||
<FlaskConicalIcon className="absolute size-3.5 -top-1.5 -right-1.5" />
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
{initials(activeWorkspace.name)}
|
{initials(activeWorkspace.name)}
|
||||||
</div>
|
</div>
|
||||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import type { Route } from './+types/route'
|
import type { Route } from './+types/route'
|
||||||
|
|
||||||
import * as cookie from 'cookie'
|
import * as cookie from 'cookie'
|
||||||
|
import { FlaskConicalIcon } from 'lucide-react'
|
||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import { Outlet, type ShouldRevalidateFunctionArgs } from 'react-router'
|
import { Outlet, type ShouldRevalidateFunctionArgs } from 'react-router'
|
||||||
|
|
||||||
@@ -23,7 +24,10 @@ import { Toaster } from '@repo/ui/components/ui/sonner'
|
|||||||
import { cn } from '@repo/ui/lib/utils'
|
import { cn } from '@repo/ui/lib/utils'
|
||||||
|
|
||||||
import { AppSidebar } from '@/components/app-sidebar'
|
import { AppSidebar } from '@/components/app-sidebar'
|
||||||
import { WorkspaceProvider } from '@/components/workspace-switcher'
|
import {
|
||||||
|
useWorksapce,
|
||||||
|
WorkspaceProvider
|
||||||
|
} from '@/components/workspace-switcher'
|
||||||
import { workspaceContext, workspaceMiddleware } from '@/middleware/workspace'
|
import { workspaceContext, workspaceMiddleware } from '@/middleware/workspace'
|
||||||
|
|
||||||
// import { Notification } from '@/components/notification'
|
// import { Notification } from '@/components/notification'
|
||||||
@@ -97,6 +101,7 @@ export default function Route({ loaderData }: Route.ComponentProps) {
|
|||||||
<ThemedImage className="max-md:hidden" />
|
<ThemedImage className="max-md:hidden" />
|
||||||
|
|
||||||
<div className="ml-auto flex gap-2.5 items-center">
|
<div className="ml-auto flex gap-2.5 items-center">
|
||||||
|
<TestMode />
|
||||||
{/*<Notification />*/}
|
{/*<Notification />*/}
|
||||||
<ModeToggle />
|
<ModeToggle />
|
||||||
<NavUser user={user} excludeApps={['admin']} />
|
<NavUser user={user} excludeApps={['admin']} />
|
||||||
@@ -121,3 +126,13 @@ export default function Route({ loaderData }: Route.ComponentProps) {
|
|||||||
</WorkspaceProvider>
|
</WorkspaceProvider>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function TestMode() {
|
||||||
|
const { test_mode } = useWorksapce()
|
||||||
|
|
||||||
|
if (!test_mode) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return <FlaskConicalIcon className="size-3.5 text-muted-foreground" />
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user