Skip to content

Frontend Functions

Sweekar Burji edited this page Oct 31, 2024 · 1 revision

Project Documentation

frontend/src/login/LoginPage.js

Class: LoginPage

  • Constructor: Initializes the component state.
  • handleLogin: Handles the login process by calling getToken and storing the token if successful.
  • handleSignup: Handles the signup process by calling signUp.
  • handleSignupGoogle: Redirects the user to a Google OAuth URL for signup.
  • componentDidMount: Checks for a token in the URL and stores it if present.
  • render: Renders the login and signup forms using Bootstrap tabs.

Styles

  • divStyle: Style for a div element.
  • authWrapper: Style for the authentication wrapper.
  • authInner: Style for the inner authentication container.

frontend/src/matches/MatchesPage.js

Component: Recommendations

  • useState Hooks: Manages state for recommended jobs, fetching status, fetch errors, and wishlist.
  • useEffect Hook: Fetches job recommendations on component mount.
  • fetchRecommendations: Fetches job recommendations from the server.
  • render: Renders a table of recommended jobs or a spinner if jobs are being fetched.

frontend/src/Modals/JobDescription.js

Component: JobDescription

  • Props: Accepts selectedJob and setState.
  • render: Displays a modal with job qualifications, responsibilities, and benefits.

frontend/src/profile/CustomModal.js

Component: CustomModal

  • useState Hook: Manages the state of selected data.
  • handleSave: Saves the selected data to the server and updates the profile.
  • render: Renders a modal with a multi-select dropdown for setting preferences.

frontend/src/profile/CustomProfileModal.js

Component: CustomProfileModal

  • useState Hooks: Manages state for profile data and error handling.
  • handleSave: Validates and saves profile data to the server.
  • render: Renders a modal for editing profile details.

frontend/src/profile/ProfilePage.js

Component: ProfilePage

  • useState Hooks: Manages state for various modals.
  • getUserInitials: Returns the initials of the user's full name.
  • render: Renders the profile page with user details and modals for editing profile sections.

frontend/src/resume/ManageResumePage.js

Class: ManageResumePage

  • Constructor: Initializes the component state.
  • getFiles: Fetches the list of uploaded files from the server.
  • handleChange: Handles file input changes.
  • uploadResume: Uploads a resume file to the server.
  • downloadResume: Downloads the resume file from the server.
  • componentDidMount: Fetches files when the component mounts.
  • render: Renders the file upload form and a table of uploaded documents.

frontend/src/search/SearchCard.js

Class: SearchCard

  • Constructor: Initializes the component state with application details.
  • handleChange: Updates state based on input field changes.
  • submitAction: Submits the application data and closes the modal.
  • render: Renders a modal for adding or editing a job application.

frontend/src/search/SearchPage.js

Class: SearchPage

  • Constructor: Initializes the component state.
  • search: Searches for jobs based on user input.
  • deleteTheApplication: Deletes a job application from the list.
  • showEditModal: Opens a modal for editing a job application.
  • handleCloseEditModal: Closes the edit modal.
  • addToWaitlist: Adds a job to the waitlist.
  • removeFromWaitlist: Removes a job from the waitlist.
  • handleChange: Updates state based on input field changes.
  • setSalary: Sets the salary filter.
  • handleShowJobDesc: Toggles the job description modal.
  • render: Renders the search page with a search bar, job listings, and modals.