Yesterday I finished refactoring the React code to use conditional rendering instead of so much React Router. React Router is still useful for displaying the pdf based on a URL. I was trying to use it to distinguish between the logged in and not logged in portions of the application. It was clearly not the right way to go. Luckily I fixed that early since I don’t have too many components yet.
Today I’m going to implement the PDF search component. I already have this component working fine, but fitting it into the application as it stands is a little different. Currently, searching for a PDF takes the user to the annotation screen and Socket.IO creates a room for that PDF. I will definitely have to allow the user (the teacher) to define rooms. Otherwise each of his/her students will be annotating the same document. That would be very messy.
I’ll try that today. I’ll just put a checkbox with a label that says “Create New Room”. The workflow isn’t completely defined yet but having this working will help.