add freeze subscription
This commit is contained in:
@@ -8,12 +8,19 @@ import { userContext } from '@repo/auth/context'
|
||||
import { authMiddleware } from '@repo/auth/middleware/auth'
|
||||
import { ModeToggle, ThemedImage } from '@repo/ui/components/dark-mode'
|
||||
import { NavUser } from '@repo/ui/components/nav-user'
|
||||
import {
|
||||
AlertDialog,
|
||||
AlertDialogContent,
|
||||
AlertDialogDescription,
|
||||
AlertDialogTitle
|
||||
} from '@repo/ui/components/ui/alert-dialog'
|
||||
import {
|
||||
SidebarInset,
|
||||
SidebarProvider,
|
||||
SidebarTrigger
|
||||
} from '@repo/ui/components/ui/sidebar'
|
||||
import { Toaster } from '@repo/ui/components/ui/sonner'
|
||||
import { cn } from '@repo/ui/lib/utils'
|
||||
|
||||
import { AppSidebar } from '@/components/app-sidebar'
|
||||
import { WorkspaceProvider } from '@/components/workspace-switcher'
|
||||
@@ -48,14 +55,7 @@ export function shouldRevalidate({
|
||||
}
|
||||
|
||||
export default function Route({ loaderData }: Route.ComponentProps) {
|
||||
const {
|
||||
user,
|
||||
activeWorkspace,
|
||||
workspaces,
|
||||
subscription,
|
||||
address,
|
||||
sidebar_state
|
||||
} = loaderData
|
||||
const { user, sidebar_state, blocked, ...props } = loaderData
|
||||
|
||||
useEffect(() => {
|
||||
if (typeof window !== 'undefined' && window.rybbit) {
|
||||
@@ -68,13 +68,23 @@ export default function Route({ loaderData }: Route.ComponentProps) {
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<WorkspaceProvider
|
||||
activeWorkspace={activeWorkspace}
|
||||
workspaces={workspaces}
|
||||
subscription={subscription}
|
||||
address={address}
|
||||
>
|
||||
<SidebarProvider defaultOpen={sidebar_state === 'true'} className="flex">
|
||||
<WorkspaceProvider {...props}>
|
||||
{blocked ? (
|
||||
<AlertDialog open={true}>
|
||||
<AlertDialogContent>
|
||||
<AlertDialogTitle>Serviço com acesso suspenso</AlertDialogTitle>
|
||||
<AlertDialogDescription>
|
||||
Seu acesso está temporariamente bloqueado devido a um pagamento em
|
||||
atraso. Regularize para continuar usando a plataforma.
|
||||
</AlertDialogDescription>
|
||||
</AlertDialogContent>
|
||||
</AlertDialog>
|
||||
) : null}
|
||||
|
||||
<SidebarProvider
|
||||
defaultOpen={sidebar_state === 'true'}
|
||||
className={cn('flex', blocked && 'pointer-events-none')}
|
||||
>
|
||||
<AppSidebar />
|
||||
|
||||
<SidebarInset className="relative flex flex-col flex-1 min-w-0">
|
||||
|
||||
Reference in New Issue
Block a user