Skip to content
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

Class Preferences #49

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open

Class Preferences #49

wants to merge 17 commits into from

Conversation

khaidoan2729
Copy link
Contributor

I resolved the conflicts caused after Theo's backend update (goated btw) and added GET endpoints. Now we can see the class preferences cards.

Screen Shot 2025-01-30 at 13 53 25

@khaidoan2729 khaidoan2729 requested review from jessHuh and jjessieshang and removed request for jessHuh January 30, 2025 21:56
@jjessieshang
Copy link
Collaborator

Hey Khai, im running into a 400 error for the following endpoint: GET /volunteer/class_preferences/d98889b0-2f2e-4172-b753-14cdccdd359c 400 121

Copy link
Collaborator

@jjessieshang jjessieshang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

great progress :)

function ClassPreferencesCard({ classData }) {

const RANK1_COLOR = "rgba(67, 133, 172, 1)";
const RANK2_COLOR = "rgba(67, 133, 172, 0.7)";
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can move these to the global styles file



<NavLink
to="/volunteer/class-preferences"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm assuming this is a temporary link to the page, however before we merge into main, let's put the temporary navigation somewhere on the volunteer profile page to match the design more closely and keep the navigation panel clean!
Screenshot 2025-02-01 at 2 45 44 PM

@khaidoan2729
Copy link
Contributor Author

  • Added Class Preference Card on My Profile Page to navigate to Class Preferences Page.
  • Implemented GET function to retrieve preferences based on current volunteer ID and Class Preferences Card for displaying.
  • Implemented PUT function to update new preferences.

New Components that might be useful in the future

Modal

image

Props:

  • isOpen : to open (display) or close (hide) the modal.
  • onClose : to trigger the close modal function.
  • children
  • width : modal width
  • height : modal height

Example:

const [modalOpen, setModalOpen] = useState(false);
const handleConfirm = () => {
  console.log("Confirming...");
}

return (
  <Modal isOpen={modalOpen} onClose={handleConfirm} width={"600px"} height={"90%"}>
    [children]
  </Modal>
);

Checkbox

image

Props:

  • onClicked : to trigger function when checkbox is clicked
  • active : to determine whether the checkbox has been clicked. In the picture above, the upper checkbox is when active is false.

Example:

<Checkbox onClicked={()=>{handleCheckboxClicked(class_)}} active={true)}/>

@khaidoan2729 khaidoan2729 changed the title Merged to main. Finished get functions in backend and display on frontend. Class Preferences Feb 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants