-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Feat(371) - Disabled tracks after second page #394
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat(371) - Disabled tracks after second page #394
Conversation
|
|
||
| let totalPages = Array.from({ length: track.problems.length }, (_, i) => i + 1); | ||
|
|
||
| localStorage.setItem('problemIndex', (problemIndex+1).toString()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why here?
Also why localStorage?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Figured we could use problemIndex in other places so why not have it on hand in the parent component i.e BlogAppbar.
| const { resolvedTheme } = useTheme(); | ||
| const session = useSession(); | ||
| const isAuthenticated = session.status === 'authenticated' && session.data !== null; | ||
| const storedProblemIndex = localStorage.getItem('problemIndex'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NotionRenderer isn't the only renderer we have
There is the coding renderer as well for example
This'll not work if the third page is a coding problem
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I missed that scenario. Mb. I can try implementing similar functionality in LessionView.tsx and pass a variable (trackVisible) to the components(Blog, CodeRenderer, MCQRenderer). That would be a better way of doing this for now and if and when new components are added
|
Oh, great. LessonView implementation was exactly what I was going to go for.... I'll close my PR |
PR Fixes:
Resolves #[371]
Checklist before requesting a review