diff --git a/components/users/newsletter.js b/components/users/newsletter.js index 30da765d..779e1d16 100644 --- a/components/users/newsletter.js +++ b/components/users/newsletter.js @@ -29,6 +29,7 @@ function fetchCountries(lang) { const NewsletterForm = ({ language }) => { const intl = useIntl(); const formRef = useRef(null); + const [loadTime, _setLoadTime] = useState(Date.now()); const [countryOptions, setCountryOptions] = useState([]); const [ipAddress, setIPAddress] = useState(''); useEffect(() => { @@ -65,6 +66,7 @@ const NewsletterForm = ({ language }) => { }, []); const handleSubmit = () => { + formRef.current['ts-submit'].value = Date.now(); formRef.current.submit(); return Promise.resolve(); } @@ -75,6 +77,7 @@ const NewsletterForm = ({ language }) => { email: '', organization: '', country: '', + address: '' } return ( @@ -88,6 +91,8 @@ const NewsletterForm = ({ language }) => { + +
{ > {Input} + + {Input} + { {intl.formatMessage({ id: 'newsletter.showing_results', defaultMessage: 'Showing {count} previous newsletters' }, { count: newsletters.length })} - {/* + {intl.formatMessage({ id: 'newsletter.subscribe_to', defaultMessage: 'Subscribe to our newsletter' })} - */} +
@@ -67,10 +67,10 @@ const Newsletter = ({ url, newsletters, language }) => { ))}
- {/*
+
{intl.formatMessage({ id: 'newsletter.want_to_receive', defaultMessage: 'Want to receive the latest updates from the Open Timber Portal?' })}  {intl.formatMessage({ id: 'newsletter.subscribe_to', defaultMessage: 'Subscribe to our newsletter' })}. -
*/} +
diff --git a/pages/newsletter/sign-up.js b/pages/newsletter/sign-up.js index 51d55834..9ecb6580 100644 --- a/pages/newsletter/sign-up.js +++ b/pages/newsletter/sign-up.js @@ -32,9 +32,6 @@ const NewsletterSignUp = ({ url }) => { NewsletterSignUp.propTypes = { url: PropTypes.shape({}).isRequired, }; -NewsletterSignUp.getInitialProps = ({ url }) => { - return { redirectTo: '/newsletter', redirectPermanent: false }; - // return { url }; -}; +NewsletterSignUp.getInitialProps = ({ url }) => ({ url }); export default NewsletterSignUp;