From fa2b9b79ac6cc121dee3c102794003a69e46c63b Mon Sep 17 00:00:00 2001 From: Ajitesh Kumar Date: Thu, 16 Oct 2025 21:33:34 -0400 Subject: [PATCH] open github repo for apply instead of signing out user --- pages/[application]/[leader]/index.js | 33 +++++----- pages/[application]/[leader]/review.js | 77 ++++++++++++----------- pages/[application]/[leader]/status.js | 84 ++++++++++++++------------ 3 files changed, 100 insertions(+), 94 deletions(-) diff --git a/pages/[application]/[leader]/index.js b/pages/[application]/[leader]/index.js index 21af4a1..ad5839c 100644 --- a/pages/[application]/[leader]/index.js +++ b/pages/[application]/[leader]/index.js @@ -34,13 +34,14 @@ export default function ApplicationHome({ async function sendInvite() { if (validateEmail(emailToInvite)) { const loginAPICall = await fetch( - `/api/invite?email=${encodeURIComponent(emailToInvite)}&id=${params.application + `/api/invite?email=${encodeURIComponent(emailToInvite)}&id=${ + params.application }&locale=${router.locale}` ).then(r => r.json()) if (loginAPICall.success) { setInviteMessage([ applicationsRecord.fields['Prospective Leaders'][ - applicationsRecord.fields['Prospective Leaders'].length + 1 + applicationsRecord.fields['Prospective Leaders'].length + 1 ], `✅ ${returnLocalizedMessage(router.locale, 'INVITED')}` ]) @@ -51,7 +52,7 @@ export default function ApplicationHome({ console.error(loginAPICall) setInviteMessage([ applicationsRecord.fields['Prospective Leaders'][ - applicationsRecord.fields['Prospective Leaders'].length + 1 + applicationsRecord.fields['Prospective Leaders'].length + 1 ], `✅ ${returnLocalizedMessage(router.locale, 'INVITED')}` ]) @@ -203,7 +204,7 @@ export default function ApplicationHome({ onClick={() => deleteLeader( applicationsRecord.fields['Prospective Leaders'][ - leaderIndex + leaderIndex ] ) } @@ -230,18 +231,19 @@ export default function ApplicationHome({ ], transform: 'translateY(-0.2px)', mr: '5px', - mb: `${warning && + mb: `${ + warning && applicationsRecord.fields['Prospective Leaders'][ - leaderIndex + leaderIndex ] === inviteMessage[0] - ? '-8px' - : '0px' - }` + ? '-8px' + : '0px' + }` }} onClick={() => ( setInviteMessage([ applicationsRecord.fields['Prospective Leaders'][ - leaderIndex + leaderIndex ], returnLocalizedMessage(router.locale, 'ARE_YOU_SURE') ]), @@ -251,9 +253,9 @@ export default function ApplicationHome({ deleteLeader( applicationsRecord.fields['Prospective Leaders'][ - leaderIndex + leaderIndex ] ) } @@ -556,10 +558,7 @@ const OpenSourceCard = ({ router }) => { borderRadius: '15px' }} onClick={async () => { - await destroyCookie(null, 'authToken', { - path: '/' - }) - router.push('/', '/', { scroll: false }) + window.open('https://github.com/hackclub/apply', '_blank') }} > r.json()) if (loginAPICall.success) { setInviteMessage([ applicationsRecord.fields['Prospective Leaders'][ - applicationsRecord.fields['Prospective Leaders'].length + 1 + applicationsRecord.fields['Prospective Leaders'].length + 1 ], `✅ ${returnLocalizedMessage(router.locale, 'INVITED')}` ]) @@ -56,7 +57,7 @@ export default function ApplicationReview({ console.error(loginAPICall) setInviteMessage([ applicationsRecord.fields['Prospective Leaders'][ - applicationsRecord.fields['Prospective Leaders'].length + 1 + applicationsRecord.fields['Prospective Leaders'].length + 1 ], `✅ ${returnLocalizedMessage(router.locale, 'INVITED')}` ]) @@ -204,7 +205,7 @@ export default function ApplicationReview({ onClick={() => deleteLeader( applicationsRecord.fields['Prospective Leaders'][ - leaderIndex + leaderIndex ] ) } @@ -231,18 +232,19 @@ export default function ApplicationReview({ ], transform: 'translateY(-0.2px)', mr: '5px', - mb: `${warning && + mb: `${ + warning && applicationsRecord.fields['Prospective Leaders'][ - leaderIndex + leaderIndex ] === inviteMessage[0] - ? '-8px' - : '0px' - }` + ? '-8px' + : '0px' + }` }} onClick={() => ( setInviteMessage([ applicationsRecord.fields['Prospective Leaders'][ - leaderIndex + leaderIndex ], returnLocalizedMessage(router.locale, 'ARE_YOU_SURE') ]), @@ -252,9 +254,9 @@ export default function ApplicationReview({ deleteLeader( applicationsRecord.fields['Prospective Leaders'][ - leaderIndex + leaderIndex ] ) } @@ -313,10 +315,11 @@ export default function ApplicationReview({ height: '40px', minWidth: '150px', fontWeight: 'bold', - cursor: `${applicationsRecord.fields['Submitted'] - ? 'not-allowed' - : 'pointer' - }` + cursor: `${ + applicationsRecord.fields['Submitted'] + ? 'not-allowed' + : 'pointer' + }` }} onClick={() => sendInvite()} > @@ -480,23 +483,23 @@ export default function ApplicationReview({ width: '100%', textTransform: 'uppercase', ...(applicationsRecord.fields['All Complete (incl Leaders)'] != 1 || - acceptCOC === false || - applicationsRecord.fields['Submitted'] + acceptCOC === false || + applicationsRecord.fields['Submitted'] ? { - opacity: 0.3, - ':hover,:focus': { - transform: 'none', - boxShadow: 'none', - cursor: 'not-allowed' + opacity: 0.3, + ':hover,:focus': { + transform: 'none', + boxShadow: 'none', + cursor: 'not-allowed' + } } - } : {}) }} variant="ctaLg" onClick={() => applicationsRecord.fields['All Complete (incl Leaders)'] != 1 || - acceptCOC === false || - applicationsRecord.fields['Submitted'] + acceptCOC === false || + applicationsRecord.fields['Submitted'] ? console.log(applicationsRecord) : submitApplication(applicationsRecord.fields) } @@ -504,15 +507,12 @@ export default function ApplicationReview({ {submitButton} - { - acceptCOC === false ? - "You must agree to the Hacker Code of Conduct to Submit Your Application" : - applicationsRecord.fields['All Complete (incl Leaders)'] !== 1 ? - "Your Hack Club application is not complete. Please ensure you have completed your personal profile, your club profile, and that all of your co-leaders have submitted their application if they were added to the club application." : - "" - } + {acceptCOC === false + ? 'You must agree to the Hacker Code of Conduct to Submit Your Application' + : applicationsRecord.fields['All Complete (incl Leaders)'] !== 1 + ? 'Your Hack Club application is not complete. Please ensure you have completed your personal profile, your club profile, and that all of your co-leaders have submitted their application if they were added to the club application.' + : ''} - ( color: 'blue', display: 'flex', alignItems: 'center', - '> svg': { display: 'inline' } + '> svg': { display: 'inline' } }} > @@ -620,10 +620,7 @@ const OpenSourceCard = ({ router }) => { borderRadius: '15px' }} onClick={async () => { - await destroyCookie(null, 'authToken', { - path: '/' - }) - router.push('/', '/', { scroll: false }) + window.open('https://github.com/hackclub/apply', '_blank') }} > {applicationStatus != 'rejected' && - applicationStatus !== 'inactive' && - applicationStatus != null ? ( + applicationStatus !== 'inactive' && + applicationStatus != null ? ( ) : null} @@ -150,15 +150,16 @@ export default function ApplicationOnboarding({ }} as="b" > - {returnLocalizedMessage(router.locale, 'THREE_KEY_RESOURCES')} + {returnLocalizedMessage( + router.locale, + 'THREE_KEY_RESOURCES' + )}
  1. {returnLocalizedMessage(router.locale, 'YSWS')}
  2. {returnLocalizedMessage(router.locale, 'PIZZA')}
  3. -
  4. - {returnLocalizedMessage(router.locale, 'HCB')} -
  5. +
  6. {returnLocalizedMessage(router.locale, 'HCB')}
@@ -245,8 +246,20 @@ export default function ApplicationOnboarding({ {' '} {returnLocalizedMessage(router.locale, 'BOREAL_DETAILS_1')} - {returnLocalizedMessage(router.locale, 'BOREAL_DETAILS_2')} - {returnLocalizedMessage(router.locale, 'BOREAL_DETAILS_3')} + + {' '} + {returnLocalizedMessage( + router.locale, + 'BOREAL_DETAILS_2' + )}{' '} + + + {' '} + {returnLocalizedMessage( + router.locale, + 'BOREAL_DETAILS_3' + )}{' '} +