From c281f4bb0d0744c7606d89a36d807bf0481c2347 Mon Sep 17 00:00:00 2001
From: Anca Ursachi <anca.ursachi@thinslices.com>
Date: Wed, 10 Oct 2018 15:36:51 +0300
Subject: [PATCH] fix(country-list): display country dropdown on signUp

---
 .../component-faraday-ui/src/helpers/withCountries.js |  4 ----
 .../src/components/SignUp/SignUpStep0.js              | 11 ++++++++++-
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/packages/component-faraday-ui/src/helpers/withCountries.js b/packages/component-faraday-ui/src/helpers/withCountries.js
index ca15d812e..bd642eddd 100644
--- a/packages/component-faraday-ui/src/helpers/withCountries.js
+++ b/packages/component-faraday-ui/src/helpers/withCountries.js
@@ -9,8 +9,6 @@ const countryMapper = c => {
       return 'SRB'
     case 'ME':
       return 'MNT'
-    case 'CG':
-      return 'CD'
     default:
       return c
   }
@@ -24,8 +22,6 @@ const codeMapper = c => {
       return 'RS'
     case 'MNT':
       return 'ME'
-    case 'CD':
-      return 'CG'
     default:
       return c
   }
diff --git a/packages/components-faraday/src/components/SignUp/SignUpStep0.js b/packages/components-faraday/src/components/SignUp/SignUpStep0.js
index 5ade35ecb..0c7e9ec11 100644
--- a/packages/components-faraday/src/components/SignUp/SignUpStep0.js
+++ b/packages/components-faraday/src/components/SignUp/SignUpStep0.js
@@ -12,6 +12,7 @@ import {
   Label,
   ActionLink,
   ItemOverrideAlert,
+  withCountries,
 } from 'pubsweet-component-faraday-ui'
 
 const AgreeCheckbox = ({ value, onChange }) => (
@@ -73,7 +74,13 @@ const Step0 = ({
         <ItemOverrideAlert ml={1} vertical>
           <Label required>Country</Label>
           <ValidatedField
-            component={TextField}
+            component={input => (
+              <Menu
+                {...input}
+                options={countries}
+                placeholder="Please select"
+              />
+            )}
             name="country"
             validate={[requiredValidator]}
           />
@@ -128,9 +135,11 @@ const Step0 = ({
   )
 
 export default compose(
+  withCountries,
   reduxForm({
     form: 'signUpInvitation',
     destroyOnUnmount: false,
     forceUnregisterOnUnmount: true,
+    enableReinitialize: true,
   }),
 )(Step0)
-- 
GitLab