@@ -8,9 +8,10 @@ import {
88 Heading ,
99 HeadingProps ,
1010 ListItem ,
11+ Show ,
1112 Text ,
1213 UnorderedList ,
13- useTheme ,
14+ useToken ,
1415} from "@chakra-ui/react"
1516import { graphql , PageProps } from "gatsby"
1617import { GatsbyImage } from "gatsby-plugin-image"
@@ -28,6 +29,11 @@ import PageHero from "../../components/PageHero"
2829import PageMetadata from "../../components/PageMetadata"
2930import Translation from "../../components/Translation"
3031import UpgradeTableOfContents from "../../components/UpgradeTableOfContents"
32+ import {
33+ ContentContainer ,
34+ InfoColumn ,
35+ InfoTitle ,
36+ } from "../../templates/use-cases"
3137
3238// Utils
3339import { Lang } from "../../utils/languages"
@@ -114,10 +120,10 @@ const H3 = ({ children, ...props }: HeadingProps) => {
114120}
115121
116122const LearnPage = ( { data } : PageProps < Queries . LearnPageQuery , Context > ) => {
117- const theme = useTheme ( )
118123 const { t } = useTranslation ( )
119124 const { language } = useI18next ( )
120125 const isRightToLeft = isLangRightToLeft ( language as Lang )
126+ const lgBp = useToken ( "breakpoints" , "lg" )
121127
122128 const tocItems = [
123129 {
@@ -188,36 +194,16 @@ const LearnPage = ({ data }: PageProps<Queries.LearnPageQuery, Context>) => {
188194 pt = { { lg : 16 } }
189195 dir = { isRightToLeft ? "rtl" : "ltr" }
190196 >
191- < Box
192- as = "aside"
193- display = { { base : "none" , lg : "flex" } }
194- flexDirection = "column"
195- position = "sticky"
196- top = "6.25rem" // account for navbar
197- h = "calc(100vh - 80px)"
198- flex = "0 1 330px"
199- mx = { 8 }
200- >
201- < Heading
202- lineHeight = { 1.4 }
203- fontSize = { { base : "2.5rem" , lg : "5xl" } }
204- fontWeight = "bold"
205- textAlign = { { base : "left" , lg : "right" } }
206- mt = { 0 }
207- display = { { base : "none" , lg : "block" } }
208- >
209- < Translation id = "toc-learn-hub" />
210- </ Heading >
211- < UpgradeTableOfContents items = { tocItems } />
212- </ Box >
213-
214- < Box
215- as = "article"
216- flex = { `1 1 ${ theme . breakpoints . l } ` }
217- pb = { 8 }
218- px = { 8 }
219- id = "content"
220- >
197+ < Show above = { lgBp } >
198+ < InfoColumn >
199+ < InfoTitle >
200+ < Translation id = "toc-learn-hub" />
201+ </ InfoTitle >
202+ < UpgradeTableOfContents items = { tocItems } />
203+ </ InfoColumn >
204+ </ Show >
205+
206+ < ContentContainer id = "content" >
221207 < Section >
222208 < H2 mt = { { lg : 0 } } id = { tocItems [ 0 ] . id } >
223209 { tocItems [ 0 ] . title }
@@ -864,7 +850,7 @@ const LearnPage = ({ data }: PageProps<Queries.LearnPageQuery, Context>) => {
864850 </ Section >
865851
866852 < FeedbackCard />
867- </ Box >
853+ </ ContentContainer >
868854 </ Flex >
869855 </ Box >
870856 )
0 commit comments