File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
packages/gatsby-theme/src/components/templates Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { TutorialMdxQuery } from '../../graphqlTypes';
88import { HideOnTablet , ShowOnTablet } from '../../utils/responsive' ;
99import { Flex , Box } from '../shared/base' ;
1010import { optionalChaining } from '../../utils/helpers' ;
11+ import { Button } from '../shared/base' ;
1112
1213type TutorialLayoutProps = { data : TutorialMdxQuery } & RouterProps ;
1314
@@ -28,6 +29,8 @@ const TutorialLayout: React.FunctionComponent<TutorialLayoutProps> = ({
2829 ) || [ ] ;
2930 const { location } = props ;
3031
32+ const currentChapterNumber = chapters . indexOf ( pageTitle ) + 1 ;
33+
3134 return (
3235 < Layout location = { location } >
3336 < ShowOnTablet >
@@ -54,6 +57,10 @@ const TutorialLayout: React.FunctionComponent<TutorialLayoutProps> = ({
5457 < ShowOnTablet >
5558 < MDXRenderer > { data ! . mdx ! . code ! . body } </ MDXRenderer >
5659 </ ShowOnTablet >
60+ < Button onClick = { ( ) => console . log ( currentChapterNumber ) } >
61+ { ' ' }
62+ Next Chapter
63+ </ Button >
5764 </ Layout >
5865 ) ;
5966} ;
You can’t perform that action at this time.
0 commit comments