@@ -2,15 +2,16 @@ import { Fragment, useEffect, useState } from 'react';
22import Router from 'next/router' ;
33import { Button , Drawer , Hidden , makeStyles } from '@material-ui/core' ;
44import { Apps } from '@material-ui/icons' ;
5- import { Post } from '@zoonk/models' ;
5+ import { ChapterProgress , Post } from '@zoonk/models' ;
66import { getChapterLive } from '@zoonk/services' ;
77import LessonsDrawer from './LessonsDrawer' ;
88import NextLesson from './NextLesson' ;
99import PreviousLesson from './PreviousLesson' ;
10+ import useChapterProgress from './useChapterProgress' ;
1011import useTranslation from './useTranslation' ;
1112
1213interface PostBarLessonsProps {
13- category : Post . Category ;
14+ category : keyof ChapterProgress . Response ;
1415 chapterId : string ;
1516 postId : string ;
1617 topicId : string ;
@@ -41,6 +42,7 @@ const PostBarLessons = ({
4142 topicId,
4243} : PostBarLessonsProps ) => {
4344 const classes = useStyles ( ) ;
45+ const { progress } = useChapterProgress ( { chapterId } ) ;
4446 const [ drawer , setDrawer ] = useState < boolean > ( false ) ;
4547 const [ lessons , setLessons ] = useState < Post . Summary [ ] > ( [ ] ) ;
4648 const translate = useTranslation ( ) ;
@@ -85,7 +87,12 @@ const PostBarLessons = ({
8587 </ div >
8688
8789 < Drawer open = { drawer } onClose = { ( ) => setDrawer ( false ) } anchor = "bottom" >
88- < LessonsDrawer lessons = { lessons } onReturn = { ( ) => setDrawer ( false ) } />
90+ < LessonsDrawer
91+ category = { category }
92+ lessons = { lessons }
93+ progress = { progress }
94+ onReturn = { ( ) => setDrawer ( false ) }
95+ />
8996 </ Drawer >
9097 </ Fragment >
9198 ) ;
0 commit comments