hcs-t4sg / questable

questable.vercel.app
2 stars 0 forks source link

Forum: Create + View Discussion #49

Closed IsoPhoenix closed 1 year ago

IsoPhoenix commented 1 year ago

Forum: Create + View Discussion

Overview

Functionality to create discussion threads and leave comments

Resources

IsoPhoenix commented 1 year ago

Additional Notes from 2/26 meeting:

General flow of using react-router for the forum page:

  1. To TeacherView.tsx and StudentView.tsx, add a new /forum route with a /:postID child route.
  2. /forum route should display a component ForumView.tsx that displays all created posts and has option to create a new post. Should contain components:
    • CreatePostModal: Inputs for creating a new post
    • ForumPostCard: Card that lists a specific forum post. Clicking on it should utilize a Link to navigate to /forum/:postID corresponding to the post.
  3. /forum/:postID should correspond to a component ForumPost.tsx that displays the information in the post. Use useParams() to get the post ID from the URL.
  4. Overall structure looks like:
    // TeacherView.tsx
    <Routes>
       ...
       <Route path='forum' element={<ForumView />}>
           <Route path=':postID/*' element={<ForumPost />} // the * includes any subroutes of the post
       </Route>
    </Routes>

Additional notes:

// ForumView.tsx ... // Layout and navigation elements go here

} /> } /> } />

... // Displays children components (ForumHome or ForumPost) inside the layout elements

// ForumHome.tsx // Contains the master list of posts and create post functionality (with CreatePostModal and ForumPostCard components as described above)

// ForumPost.tsx // Same as above