11import React , { FC , ReactNode , useMemo } from 'react'
2- import { Ads , Banner , Seo , Toc } from '../components'
2+ import { Ads , Banner , Footer , Header , Sidebar , Toc } from '../components'
33import { CContainer , CNav , CNavItem , CNavLink } from '@coreui/react'
44// @ts -expect-error json file
55import jsonData from './../data/other_frameworks.json'
@@ -11,6 +11,7 @@ interface DocsLayoutProps {
1111 data : DocsData
1212 location : Location
1313 pageContext : PageContext
14+ path : string
1415}
1516
1617interface DocsData {
@@ -144,7 +145,7 @@ const DocsNav: FC<{
144145 )
145146}
146147
147- const DocsLayout : FC < DocsLayoutProps > = ( { children, data, location, pageContext } ) => {
148+ const DocsLayout : FC < DocsLayoutProps > = ( { children, data, location, pageContext, path } ) => {
148149 const frontmatter = pageContext . frontmatter || { }
149150
150151 const {
@@ -164,58 +165,69 @@ const DocsLayout: FC<DocsLayoutProps> = ({ children, data, location, pageContext
164165
165166 return (
166167 < >
167- < Seo title = { title } description = { description } name = { name } />
168- < CContainer lg className = "my-md-4 flex-grow-1" >
169- < main className = "docs-main order-1" >
170- { hasNav && (
171- < DocsNav locationPathname = { location . pathname } nodes = { data ?. allMdx ?. edges as Item [ ] } />
172- ) }
173- < div className = "docs-intro ps-lg-4" >
174- { name && name !== title ? (
175- < div className = "d-flex flex-column" >
176- < h1 className = "order-2 h5 mb-4 text-body-secondary" id = "content" >
177- { title }
178- </ h1 >
179- < h2 className = "docs-title order-1 h1" > { name } </ h2 >
168+ < Sidebar />
169+ < div className = "wrapper flex-grow-1" >
170+ < Header />
171+ { path === '/404/' ? (
172+ < CContainer lg > { children } </ CContainer >
173+ ) : (
174+ < CContainer lg className = "my-md-4 flex-grow-1" >
175+ < main className = "docs-main order-1" >
176+ { hasNav && (
177+ < DocsNav
178+ locationPathname = { location . pathname }
179+ nodes = { data ?. allMdx ?. edges as Item [ ] }
180+ />
181+ ) }
182+ < div className = "docs-intro ps-lg-4" >
183+ { name && name !== title ? (
184+ < div className = "d-flex flex-column" >
185+ < h1 className = "order-2 h5 mb-4 text-body-secondary" id = "content" >
186+ { title }
187+ </ h1 >
188+ < h2 className = "docs-title order-1 h1" > { name } </ h2 >
189+ </ div >
190+ ) : (
191+ < h1 className = "docs-title" id = "content" >
192+ { title }
193+ </ h1 >
194+ ) }
195+ < Banner pro = { proComponent } />
196+ < p className = "docs-lead" > { description } </ p >
197+ < Ads code = "CEAICKJY" location = { route } placement = "coreuiio" />
198+ { frameworks . length > 0 && (
199+ < >
200+ < h2 > Other Frameworks</ h2 >
201+ < p >
202+ CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and
203+ Vue components. To learn more please visit the following pages.
204+ </ p >
205+ < ul >
206+ { frameworks . map ( ( item ) => (
207+ < React . Fragment key = { item } >
208+ { Object . entries ( otherFrameworks [ item ] || { } )
209+ . filter ( ( [ key ] ) => key !== 'react' )
210+ . map ( ( [ framework , url ] ) => (
211+ < li key = { framework } >
212+ < a href = { url } >
213+ { framework . charAt ( 0 ) . toUpperCase ( ) + framework . slice ( 1 ) } { ' ' }
214+ { humanize ( item ) }
215+ </ a >
216+ </ li >
217+ ) ) }
218+ </ React . Fragment >
219+ ) ) }
220+ </ ul >
221+ </ >
222+ ) }
180223 </ div >
181- ) : (
182- < h1 className = "docs-title" id = "content" >
183- { title }
184- </ h1 >
185- ) }
186- < Banner pro = { proComponent } />
187- < p className = "docs-lead" > { description } </ p >
188- < Ads code = "CEAICKJY" location = { route } placement = "coreuiio" />
189- { frameworks . length > 0 && (
190- < >
191- < h2 > Other Frameworks</ h2 >
192- < p >
193- CoreUI components are available as native Angular, Bootstrap (Vanilla JS), and Vue
194- components. To learn more please visit the following pages.
195- </ p >
196- < ul >
197- { frameworks . map ( ( item ) => (
198- < React . Fragment key = { item } >
199- { Object . entries ( otherFrameworks [ item ] || { } )
200- . filter ( ( [ key ] ) => key !== 'react' )
201- . map ( ( [ framework , url ] ) => (
202- < li key = { framework } >
203- < a href = { url } >
204- { framework . charAt ( 0 ) . toUpperCase ( ) + framework . slice ( 1 ) } { ' ' }
205- { humanize ( item ) }
206- </ a >
207- </ li >
208- ) ) }
209- </ React . Fragment >
210- ) ) }
211- </ ul >
212- </ >
213- ) }
214- </ div >
215- { data ?. mdx && < Toc items = { data . mdx . tableOfContents . items } /> }
216- < div className = "docs-content ps-lg-4" > { children } </ div >
217- </ main >
218- </ CContainer >
224+ { data ?. mdx && < Toc items = { data . mdx . tableOfContents . items } /> }
225+ < div className = "docs-content ps-lg-4" > { children } </ div >
226+ </ main >
227+ </ CContainer >
228+ ) }
229+ < Footer />
230+ </ div >
219231 </ >
220232 )
221233}
0 commit comments