Skip to content

Commit

Permalink
Merge pull request #567 from nwplus/dev
Browse files Browse the repository at this point in the history
Big cmd-f 2024 Merge
  • Loading branch information
meleongg authored Feb 10, 2024
2 parents 3c606c9 + 33a01a0 commit 934fbe0
Show file tree
Hide file tree
Showing 25 changed files with 1,163 additions and 464 deletions.
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
crossorigin="anonymous"
referrerpolicy="no-referrer"
/>
<title>nwHacks 2024 Portal</title>
<title>cmd-f 2024 Portal</title>
</head>

<body>
Expand Down
76 changes: 22 additions & 54 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,36 +82,18 @@ const ApplicationInProgressRoute = ({ name, handleLogout, path, children, theme
const { isAuthed, user, logout } = useAuth()
return isAuthed ? (
<Route path={path}>
<HackerApplicationProvider>
<ApplicationInProgressContentContainer>
<Navbar
name={name ? user.displayName : undefined}
handleLogout={handleLogout ? logout : undefined}
>
{children}
</Navbar>
</ApplicationInProgressContentContainer>
</HackerApplicationProvider>
<Navbar
name={name ? user.displayName : undefined}
handleLogout={handleLogout ? logout : undefined}
>
{children}
</Navbar>
</Route>
) : (
<Redirect to="/login" />
)
}

const ApplicationInProgressContentContainer = ({ children }) => {
const {
application: {
status: { applicationStatus },
},
} = useHackerApplication()

return applicationStatus === APPLICATION_STATUS.inProgress ? (
<>{children}</>
) : (
<Redirect to="/login" />
)
}

const NoAuthRoute = ({ path, children }) => {
const { isAuthed, user } = useAuth()
return (
Expand Down Expand Up @@ -143,15 +125,7 @@ const NavbarSaveOnLogout = ({ name, handleLogout }) => {
const ApplicationFormContainer = ({ part }) => {
const { isAuthed, user, logout } = useAuth()

const {
application,
// got rid of destructuring in case of null value (not logged in, visits a page on application - maybe it was bookmarked)
// {
// status: {
// applicationStatus
// },
// },
} = useHackerApplication()
const { application } = useHackerApplication()

return isAuthed && application.status.applicationStatus === APPLICATION_STATUS.inProgress ? (
<>
Expand Down Expand Up @@ -189,13 +163,7 @@ const ProjectViewContainer = ({ params }) => (

const ApplicationDashboardRoutingContainer = () => {
const { isAuthed } = useAuth()
return isAuthed ? (
<HackerApplicationProvider>
<Application />
</HackerApplicationProvider>
) : (
<Redirect to="/login" />
)
return isAuthed ? <Application /> : <Redirect to="/login" />
}

function App() {
Expand Down Expand Up @@ -273,20 +241,20 @@ function App() {
<AuthPageRoute path="/submission">
<Submission />
</AuthPageRoute>
<Route path="/application" component={ApplicationDashboardRoutingContainer} />
<ApplicationInProgressRoute path="/application/review" name handleLogout>
<ApplicationReview />
</ApplicationInProgressRoute>
<ApplicationInProgressRoute path="/application/confirmation" handleLogout>
<ApplicationConfirmation />
</ApplicationInProgressRoute>
<Route path="/application/:part">
{params => (
<HackerApplicationProvider>
<ApplicationFormContainer part={params.part} />
</HackerApplicationProvider>
)}
</Route>
<HackerApplicationProvider>
<Switch>
<Route path="/application" component={ApplicationDashboardRoutingContainer} />
<ApplicationInProgressRoute path="/application/review" name handleLogout>
<ApplicationReview />
</ApplicationInProgressRoute>
<ApplicationInProgressRoute path="/application/confirmation" handleLogout>
<ApplicationConfirmation />
</ApplicationInProgressRoute>
<Route path="/application/:part" handleLogout>
{params => <ApplicationFormContainer part={params.part} />}
</Route>
</Switch>
</HackerApplicationProvider>
<Route path="/:rest*">
<NotFound />
</Route>
Expand Down
9 changes: 6 additions & 3 deletions src/components/ApplicationDashboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export const hackerStatuses = (relevantDates, hackerName = null) => ({
sidebarText: 'In Review',
cardText: 'Awaiting assessment',
// blurb: `We will send out all acceptances by ${relevantDates?.sendAcceptancesBy}. In the meantime, get connected with our community of hackers on Instagram, Facebook, Medium, and Twitter to stay up to date with the latest news on sponsors, prizes and workshops!`,
blurb: `We will send out all acceptances by January 2024. In the meantime, get connected with our community of hackers on Instagram, Facebook, Medium, and Twitter to stay up to date with the latest news on sponsors, prizes and workshops!`,
blurb: `We will send out all acceptances by late Feb 2024. In the meantime, get connected with our community of hackers on Instagram, Facebook, Medium, and Twitter to stay up to date with the latest news on sponsors, prizes and workshops!`,
},
waitlisted: {
sidebarText: 'Waitlisted',
Expand Down Expand Up @@ -300,7 +300,7 @@ export const hackerStatuses = (relevantDates, hackerName = null) => ({
sidebarText: 'Not Submitted',
cardText: 'Not Submitted',
// blurb: `Your application has not been submitted. Please complete your application and submit before the deadline on ${relevantDates?.applicationDeadline} in order to join us at ${copyText.hackathonName}!`,
blurb: `Your application has not been submitted. Please complete your application and submit before December in order to join us at ${copyText.hackathonName}!`,
blurb: `Your application has not been submitted. Please complete your application and submit before February 22, 2024 in order to join us at ${copyText.hackathonName}!`,
},
})

Expand Down Expand Up @@ -415,7 +415,10 @@ const Dashboard = ({
</AppLinks>
<StatusContainer>
<div>
<AppStatusText>nwHacks 2024 is Western Canada’s largest 24 hour hackathon!</AppStatusText>
<AppStatusText>
cmd-f 2024 is Western Canada's largest hackathon celebrating underrepresented genders in
tech!
</AppStatusText>
<AppStatusText>
Registration status: {hackerStatuses()[hackerStatus]?.cardText}
</AppStatusText>
Expand Down
Loading

0 comments on commit 934fbe0

Please sign in to comment.