-
Notifications
You must be signed in to change notification settings - Fork 0
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
Cindyrzheng/frontend #25
Conversation
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.
Hey Cindy, thank you for starting on the frontend. This looks good. I raised a little nitpick about React
's TS API in the attached thread that might be worth considering.
Only major comment is that I think the student and professor assignment views aren't doing themselves any favors by being separated in the codebase.
They are so similar that I think we should just refactor them into a single ClassView
component that we adjust the appearance of based on application state. For now, we can just make the appearance change based on some props
passed to the component, but in the future, we should handle the application state with a context provider or something similar. Maybe cookies. Let me know what you think!
import { Link } from "react-router-dom"; | ||
|
||
//A card representing a single assignment overview | ||
const StudentAssignmentCard = (props:{name:string}) => { |
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.
Not so much a review comment, but what are your thoughts on use of React.FC
?
const StudentAssignmentCard = (props:{name:string}) => { | |
const StudentAssignmentCard: React.FC<{name: string}> = ({name}) => { |
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.
never used it before, is it preferrable to use?
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.
didn't end up using it but i am open to changing it later!
@@ -0,0 +1,34 @@ | |||
import React, { useState } from "react"; |
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.
Rather than create a separate assignment card for professors and students, how about we just create a single component that renders based on a property mode = student | faculty
?
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.
Ya I can do that
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.
Im not super happy with the const stuff I did but I think I'll fix things up once we get something like local storage set up for a logged in user!
frontend/src/App.tsx
Outdated
<Route path="/professor/class/addassignment"> | ||
<Route index element={<AddAssignmentView />} /> | ||
</Route> |
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.
This is okay for now, but I think in the future we will need to refactor our AddAssignmentView
to something akin to a modal to avoid cluttering our app routes.
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.
ok! lmk when we get to that and then we can work on adding a modal
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.
LGTM
Adding some views for student and professor that is an overview of a class.