refact common layout (#490)
This commit is contained in:
parent
da04ff040b
commit
39ea967b30
8 changed files with 150 additions and 153 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue