-
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.
Merge pull request #6618 from uktrade/export-wins-thank-you-pages
Refactored thank you page to avoid using flash message
- Loading branch information
Showing
3 changed files
with
60 additions
and
40 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, WHITE } from '../../../utils/colours' | ||
import { StatusMessage } from '../../../components' | ||
|
||
import Layout from './Layout' | ||
import FlashMessages from '../../../components/LocalHeader/FlashMessages' | ||
|
||
const StyledStatusMessage = styled(StatusMessage)({ | ||
background: WHITE, | ||
'& > *: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 ? ( | ||
<StyledStatusMessage colour={GREEN}> | ||
Thank you for taking time to review this export win. | ||
</StyledStatusMessage> | ||
) : ( | ||
<StyledStatusMessage> | ||
<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> | ||
</StyledStatusMessage> | ||
) | ||
} | ||
> | ||
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