-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: generic payment cancelled page
- Loading branch information
1 parent
88ec9ad
commit 9954f37
Showing
10 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"text": "The payment was not made and registration for the event has been cancelled.", | ||
"title": "The payment has been cancelled" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"text": "Maksua ei suoritettu ja ilmoittautuminen tapahtumaan on peruttu.", | ||
"title": "Maksu on peruutettu" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"text": "Betalningen gjordes inte och anmälan till evenemanget är inställd.", | ||
"title": "Betalningen har avbrutits" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
import Head from 'next/head'; | ||
import { useTranslation } from 'next-i18next'; | ||
import { FC } from 'react'; | ||
|
||
import ErrorTemplate from '../../common/components/errorTemplate/ErrorTemplate'; | ||
import MainContent from '../app/layout/mainContent/MainContent'; | ||
|
||
const PaymentCancelledPage: FC = () => { | ||
const { t } = useTranslation('paymentCancelled'); | ||
|
||
return ( | ||
<MainContent> | ||
<Head> | ||
<title>{t('paymentCancelled:title')}</title> | ||
</Head> | ||
<ErrorTemplate | ||
text={t('paymentCancelled:text')} | ||
title={t('paymentCancelled:title')} | ||
/> | ||
</MainContent> | ||
); | ||
}; | ||
|
||
export default PaymentCancelledPage; |
21 changes: 21 additions & 0 deletions
21
src/domain/payment/__tests__/PaymentCancelledPage.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/* eslint-disable max-len */ | ||
import React from 'react'; | ||
|
||
import { render, screen } from '../../../utils/testUtils'; | ||
import PaymentCancelledPage from '../PaymentCancelledPage'; | ||
|
||
const renderComponent = () => render(<PaymentCancelledPage />); | ||
|
||
test('should render payment cancelled page', () => { | ||
renderComponent(); | ||
|
||
expect( | ||
screen.getByRole('heading', { name: 'Maksu on peruutettu' }) | ||
).toBeInTheDocument(); | ||
|
||
expect( | ||
screen.getByText( | ||
'Maksua ei suoritettu ja ilmoittautuminen tapahtumaan on peruttu.' | ||
) | ||
).toBeInTheDocument(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { GetServerSideProps } from 'next'; | ||
import React from 'react'; | ||
|
||
import PaymentCancelledPage from '../../../domain/payment/PaymentCancelledPage'; | ||
import getServerSideTranslations from '../../../utils/getServerSideTranslations'; | ||
|
||
export const getServerSideProps: GetServerSideProps = async ({ locale }) => ({ | ||
props: { | ||
...(await getServerSideTranslations({ | ||
locale: locale as string, | ||
translationNamespaces: ['common', 'paymentCancelled'], | ||
})), | ||
}, | ||
}); | ||
const PaymentCancelled = (): React.ReactElement => { | ||
return <PaymentCancelledPage />; | ||
}; | ||
|
||
export default PaymentCancelled; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters