Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Submissions #718

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 37 additions & 34 deletions frontend/components/Applications.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,41 +103,44 @@ function ApplicationsPage({ whartonapplications }): ReactElement {
<AppsContainer>
<div className="columns is-multiline is-desktop is-tablet">
{whartonapplications != null && whartonapplications.length > 0 ? (
whartonapplications.map((application) => (
<CardWrapper className={'column is-half-desktop'}>
<Link href={application.external_url} target="_blank">
<Card className="card">
<MainInfo>
<div>
<ClubName>{application.name}</ClubName>
<DateInterval
start={application.application_start_time}
end={application.application_end_time}
/>
</div>
<div>
{application.club_image_url != null &&
application.club_image_url !== '' && (
<LazyLoad>
<Image src={application.club_image_url} />
</LazyLoad>
)}
</div>
</MainInfo>
{application.description &&
application.description.length && (
<DescriptionWrapper
dangerouslySetInnerHTML={{
__html: application.description,
}}
></DescriptionWrapper>
)}
</Card>
</Link>
</CardWrapper>
))
<div>
<Text>Only Wharton applications displayed here!</Text>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe rephrase as "Note: only current Wharton applications are displayed on this page"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made changes

{whartonapplications.map((application) => (
<CardWrapper className={'column is-half-desktop'}>
<Link href={application.external_url} target="_blank">
<Card className="card">
<MainInfo>
<div>
<ClubName>{application.name}</ClubName>
<DateInterval
start={application.application_start_time}
end={application.application_end_time}
/>
</div>
<div>
{application.club_image_url != null &&
application.club_image_url !== '' && (
<LazyLoad>
<Image src={application.club_image_url} />
</LazyLoad>
)}
</div>
</MainInfo>
{application.description &&
application.description.length && (
<DescriptionWrapper
dangerouslySetInnerHTML={{
__html: application.description,
}}
></DescriptionWrapper>
)}
</Card>
</Link>
</CardWrapper>
))}
</div>
) : (
<Text>No applications are currently available.</Text>
<Text>No Wharton applications are currently available.</Text>
)}
</div>
</AppsContainer>
Expand Down
14 changes: 10 additions & 4 deletions frontend/pages/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ type SettingsProps = {
userInfo?: UserInfo
authenticated: boolean | null
submissions: ApplicationSubmission[]
whartonapplications: any
whartonApplications: any
}

const Settings = ({
userInfo,
authenticated,
whartonapplications,
whartonApplications,
submissions,
}: SettingsProps) => {
/**
Expand Down Expand Up @@ -87,7 +87,7 @@ const Settings = ({
{
name: 'applications',
label: 'Applications',
content: <ApplicationsPage whartonapplications={whartonapplications} />,
content: <ApplicationsPage whartonapplications={whartonApplications} />,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could be appropriate to also rename the prop in ApplicationsPage to be camelcase for simplicity

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Made changes

},
{
name: 'Requests',
Expand Down Expand Up @@ -134,8 +134,14 @@ Settings.getInitialProps = async (ctx: NextPageContext) => {
['whartonapplications', 'submissions'],
ctx,
)) as BulkResp

const returner = {
whartonApplications: data.whartonapplications,
submissions: data.submissions,
}

return {
...data,
...returner,
fair: ctx.query.fair != null ? parseInt(ctx.query.fair as string) : null,
}
}
Expand Down
Loading