refact common layout (#490)

This commit is contained in:
zxhlyh 2023-06-29 15:30:12 +08:00 • committed by GitHub
commit 39ea967b30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 150 additions and 153 deletions

View file

@ -1,13 +1,20 @@
import React from "react";
import type { FC } from 'react'
import LayoutClient, { ICommonLayoutProps } from "./_layout-client";
import React from 'react'
import type { ReactNode } from 'react'
import SwrInitor from '@/app/components/swr-initor'
import { AppContextProvider } from '@/context/app-context'
import GA, { GaType } from '@/app/components/base/ga'
import Header from '@/app/components/header'
const Layout: FC<ICommonLayoutProps> = ({ children }) => {
const Layout = ({ children }: { children: ReactNode }) => {
return (
<>
<GA gaType={GaType.admin} />
<LayoutClient children={children}></LayoutClient>
<SwrInitor>
<AppContextProvider>
<Header />
{children}
</AppContextProvider>
</SwrInitor>
</>
)
}
@ -16,4 +23,4 @@ export const metadata = {
title: 'Dify',
}
export default Layout
export default Layout