diff --git a/src/components/jobApplications/JobApplicationCard.jsx b/src/components/jobApplications/JobApplicationCard.jsx index 8bd0d05..ec0eb87 100644 --- a/src/components/jobApplications/JobApplicationCard.jsx +++ b/src/components/jobApplications/JobApplicationCard.jsx @@ -28,6 +28,16 @@ import EditApplicationModal from './JobApplicationModal'; import DeleteApplicationModal from './JobApplicationWarning'; import { FORMAT_STATUS } from '../../constants/jobApplications'; +function formatDate(date) { + const [year, month, day] = date.split('-'); + + return new Date(year, month - 1, day).toLocaleDateString('en-GB', { + day: '2-digit', + month: 'long', + year: 'numeric', + }); +} + const JobApplicationCard = ({ jobApplication, onUpdated, @@ -45,15 +55,6 @@ const JobApplicationCard = ({ const { request: editJobApplicationCallback } = useApi(editApplication); - function formatDate(date) { - const [year, month, day] = date.split('-'); - - return new Date(year, month - 1, day).toLocaleDateString('en-GB', { - day: '2-digit', - month: 'long', - year: 'numeric', - }); - } const deadlineDate = formatDate(jobApplication.applicationDeadline); function getCompany() { @@ -128,15 +129,13 @@ const JobApplicationCard = ({ if (isLoading) { return ( - <> - - - - - - + + + + + ); } @@ -158,8 +157,7 @@ const JobApplicationCard = ({ style={{ width: '10vw', overflowX: 'auto', overflowY: 'auto' }}> {!jobApplication.dateApplied ? ( - Due - {' ' + deadlineDate} + Due {' ' + deadlineDate} ) : ( diff --git a/src/components/jobApplications/JobApplicationWarning.jsx b/src/components/jobApplications/JobApplicationWarning.jsx index 761da3e..b16410b 100644 --- a/src/components/jobApplications/JobApplicationWarning.jsx +++ b/src/components/jobApplications/JobApplicationWarning.jsx @@ -33,46 +33,44 @@ function JobApplicationWarning({ onShow, onHide, data, onSaved }) { }; return ( - <> - - + + - - - Are you sure? -

- Do you really want to delete this job application? -
- This process cannot be undone. -

- {error && {error}} -
+ + + Are you sure? +

+ Do you really want to delete this job application? +
+ This process cannot be undone. +

+ {error && {error}} +
- - - - -
- + + + + +
); } diff --git a/src/components/jobApplications/Searchbar.jsx b/src/components/jobApplications/Searchbar.jsx index 68d5ef1..3c6976c 100644 --- a/src/components/jobApplications/Searchbar.jsx +++ b/src/components/jobApplications/Searchbar.jsx @@ -15,18 +15,16 @@ const Searchbar = ({ handleSearch }) => { }; return ( - <> - - - - - onSearchInput(e.target.value)} - /> - - + + + + + onSearchInput(e.target.value)} + /> + ); }; diff --git a/src/components/rateMyCoop/CompaniesDisplay.jsx b/src/components/rateMyCoop/CompaniesDisplay.jsx index 47c2b46..1df03c7 100644 --- a/src/components/rateMyCoop/CompaniesDisplay.jsx +++ b/src/components/rateMyCoop/CompaniesDisplay.jsx @@ -47,19 +47,17 @@ const CompaniesDisplay = ({ topFilteredCompanies.length != 0 && otherFilteredCompanies.length !== companies.length && otherFilteredCompanies.length == 0 && ( - <> - - {topFilteredCompanies.map((company) => ( - - - - - - ))} - - + + {topFilteredCompanies.map((company) => ( + + + + + + ))} + )} {/* Case 3: Yes other filters, no top filters */} diff --git a/src/components/rateMyCoop/CompanyReviewModalComponents/ViewReviews.jsx b/src/components/rateMyCoop/CompanyReviewModalComponents/ViewReviews.jsx index b5a9f8b..d5cdcf8 100644 --- a/src/components/rateMyCoop/CompanyReviewModalComponents/ViewReviews.jsx +++ b/src/components/rateMyCoop/CompanyReviewModalComponents/ViewReviews.jsx @@ -34,56 +34,52 @@ function ViewReviews({ company, showModal }) { <>

Reviews

{reviews ? ( - <> -
- - Reviews per page: +
+ + Reviews per page: - { - setReviewsPerPage(Number(e.target.value)); - getReviewsCallback(company.companyId, 0, e.target.value); - }} - disabled={getReviewsLoading} - className="w-auto"> - {[1, 5, 10, 50].map((num) => ( - - ))} - - - - -
- + disabled={getReviewsLoading} + className="w-auto"> + {[1, 5, 10, 50].map((num) => ( + + ))} + +
+ + +
) : ( - <> -
- -
- +
+ +
)}
{reviews && !getReviewsLoading ? ( diff --git a/src/components/rateMyCoop/CompanyReviewModalComponents/WriteOrEditReview.jsx b/src/components/rateMyCoop/CompanyReviewModalComponents/WriteOrEditReview.jsx index cea8f8f..e5f4835 100644 --- a/src/components/rateMyCoop/CompanyReviewModalComponents/WriteOrEditReview.jsx +++ b/src/components/rateMyCoop/CompanyReviewModalComponents/WriteOrEditReview.jsx @@ -18,6 +18,14 @@ import styles from '../../styling/rateMyCoop/CompanyReviewModal.module.css'; import useApi from '../../../hooks/useApi'; import { getErrorMessage } from '../../../utils/errorUtils'; +function capitalizeFirstLetter(string) { + if (string.length === 0) { + return ''; // Empty string + } + const toLowerCaseString = string.toLowerCase(); + return toLowerCaseString.charAt(0).toUpperCase() + toLowerCaseString.slice(1); +} + function WriteOrEditReviews({ company, showModal, @@ -38,14 +46,6 @@ function WriteOrEditReviews({ comment: '', }); - function capitalizeFirstLetter(string) { - if (string.length === 0) { - return ''; // Empty string - } - const toLowerCaseString = string.toLowerCase(); - return toLowerCaseString.charAt(0).toUpperCase() + toLowerCaseString.slice(1); - } - const onJobTitleChange = (e) => { setFormData({ ...formData, jobTitle: e.target.value }); }; @@ -101,9 +101,9 @@ function WriteOrEditReviews({ const validateTermYear = (term) => { return ( term.trim() != '' && - parseInt(term) && - parseInt(term) >= termYearBounds.lowerBound && - parseInt(term) <= termYearBounds.upperBound + Number.parseInt(term) && + Number.parseInt(term) >= termYearBounds.lowerBound && + Number.parseInt(term) <= termYearBounds.upperBound ); }; diff --git a/src/pages/ForgotPasswordPage.jsx b/src/pages/ForgotPasswordPage.jsx index 9e88075..1965a1f 100644 --- a/src/pages/ForgotPasswordPage.jsx +++ b/src/pages/ForgotPasswordPage.jsx @@ -52,6 +52,7 @@ const ForgotPasswordPage = () => { className="p-4 border rounded d-flex flex-column align-items-center" style={{ maxWidth: '19rem' }}> Co-App diff --git a/src/pages/LoginPage.jsx b/src/pages/LoginPage.jsx index 6e5345b..64cfa05 100644 --- a/src/pages/LoginPage.jsx +++ b/src/pages/LoginPage.jsx @@ -69,6 +69,7 @@ const LoginPage = () => { className="p-4 border rounded d-flex flex-column align-items-center" style={{ maxWidth: '19rem' }}> Co-App diff --git a/src/pages/ResetPasswordPage.jsx b/src/pages/ResetPasswordPage.jsx index 2a4ee6b..7b27b1a 100644 --- a/src/pages/ResetPasswordPage.jsx +++ b/src/pages/ResetPasswordPage.jsx @@ -76,6 +76,7 @@ const ResetPasswordPage = () => { className="p-4 border rounded d-flex flex-column align-items-center" style={{ maxWidth: '19rem' }}> Co-App diff --git a/src/pages/SignupPage.jsx b/src/pages/SignupPage.jsx index 80c8fcb..0c6f678 100644 --- a/src/pages/SignupPage.jsx +++ b/src/pages/SignupPage.jsx @@ -1,7 +1,7 @@ // Component developed in part using Gemini: https://gemini.google.com/share/6cf46cb9feaa import { useState } from 'react'; -import { Button, Form, InputGroup, Row, Spinner } from 'react-bootstrap'; +import { Button, Form, Row, Spinner } from 'react-bootstrap'; import { Link, useNavigate } from 'react-router-dom'; import LogoImage from '../assets/coapp_logo.png'; import Col from 'react-bootstrap/Col'; @@ -112,6 +112,7 @@ const SignupPage = () => { className="p-4 border rounded d-flex flex-column align-items-center" style={{ maxWidth: '30rem' }}> Co-App