-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored thank you page to avoid using flash message
- Loading branch information
1 parent
b53af5e
commit 69b937a
Showing
3 changed files
with
59 additions
and
39 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 |
---|---|---|
@@ -1,10 +1,53 @@ | ||
import React from 'react' | ||
import { Route } from 'react-router-dom' | ||
import styled from 'styled-components' | ||
|
||
import { GREEN } from '../../../utils/colours' | ||
import { StatusMessage } from '../../../components' | ||
|
||
import Layout from './Layout' | ||
import FlashMessages from '../../../components/LocalHeader/FlashMessages' | ||
|
||
const StatusMessageNoInternalMargin = styled(StatusMessage)({ | ||
'& > *:first-child': { | ||
marginTop: 0, | ||
}, | ||
|
||
'& > *:last-child': { | ||
marginBottom: 0, | ||
}, | ||
}) | ||
|
||
export default () => ( | ||
<Layout title="Export win reviewed" headingContent={<FlashMessages />}> | ||
Your feedback will help us to improve our support services. | ||
</Layout> | ||
<Route> | ||
{({ location: { search } }) => { | ||
const agree = search.includes('agree=yes') | ||
return ( | ||
<Layout | ||
title={ | ||
agree | ||
? 'Export win reviewed' | ||
: 'Export win reviewed and changes are needed' | ||
} | ||
headingContent={ | ||
agree ? ( | ||
<StatusMessage colour={GREEN}> | ||
Thank you for taking time to review this export win | ||
</StatusMessage> | ||
) : ( | ||
<StatusMessageNoInternalMargin> | ||
<p>Thank you for reviewing this export win</p> | ||
<p> | ||
As you have asked for some changes to be made, we will review | ||
your comments and may need to contact you if we need more | ||
information. | ||
</p> | ||
</StatusMessageNoInternalMargin> | ||
) | ||
} | ||
> | ||
Your feedback will help us to improve our support services. | ||
</Layout> | ||
) | ||
}} | ||
</Route> | ||
) |
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