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

feat: create a protected route for campaign applications (Epic #1842) #1855

Merged
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
1 change: 1 addition & 0 deletions src/common/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const routes = {
campaigns: {
index: '/campaigns',
create: '/campaigns/create',
application: 'campaigns/application',
viewCampaignBySlug: (slug: string) => `/campaigns/${slug}`,
viewExpenses: (slug: string) => `/campaigns/${slug}/expenses`,
oneTimeDonation: (slug: string) => `/campaigns/donation/${slug}`,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import Layout from '../layout/Layout'

export default function CampaignApplicationPage() {
return <Layout></Layout>
Copy link
Member

Choose a reason for hiding this comment

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

This line doesn't pass the linter self-closing rule. Can you change it to <Layout/> or add some child element to it.

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 it self-closing as I have already started working on another branch where I am adding the children elements.

}
11 changes: 11 additions & 0 deletions src/pages/campaigns/application.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { GetServerSideProps } from 'next'
import { securedPropsWithTranslation } from 'middleware/auth/securedProps'
import { routes } from 'common/routes'
import CampaignApplicationPage from 'components/client/campaign-application/CampaignApplicationPage'

export const getServerSideProps: GetServerSideProps = securedPropsWithTranslation(
['common', 'auth', 'validation', 'campaigns'],
routes.campaigns.application,
)

export default CampaignApplicationPage
Loading