add test_mode
This commit is contained in:
@@ -5,6 +5,7 @@ import {
|
||||
BadgeCheckIcon,
|
||||
CheckIcon,
|
||||
ChevronsUpDownIcon,
|
||||
FlaskConicalIcon,
|
||||
PlusIcon
|
||||
} from 'lucide-react'
|
||||
import { createContext, use } from 'react'
|
||||
@@ -54,7 +55,8 @@ export function WorkspaceProvider({
|
||||
export function WorkspaceSwitcher() {
|
||||
const location = useLocation()
|
||||
const { isMobile, state } = useSidebar()
|
||||
const { activeWorkspace, workspaces, subscription } = useWorksapce()
|
||||
const { activeWorkspace, workspaces, subscription, test_mode } =
|
||||
useWorksapce()
|
||||
const [, fragment, _] = location.pathname.slice(1).split('/')
|
||||
|
||||
const onSelect = (workspace: Workspace) => {
|
||||
@@ -74,10 +76,14 @@ export function WorkspaceSwitcher() {
|
||||
className="aria-expanded:border flex aspect-square size-8 items-center justify-center rounded-lg relative"
|
||||
aria-expanded={state === 'expanded'}
|
||||
>
|
||||
{subscription ? (
|
||||
{subscription && !test_mode ? (
|
||||
<BadgeCheckIcon className="fill-blue-500 stroke-white absolute size-4 dark:size-3.5 -top-1.5 -right-1.5" />
|
||||
) : null}
|
||||
|
||||
{test_mode ? (
|
||||
<FlaskConicalIcon className="absolute size-3.5 -top-1.5 -right-1.5" />
|
||||
) : null}
|
||||
|
||||
{initials(activeWorkspace.name)}
|
||||
</div>
|
||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||
|
||||
@@ -22,6 +22,7 @@ export type WorkspaceContextProps = {
|
||||
workspaces: Workspace[]
|
||||
subscription: Subscription | null
|
||||
address: Address | null
|
||||
test_mode: boolean
|
||||
}
|
||||
|
||||
export const workspaceContext = createContext<
|
||||
@@ -66,6 +67,7 @@ export const workspaceMiddleware = async (
|
||||
workspaces,
|
||||
subscription: org?.['subscription'] || null,
|
||||
address: org?.['address'] || null,
|
||||
test_mode: 'test_mode' in org,
|
||||
blocked: 'subscription_frozen' in org
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user