@@ -38,7 +38,6 @@ import {
3838 RatingProvider ,
3939 PromotionProvider ,
4040} from "../../contexts" ;
41- import { AuthProvider } from "../../contexts/auth" ;
4241import { canUseWindow } from "../../utils" ;
4342import { useRating } from "../../hooks" ;
4443import articlesVersions from "../../configs/articlesVersions.json" ;
@@ -161,92 +160,83 @@ const Page = ({ frontMatter, children }) => {
161160 slug = slug [ slug . length - 1 ] === "/" ? slug : `${ slug } /` ;
162161
163162 const ratingContext = useRating ( { slug } ) ;
164- const useRedocPage = [
165- "global-accounts-api" ,
166- "customer-accounts-api" ,
167- "text-api" ,
168- "chat-api"
169- ] . includes ( subcategory ) || [ "Chat API" ] . includes ( title ) ;
163+ const useRedocPage =
164+ [
165+ "global-accounts-api" ,
166+ "customer-accounts-api" ,
167+ "text-api" ,
168+ "chat-api" ,
169+ ] . includes ( subcategory ) || [ "Chat API" ] . includes ( title ) ;
170170
171171 return (
172- < AuthProvider >
173- < RatingProvider value = { ratingContext } >
174- < VersionProvider value = { versionContext } >
175- < PromotionProvider value = { promotionContext } >
176- < SEO
177- desc = { desc }
178- title = { title }
179- subtitle = { subtitle }
180- robots = { robots }
181- />
182- < Header />
183- < MainWrapper >
184- { ! useRedocPage && (
185- < SideNav
186- category = { category }
187- version = { currentApiVersion }
188- title = { title }
172+ < RatingProvider value = { ratingContext } >
173+ < VersionProvider value = { versionContext } >
174+ < PromotionProvider value = { promotionContext } >
175+ < SEO desc = { desc } title = { title } subtitle = { subtitle } robots = { robots } />
176+ < Header />
177+ < MainWrapper >
178+ { ! useRedocPage && (
179+ < SideNav
180+ category = { category }
181+ version = { currentApiVersion }
182+ title = { title }
183+ />
184+ ) }
185+
186+ < MiddleColumn
187+ noMargin = { useRedocPage }
188+ noPadding = { useRedocPage }
189+ fullWidth = { useRedocPage }
190+ >
191+ { currentApiVersion && (
192+ < Version
193+ leftPadding = { useRedocPage }
194+ articleVersions = {
195+ articlesVersions [ category ] [ subcategory ] [ title ]
196+ }
197+ redirectToVersion = { redirectToVersion }
198+ group = { versionGroup }
189199 />
190200 ) }
191-
192- < MiddleColumn
193- noMargin = { useRedocPage }
201+ < Content
202+ className = {
203+ useRedocPage
204+ ? `redoc ${ currentApiVersion ? "redoc-with-version" : "" } `
205+ : ""
206+ }
194207 noPadding = { useRedocPage }
195- fullWidth = { useRedocPage }
196208 >
197- { currentApiVersion && (
198- < Version
199- leftPadding = { useRedocPage }
200- articleVersions = {
201- articlesVersions [ category ] [ subcategory ] [ title ]
202- }
203- redirectToVersion = { redirectToVersion }
204- group = { versionGroup }
205- />
209+ { title && ! useRedocPage && < PageHeader title = { title } /> }
210+ { useRedocPage && (
211+ < LeftColumnRedocWrapper >
212+ < LeftColumnRedoc >
213+ < NavHeader >
214+ < Link href = { "/" } style = { { color : "inherit" } } >
215+ < span >
216+ < HomeIcon width = { 18 } style = { { display : "block" } } />
217+ </ span >
218+ </ Link >
219+ < ChevronRight width = { 14 } />
220+ < CategoryRedoc > { category } </ CategoryRedoc >
221+ </ NavHeader >
222+ </ LeftColumnRedoc >
223+ </ LeftColumnRedocWrapper >
206224 ) }
207- < Content
208- className = {
209- useRedocPage
210- ? `redoc ${ currentApiVersion ? "redoc-with-version" : "" } `
211- : ""
212- }
213- noPadding = { useRedocPage }
214- >
215- { title && ! useRedocPage && < PageHeader title = { title } /> }
216- { useRedocPage && (
217- < LeftColumnRedocWrapper >
218- < LeftColumnRedoc >
219- < NavHeader >
220- < Link href = { "/" } style = { { color : "inherit" } } >
221- < span >
222- < HomeIcon
223- width = { 18 }
224- style = { { display : "block" } }
225- />
226- </ span >
227- </ Link >
228- < ChevronRight width = { 14 } />
229- < CategoryRedoc > { category } </ CategoryRedoc >
230- </ NavHeader >
231- </ LeftColumnRedoc >
232- </ LeftColumnRedocWrapper >
233- ) }
234225
235- < MDXProvider components = { components } > { children } </ MDXProvider >
226+ < MDXProvider components = { components } > { children } </ MDXProvider >
236227
237- { ! useRedocPage && (
238- < StyledRating position = { RATING_POSITION . BOTTOM } />
239- ) }
240- </ Content >
241- </ MiddleColumn >
242-
243- { ! useRedocPage && < ContentSideNav version = { currentApiVersion } /> }
244- </ MainWrapper >
245- < Footer />
246- </ PromotionProvider >
247- </ VersionProvider >
248- </ RatingProvider >
249- </ AuthProvider >
228+ { ! useRedocPage && (
229+ < StyledRating position = { RATING_POSITION . BOTTOM } />
230+ ) }
231+ </ Content >
232+ </ MiddleColumn >
233+
234+ { ! useRedocPage && < ContentSideNav version = { currentApiVersion } /> }
235+ </ MainWrapper >
236+ < Footer />
237+ </ PromotionProvider >
238+ </ VersionProvider >
239+ </ RatingProvider >
250240 ) ;
251241} ;
252242
0 commit comments