diff --git a/src/components/recruitment/Timeline.tsx b/src/components/recruitment/Timeline.tsx index 86fc62a..d63d2e7 100644 --- a/src/components/recruitment/Timeline.tsx +++ b/src/components/recruitment/Timeline.tsx @@ -1,7 +1,4 @@ import React, { useState, useEffect } from 'react' -import { IconContext } from 'react-icons' -import { TbTriangleInvertedFilled } from 'react-icons/tb' -import { FaExternalLinkAlt } from 'react-icons/fa' function Timeline() { const [largeScreen, setLargeScreen] = useState(false) @@ -21,12 +18,27 @@ function Timeline() { } }, []) - const today = new Date() - const start_day = new Date(2025, 0, 5) - const end_day = new Date(2025, 0, 22) + let recruitment_open = true - console.log(start_day) - if (today > end_day || today < start_day) { + if (recruitment_open) { + return ( +

+ Applications for the team are now officially open! Apply using the + following{' '} + + Google Forms Link. + {' '} + Questions? Send us an email at{' '} + + ubcagrobot@gmail.com + + . +

+ ) + } else { return (

Applications for the team are now closed, stay tuned for updates in @@ -40,196 +52,6 @@ function Timeline() {

) } - - const monthNames = [ - 'JAN', - 'FEB', - 'MAR', - 'APR', - 'MAY', - 'JUN', - 'JUL', - 'AUG', - 'SEP', - 'OCT', - 'NOV', - 'DEC', - ] - const monthNamesLong = [ - 'January', - 'February', - 'March', - 'April', - 'May', - 'June', - 'July', - 'August', - 'September', - 'October', - 'November', - 'December', - ] - - /** - * Using the day, returns a string with the 'ordinal indicators' appended - * @param day - The day you want to format - * @returns - The day with the indicators. 1 -> '1st', 2 -> '2nd' - */ - function AddIndicator(day: number) { - if (day === 11) { - return '11th' - } - if (day === 12) { - return '12th' - } - if (day === 13) { - return '13th' - } - - const last_digit = day % 10 - - switch (last_digit) { - case 1: - return `${day}st` - case 2: - return `${day}nd` - case 3: - return `${day}rd` - default: - return `${day}th` - } - } - - /** - * Takes two dates and returns a px offset for the timeline. - * @param {Date} start_day - Beginning of recruitment - * @param {Date} end_day - End of recruitment - * @returns {number} - Clamped to be between 0-100% of the timeline. - */ - function GetDateOffset(start_day: Date, end_day: Date): number { - // Calculate total duration in days - const totalDuration = (end_day - start_day) / (1000 * 60 * 60 * 24) - - // Calculate elapsed time in days - const elapsedTime = (today - start_day) / (1000 * 60 * 60 * 24) - - // Calculate the percentage progress - let progressPercentage = elapsedTime / totalDuration - if (totalDuration === 0) { - progressPercentage = 1 - } - - // Clamp the progress percentage to the range [0, 1] - const clampedProgress = Math.max(0, Math.min(1, progressPercentage)) - - // Offset of left date + (clampedProgress * width between dates) - return 32 + clampedProgress * 936 - } - - function DateToTriOffset(DateOffset: number): number { - return DateOffset + 124 / 2 - 44 / 2 - } - - const day_pixel_offset: number = GetDateOffset(start_day, end_day) - const triOffset = DateToTriOffset(day_pixel_offset) - const days_to_apply = Math.ceil((end_day - today) / (1000 * 3600 * 24)) - - return ( - <> -

- Applications are open until {monthNamesLong[end_day.getMonth()]}{' '} - {AddIndicator(end_day.getDate())}! -

- {largeScreen ? ( - <> -
-
- {/* start date */} -

- Applications -
- Open -

-
-
- {monthNames[start_day.getMonth()]} - {start_day.getDate()} -
-
- {/* end date */} -

- Applications -
- Close -

-
-
- {monthNames[end_day.getMonth()]} - {end_day.getDate()} -
-
- {/* Current date */} - -
- -
-
- {/*}down arrow */} -
-
- {monthNames[today.getMonth()]} - {today.getDate()} -
-
-
- - ) : ( -
-

- {days_to_apply} -

-

- more days to apply -

-
- )} -

- Before you dive in, check out our recruitment package. It contains - essential information about our teams, projects, and what we're looking - for in new members. Once you're ready, fill out the application form and - take the first step towards an inspiring and impactful experience with - UBC Agrobot! -

-
- - Recruitment Package - - - - Application Form - - -
- - ) } export { Timeline }