- Added `isCustomerBanned` function to determine if a customer is banned based on the `bannedUntil` field. - Updated the `BaseService` to throw an error if a banned customer attempts to access certain functionalities. - Enhanced the GraphQL operations to include the `bannedUntil` field in customer queries and mutations, improving data integrity and user experience. - Integrated the `CheckBanned` component in the layout to manage banned customer states effectively.
25 lines
696 B
TypeScript
25 lines
696 B
TypeScript
'use client';
|
|
|
|
import { CheckBanned, UpdateProfile } from '@/components/auth';
|
|
import { BottomNav } from '@/components/navigation';
|
|
import { EmptyProvider } from '@/providers/empty';
|
|
import { TelegramProvider } from '@/providers/telegram';
|
|
import { isTMA } from '@telegram-apps/sdk-react';
|
|
import { type PropsWithChildren } from 'react';
|
|
|
|
export default function Layout({ children }: Readonly<PropsWithChildren>) {
|
|
const isTG = isTMA('simple');
|
|
|
|
const Provider = isTG ? TelegramProvider : EmptyProvider;
|
|
|
|
return (
|
|
<CheckBanned>
|
|
<Provider>
|
|
<UpdateProfile />
|
|
<main className="grow">{children}</main>
|
|
<BottomNav />
|
|
</Provider>
|
|
</CheckBanned>
|
|
);
|
|
}
|