@@ -6,6 +6,7 @@ import { Query } from 'react-apollo';
66import gql from 'graphql-tag' ;
77import UpvoteMutation from './UpvoteMutation' ;
88import BookmarkMutation from './BookmarkMutation' ;
9+ import Percentage from './Percentage' ;
910
1011type TutorialListingProps = {
1112 tutorial : Tutorial ;
@@ -27,6 +28,7 @@ const TutorialListing: React.FunctionComponent<TutorialListingProps> = ({
2728 tutorial,
2829} ) => {
2930 const gatsbyID = tutorial . frontmatter . id ;
31+ let tutorialPath = getTutorialOverviewSlug ( tutorial . fileAbsolutePath ) ;
3032 return (
3133 < Query
3234 query = { gql `
@@ -35,11 +37,13 @@ const TutorialListing: React.FunctionComponent<TutorialListingProps> = ({
3537 id
3638 name
3739 upvotes
40+ numberofChapters
3841 numberOfStudents
3942 viewerUserTutorial {
4043 id
4144 upvoted
4245 bookmarked
46+ currentChapter
4347 }
4448 }
4549 }
@@ -52,15 +56,16 @@ const TutorialListing: React.FunctionComponent<TutorialListingProps> = ({
5256 < Flex alignItems = "center" justifyContent = "center" >
5357 < Box width = { 1 / 12 } >
5458 { data . getTutorialbyGatsbyID && (
55- < UpvoteMutation tutorial = { data . getTutorialbyGatsbyID } />
56- ) }
57- { data . getTutorialbyGatsbyID && (
58- < BookmarkMutation tutorial = { data . getTutorialbyGatsbyID } />
59+ < div >
60+ < UpvoteMutation tutorial = { data . getTutorialbyGatsbyID } />
61+ < BookmarkMutation tutorial = { data . getTutorialbyGatsbyID } />
62+ < Percentage tutorial = { data . getTutorialbyGatsbyID } />
63+ </ div >
5964 ) }
6065 </ Box >
6166
6267 < Box width = { 11 / 12 } >
63- < Link to = { getTutorialOverviewSlug ( tutorial . fileAbsolutePath ) } >
68+ < Link to = { tutorialPath } >
6469 < Heading > { tutorial . frontmatter . tutorialTitle } </ Heading >
6570 </ Link >
6671 < Text > { tutorial . frontmatter . description } </ Text >
0 commit comments