mirror of
https://github.com/langgenius/dify.git
synced 2026-05-13 08:57:28 +08:00
Follow-up to SSR prefetch migration (2833965). Eliminates the Zustand
middleman that was syncing TanStack Query data into a separate store.
- Remove useGlobalPublicStore Zustand store entirely
- Create hooks/use-global-public.ts with useSystemFeatures,
useSystemFeaturesQuery, useIsSystemFeaturesPending, useSetupStatusQuery
- Migrate all 93 consumers to import from @/hooks/use-global-public
- Simplify global-public-context.tsx to a thin provider component
- Update 18 test files to mock the new hook interface
- Fix SetupStatusResponse.setup_at type from Date to string (JSON)
- Fix setup-status.spec.ts mock target to match consoleClient
BREAKING CHANGE: useGlobalPublicStore is removed. Use useSystemFeatures()
from @/hooks/use-global-public instead.
40 lines
1.2 KiB
TypeScript
40 lines
1.2 KiB
TypeScript
'use client'
|
|
import { useSystemFeatures } from '@/hooks/use-global-public'
|
|
|
|
import { cn } from '@/utils/classnames'
|
|
import Header from '../signin/_header'
|
|
|
|
export default function SignInLayout({ children }: any) {
|
|
const systemFeatures = useSystemFeatures()
|
|
return (
|
|
<>
|
|
<div className={cn('flex min-h-screen w-full justify-center bg-background-default-burn p-6')}>
|
|
<div className={cn('flex w-full shrink-0 flex-col rounded-2xl border border-effects-highlight bg-background-default-subtle')}>
|
|
<Header />
|
|
<div className={
|
|
cn(
|
|
'flex w-full grow flex-col items-center justify-center',
|
|
'px-6',
|
|
'md:px-[108px]',
|
|
)
|
|
}
|
|
>
|
|
<div className="flex flex-col md:w-[400px]">
|
|
{children}
|
|
</div>
|
|
</div>
|
|
{!systemFeatures.branding.enabled && (
|
|
<div className="system-xs-regular px-8 py-6 text-text-tertiary">
|
|
©
|
|
{' '}
|
|
{new Date().getFullYear()}
|
|
{' '}
|
|
LangGenius, Inc. All rights reserved.
|
|
</div>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</>
|
|
)
|
|
}
|