Browse Source

[+Jordi] - #87 Clean old code that was duplication in (AttributeSummary and PetitionSummary)

Elena Cristina Raffay Iglesias 1 year ago
parent
commit
7dc8ad528a

+ 13 - 46
apps/wallet/application/components/Attribute/Attribute.js

@@ -1,58 +1,26 @@
1
-import React, { Component } from 'react';
1
+import React from 'react';
2 2
 import { Text, View, Switch } from 'react-native';
3 3
 import PropTypes from 'prop-types';
4 4
 import styles from './styles';
5
-import Button from '../Button/Button';
6 5
 
7
-export default class Attribute extends Component {
8
-  verifiedMode() {
9
-    const disabledAttributeText = (
10
-      <Text style={styles.disabledAttributeText}>
6
+export default function Attribute(props) {
7
+  const disabledAttributeText = (
8
+    <Text style={styles.disabledAttributeText}>
11 9
         You must consent to sharing your status as a Barcelona resident or
12 10
         you cannot sign this petition. This information is anonymous.
13
-      </Text>
14
-    );
15
-    return (
16
-      <View style={styles.attributeContainerVerified}>
17
-        <View style={styles.attribute}>
18
-          <Text style={styles.attributeName}>{this.props.name}</Text>
19
-          <Switch onValueChange={this.props.toggleCallback} value={this.props.isEnabled} />
20
-        </View>
21
-        { !this.props.isEnabled && this.props.isMandatory && disabledAttributeText }
22
-      </View>);
23
-  }
24
-
25
-  nonVerifiedMode() {
26
-    return (
27
-      <View style={styles.attributeContainerNonVerified}>
28
-        <Text style={styles.attributeName}>Verified Atlantis Resident*</Text>
29
-        <Text style={styles.attributeDetails}>To get this attribute you will be directed
30
-          to the Atlantis Council website
31
-        </Text>
32
-
33
-        <Button
34
-          name="REQUEST"
35
-          onPress={this.props.buttonCallback}
36
-          style={{
37
-            alignSelf: 'flex-end',
38
-            width: 100,
39
-          }}
40
-        />
11
+    </Text>
12
+  );
13
+  return (
14
+    <View style={styles.attributeContainerVerified}>
15
+      <View style={styles.attribute}>
16
+        <Text style={styles.attributeName}>{props.name}</Text>
17
+        <Switch onValueChange={props.toggleCallback} value={props.isEnabled} />
41 18
       </View>
42
-    );
43
-  }
44
-
45
-  render() {
46
-    if (this.props.isVerified) {
47
-      return this.verifiedMode();
48
-    }
49
-    return this.nonVerifiedMode();
50
-  }
19
+      { !props.isEnabled && props.isMandatory && disabledAttributeText }
20
+    </View>);
51 21
 }
52 22
 
53 23
 Attribute.propTypes = {
54
-  buttonCallback: PropTypes.func,
55
-  isVerified: PropTypes.bool.isRequired,
56 24
   isMandatory: PropTypes.bool,
57 25
   toggleCallback: PropTypes.func,
58 26
   isEnabled: PropTypes.bool,
@@ -60,7 +28,6 @@ Attribute.propTypes = {
60 28
 };
61 29
 
62 30
 Attribute.defaultProps = {
63
-  buttonCallback: () => {},
64 31
   toggleCallback: () => {},
65 32
   isMandatory: false,
66 33
   isEnabled: true,

+ 4 - 32
apps/wallet/screens/PetitionSummary.js

@@ -1,12 +1,12 @@
1 1
 import React from 'react';
2
-import { Constants, SecureStore, WebBrowser } from 'expo';
2
+import { Constants } from 'expo';
3 3
 import Spinner from 'react-native-loading-spinner-overlay';
4 4
 import { Text, View, Linking, ScrollView } from 'react-native';
5 5
 import { connect } from 'react-redux';
6 6
 import PropTypes from 'prop-types';
7 7
 import { getPetition, signPetition } from '../application/redux/actions/petition';
8 8
 import { setSignOutcome } from '../application/redux/actions/signOutcome';
9
-import { addCredential, bubbleUpRequiredAttributeToggle, bubbleUpOptionalAttributeToggle } from '../application/redux/actions/attributes';
9
+import { bubbleUpRequiredAttributeToggle, bubbleUpOptionalAttributeToggle } from '../application/redux/actions/attributes';
10 10
 import Button from '../application/components/Button/Button';
11 11
 import { goToSignOutcome } from '../application/redux/actions/navigation';
12 12
 import AttributeComponent from '../application/components/Attribute/Attribute';
@@ -38,29 +38,11 @@ class PetitionSummary extends React.Component {
38 38
     this.props.getPetition(this.props.petitionLink);
39 39
   }
40 40
 
41
-  handleRedirect = (event) => {
42
-    const { url } = event;
43
-    const { petition, walletId } = this.props;
44
-
45
-    this.props.addCredential(petition.attributes[0], walletId, url);
46
-
47
-    WebBrowser.dismissBrowser();
48
-  };
49
-
50 41
   openPetitionInBrowser = () => {
51 42
     const petitionUrl = `http://secure-petitions.s3-website-eu-west-1.amazonaws.com/#/${this.props.petition.id}`;
52 43
     Linking.openURL(petitionUrl);
53 44
   };
54 45
 
55
-  openWebBrowserAsync = async () => {
56
-    const queryParam = encodeURIComponent(Constants.linkingUri);
57
-    const url = `http://atlantis-decode.s3-website-eu-west-1.amazonaws.com/#/?linkingUri=${queryParam}`;
58
-
59
-    Linking.addEventListener('url', this.handleRedirect);
60
-    await WebBrowser.openBrowserAsync(url);
61
-    Linking.removeEventListener('url', this.handleRedirect);
62
-  };
63
-
64 46
   async sign(petition, walletId, vote) {
65 47
     this.setState({
66 48
       loading: true,
@@ -84,8 +66,6 @@ class PetitionSummary extends React.Component {
84 66
   }
85 67
 
86 68
   render() {
87
-    const isAttributeVerified = this.props.attributes.list.length > 0;
88
-
89 69
     const petitionAttributes = (
90 70
       <View style={styles.petitionSummaryBox}>
91 71
         <Text style={styles.petitionSummaryPetitionTitle}>{this.props.petition.title}</Text>
@@ -96,8 +76,6 @@ class PetitionSummary extends React.Component {
96 76
           This information is anonymised - Decidim will not receive any personally identifying data.
97 77
         </Text>
98 78
         <AttributeComponent
99
-          buttonCallback={this.openWebBrowserAsync}
100
-          isVerified={isAttributeVerified}
101 79
           isMandatory
102 80
           toggleCallback={this.props.bubbleUpRequiredAttributeToggle}
103 81
           isEnabled={this.props.attributes.isRequiredAttributeEnabled}
@@ -107,14 +85,12 @@ class PetitionSummary extends React.Component {
107 85
           Optional data to share:
108 86
         </Text>
109 87
         <AttributeComponent
110
-          isVerified
111 88
           isMandatory={false}
112 89
           toggleCallback={this.props.bubbleUpAgeAttributeToggle}
113 90
           isEnabled={this.props.attributes.optionalAttributesToggleStatus.age}
114 91
           name="Age (20-29)"
115 92
         />
116 93
         <AttributeComponent
117
-          isVerified
118 94
           isMandatory={false}
119 95
           toggleCallback={this.props.bubbleUpGenderAttributeToggle}
120 96
           isEnabled={this.props.attributes.optionalAttributesToggleStatus.gender}
@@ -139,7 +115,7 @@ class PetitionSummary extends React.Component {
139 115
         </ScrollView>
140 116
         <View style={{ flexDirection: 'row' }}>
141 117
           <Button
142
-            enabled={isAttributeVerified && this.props.attributes.isRequiredAttributeEnabled}
118
+            enabled={this.props.attributes.isRequiredAttributeEnabled}
143 119
             onPress={() => { this.sign(this.props.petition, this.props.walletId, 'Yes'); }}
144 120
             name="Yes"
145 121
             style={{
@@ -147,7 +123,7 @@ class PetitionSummary extends React.Component {
147 123
             }}
148 124
           />
149 125
           <Button
150
-            enabled={isAttributeVerified && this.props.attributes.isRequiredAttributeEnabled}
126
+            enabled={this.props.attributes.isRequiredAttributeEnabled}
151 127
             onPress={() => { this.sign(this.props.petition, this.props.walletId, 'No'); }}
152 128
             name="No"
153 129
             style={{
@@ -175,7 +151,6 @@ PetitionSummary.propTypes = {
175 151
     closingDate: PropTypes.string,
176 152
   }),
177 153
   petitionError: PropTypes.string,
178
-  addCredential: PropTypes.func.isRequired,
179 154
   getPetition: PropTypes.func.isRequired,
180 155
   walletId: PropTypes.string.isRequired,
181 156
   attributes: PropTypes.shape({
@@ -208,9 +183,6 @@ const mapStateToProps = state => ({
208 183
 
209 184
 const mapDispatchToProps = dispatch => ({
210 185
   getPetition: (petitionLink) => { dispatch(getPetition(petitionLink)); },
211
-  addCredential: (attribute, walletId, url) => {
212
-    dispatch(addCredential(attribute, walletId, url, SecureStore.setItemAsync));
213
-  },
214 186
   setSignOutcome: (signSuccess) => { dispatch(setSignOutcome(signSuccess)); },
215 187
   goToSignOutcome: () => { dispatch(goToSignOutcome()); },
216 188
   signPetition: (petition, walletId, vote, age, gender) =>

+ 12 - 68
apps/wallet/test/snapshot/__snapshots__/Attribute.test.js.snap

@@ -6,79 +6,19 @@ exports[`renders Attribute on non-verfied mode component 1`] = `
6 6
     Object {
7 7
       "alignSelf": "stretch",
8 8
       "backgroundColor": "#FFF",
9
-      "padding": 16,
9
+      "display": "flex",
10
+      "flexDirection": "column",
11
+      "marginVertical": 20,
10 12
     }
11 13
   }
12 14
 >
13
-  <Text
14
-    accessible={true}
15
-    allowFontScaling={true}
16
-    ellipsizeMode="tail"
17
-    style={
18
-      Object {
19
-        "color": "rgba(0, 0, 0, 0.87)",
20
-        "flex": 1,
21
-        "fontSize": 16,
22
-        "fontWeight": "500",
23
-      }
24
-    }
25
-  >
26
-    Verified Atlantis Resident*
27
-  </Text>
28
-  <Text
29
-    accessible={true}
30
-    allowFontScaling={true}
31
-    ellipsizeMode="tail"
32
-    style={
33
-      Object {
34
-        "color": "rgba(0, 0, 0, 0.54)",
35
-        "marginVertical": 4,
36
-      }
37
-    }
38
-  >
39
-    To get this attribute you will be directed to the Atlantis Council website
40
-  </Text>
41 15
   <View
42
-    accessibilityComponentType={undefined}
43
-    accessibilityLabel={undefined}
44
-    accessibilityTraits={undefined}
45
-    accessible={true}
46
-    collapsable={undefined}
47
-    hitSlop={undefined}
48
-    isTVSelectable={true}
49
-    nativeID={undefined}
50
-    onLayout={undefined}
51
-    onResponderGrant={[Function]}
52
-    onResponderMove={[Function]}
53
-    onResponderRelease={[Function]}
54
-    onResponderTerminate={[Function]}
55
-    onResponderTerminationRequest={[Function]}
56
-    onStartShouldSetResponder={[Function]}
57 16
     style={
58 17
       Object {
59
-        "alignSelf": "flex-end",
60
-        "backgroundColor": "rgb(0,163,158)",
61
-        "borderRadius": 2,
62
-        "elevation": 2,
63
-        "height": 36,
64
-        "marginBottom": 18,
65
-        "marginHorizontal": 16,
66
-        "marginTop": 10,
67
-        "opacity": 1,
68
-        "paddingHorizontal": 16,
69
-        "paddingVertical": 8,
70
-        "shadowColor": "rgba(0, 0, 0, 0.54)",
71
-        "shadowOffset": Object {
72
-          "height": 2,
73
-          "width": 0,
74
-        },
75
-        "shadowOpacity": 0.8,
76
-        "shadowRadius": 2,
77
-        "width": 100,
18
+        "flex": 1,
19
+        "flexDirection": "row",
78 20
       }
79 21
     }
80
-    testID={undefined}
81
-    tvParallaxProperties={undefined}
82 22
   >
83 23
     <Text
84 24
       accessible={true}
@@ -86,15 +26,19 @@ exports[`renders Attribute on non-verfied mode component 1`] = `
86 26
       ellipsizeMode="tail"
87 27
       style={
88 28
         Object {
89
-          "alignSelf": "center",
90
-          "color": "#FFF",
29
+          "color": "rgba(0, 0, 0, 0.87)",
30
+          "flex": 1,
91 31
           "fontSize": 16,
92 32
           "fontWeight": "500",
93 33
         }
94 34
       }
95 35
     >
96
-      REQUEST
36
+      test
97 37
     </Text>
38
+    <Switch
39
+      onValueChange={[Function]}
40
+      value={true}
41
+    />
98 42
   </View>
99 43
 </View>
100 44
 `;

+ 24 - 122
apps/wallet/test/snapshot/__snapshots__/PetitionSummary.test.js.snap

@@ -5,7 +5,6 @@ ShallowWrapper {
5 5
   "length": 1,
6 6
   Symbol(enzyme.__root__): [Circular],
7 7
   Symbol(enzyme.__unrendered__): <PetitionSummary
8
-    addCredential={[Function]}
9 8
     attributes={
10 9
       Object {
11 10
         "isRequiredAttributeEnabled": true,
@@ -132,10 +131,8 @@ ShallowWrapper {
132 131
               This information is anonymised - Decidim will not receive any personally identifying data.
133 132
             </Text>
134 133
             <Attribute
135
-              buttonCallback={[Function]}
136 134
               isEnabled={true}
137 135
               isMandatory={true}
138
-              isVerified={true}
139 136
               name="Your residency status (required)"
140 137
               toggleCallback={[Function]}
141 138
             />
@@ -147,18 +144,14 @@ ShallowWrapper {
147 144
               Optional data to share:
148 145
             </Text>
149 146
             <Attribute
150
-              buttonCallback={[Function]}
151 147
               isEnabled={false}
152 148
               isMandatory={false}
153
-              isVerified={true}
154 149
               name="Age (20-29)"
155 150
               toggleCallback={[Function]}
156 151
             />
157 152
             <Attribute
158
-              buttonCallback={[Function]}
159 153
               isEnabled={false}
160 154
               isMandatory={false}
161
-              isVerified={true}
162 155
               name="Gender (Female)"
163 156
               toggleCallback={[Function]}
164 157
             />
@@ -295,10 +288,8 @@ ShallowWrapper {
295 288
                 This information is anonymised - Decidim will not receive any personally identifying data.
296 289
               </Text>
297 290
               <Attribute
298
-                buttonCallback={[Function]}
299 291
                 isEnabled={true}
300 292
                 isMandatory={true}
301
-                isVerified={true}
302 293
                 name="Your residency status (required)"
303 294
                 toggleCallback={[Function]}
304 295
               />
@@ -310,18 +301,14 @@ ShallowWrapper {
310 301
                 Optional data to share:
311 302
               </Text>
312 303
               <Attribute
313
-                buttonCallback={[Function]}
314 304
                 isEnabled={false}
315 305
                 isMandatory={false}
316
-                isVerified={true}
317 306
                 name="Age (20-29)"
318 307
                 toggleCallback={[Function]}
319 308
               />
320 309
               <Attribute
321
-                buttonCallback={[Function]}
322 310
                 isEnabled={false}
323 311
                 isMandatory={false}
324
-                isVerified={true}
325 312
                 name="Gender (Female)"
326 313
                 toggleCallback={[Function]}
327 314
               />
@@ -421,10 +408,8 @@ ShallowWrapper {
421 408
                   This information is anonymised - Decidim will not receive any personally identifying data.
422 409
                 </Text>,
423 410
                 <Attribute
424
-                  buttonCallback={[Function]}
425 411
                   isEnabled={true}
426 412
                   isMandatory={true}
427
-                  isVerified={true}
428 413
                   name="Your residency status (required)"
429 414
                   toggleCallback={[Function]}
430 415
                 />,
@@ -436,18 +421,14 @@ ShallowWrapper {
436 421
                   Optional data to share:
437 422
                 </Text>,
438 423
                 <Attribute
439
-                  buttonCallback={[Function]}
440 424
                   isEnabled={false}
441 425
                   isMandatory={false}
442
-                  isVerified={true}
443 426
                   name="Age (20-29)"
444 427
                   toggleCallback={[Function]}
445 428
                 />,
446 429
                 <Attribute
447
-                  buttonCallback={[Function]}
448 430
                   isEnabled={false}
449 431
                   isMandatory={false}
450
-                  isVerified={true}
451 432
                   name="Gender (Female)"
452 433
                   toggleCallback={[Function]}
453 434
                 />,
@@ -518,12 +499,10 @@ ShallowWrapper {
518 499
               Object {
519 500
                 "instance": null,
520 501
                 "key": undefined,
521
-                "nodeType": "class",
502
+                "nodeType": "function",
522 503
                 "props": Object {
523
-                  "buttonCallback": [Function],
524 504
                   "isEnabled": true,
525 505
                   "isMandatory": true,
526
-                  "isVerified": true,
527 506
                   "name": "Your residency status (required)",
528 507
                   "toggleCallback": [Function],
529 508
                 },
@@ -548,12 +527,10 @@ ShallowWrapper {
548 527
               Object {
549 528
                 "instance": null,
550 529
                 "key": undefined,
551
-                "nodeType": "class",
530
+                "nodeType": "function",
552 531
                 "props": Object {
553
-                  "buttonCallback": [Function],
554 532
                   "isEnabled": false,
555 533
                   "isMandatory": false,
556
-                  "isVerified": true,
557 534
                   "name": "Age (20-29)",
558 535
                   "toggleCallback": [Function],
559 536
                 },
@@ -564,12 +541,10 @@ ShallowWrapper {
564 541
               Object {
565 542
                 "instance": null,
566 543
                 "key": undefined,
567
-                "nodeType": "class",
544
+                "nodeType": "function",
568 545
                 "props": Object {
569
-                  "buttonCallback": [Function],
570 546
                   "isEnabled": false,
571 547
                   "isMandatory": false,
572
-                  "isVerified": true,
573 548
                   "name": "Gender (Female)",
574 549
                   "toggleCallback": [Function],
575 550
                 },
@@ -755,10 +730,8 @@ ShallowWrapper {
755 730
                 This information is anonymised - Decidim will not receive any personally identifying data.
756 731
               </Text>
757 732
               <Attribute
758
-                buttonCallback={[Function]}
759 733
                 isEnabled={true}
760 734
                 isMandatory={true}
761
-                isVerified={true}
762 735
                 name="Your residency status (required)"
763 736
                 toggleCallback={[Function]}
764 737
               />
@@ -770,18 +743,14 @@ ShallowWrapper {
770 743
                 Optional data to share:
771 744
               </Text>
772 745
               <Attribute
773
-                buttonCallback={[Function]}
774 746
                 isEnabled={false}
775 747
                 isMandatory={false}
776
-                isVerified={true}
777 748
                 name="Age (20-29)"
778 749
                 toggleCallback={[Function]}
779 750
               />
780 751
               <Attribute
781
-                buttonCallback={[Function]}
782 752
                 isEnabled={false}
783 753
                 isMandatory={false}
784
-                isVerified={true}
785 754
                 name="Gender (Female)"
786 755
                 toggleCallback={[Function]}
787 756
               />
@@ -918,10 +887,8 @@ ShallowWrapper {
918 887
                   This information is anonymised - Decidim will not receive any personally identifying data.
919 888
                 </Text>
920 889
                 <Attribute
921
-                  buttonCallback={[Function]}
922 890
                   isEnabled={true}
923 891
                   isMandatory={true}
924
-                  isVerified={true}
925 892
                   name="Your residency status (required)"
926 893
                   toggleCallback={[Function]}
927 894
                 />
@@ -933,18 +900,14 @@ ShallowWrapper {
933 900
                   Optional data to share:
934 901
                 </Text>
935 902
                 <Attribute
936
-                  buttonCallback={[Function]}
937 903
                   isEnabled={false}
938 904
                   isMandatory={false}
939
-                  isVerified={true}
940 905
                   name="Age (20-29)"
941 906
                   toggleCallback={[Function]}
942 907
                 />
943 908
                 <Attribute
944
-                  buttonCallback={[Function]}
945 909
                   isEnabled={false}
946 910
                   isMandatory={false}
947
-                  isVerified={true}
948 911
                   name="Gender (Female)"
949 912
                   toggleCallback={[Function]}
950 913
                 />
@@ -1044,10 +1007,8 @@ ShallowWrapper {
1044 1007
                     This information is anonymised - Decidim will not receive any personally identifying data.
1045 1008
                   </Text>,
1046 1009
                   <Attribute
1047
-                    buttonCallback={[Function]}
1048 1010
                     isEnabled={true}
1049 1011
                     isMandatory={true}
1050
-                    isVerified={true}
1051 1012
                     name="Your residency status (required)"
1052 1013
                     toggleCallback={[Function]}
1053 1014
                   />,
@@ -1059,18 +1020,14 @@ ShallowWrapper {
1059 1020
                     Optional data to share:
1060 1021
                   </Text>,
1061 1022
                   <Attribute
1062
-                    buttonCallback={[Function]}
1063 1023
                     isEnabled={false}
1064 1024
                     isMandatory={false}
1065
-                    isVerified={true}
1066 1025
                     name="Age (20-29)"
1067 1026
                     toggleCallback={[Function]}
1068 1027
                   />,
1069 1028
                   <Attribute
1070
-                    buttonCallback={[Function]}
1071 1029
                     isEnabled={false}
1072 1030
                     isMandatory={false}
1073
-                    isVerified={true}
1074 1031
                     name="Gender (Female)"
1075 1032
                     toggleCallback={[Function]}
1076 1033
                   />,
@@ -1141,12 +1098,10 @@ ShallowWrapper {
1141 1098
                 Object {
1142 1099
                   "instance": null,
1143 1100
                   "key": undefined,
1144
-                  "nodeType": "class",
1101
+                  "nodeType": "function",
1145 1102
                   "props": Object {
1146
-                    "buttonCallback": [Function],
1147 1103
                     "isEnabled": true,
1148 1104
                     "isMandatory": true,
1149
-                    "isVerified": true,
1150 1105
                     "name": "Your residency status (required)",
1151 1106
                     "toggleCallback": [Function],
1152 1107
                   },
@@ -1171,12 +1126,10 @@ ShallowWrapper {
1171 1126
                 Object {
1172 1127
                   "instance": null,
1173 1128
                   "key": undefined,
1174
-                  "nodeType": "class",
1129
+                  "nodeType": "function",
1175 1130
                   "props": Object {
1176
-                    "buttonCallback": [Function],
1177 1131
                     "isEnabled": false,
1178 1132
                     "isMandatory": false,
1179
-                    "isVerified": true,
1180 1133
                     "name": "Age (20-29)",
1181 1134
                     "toggleCallback": [Function],
1182 1135
                   },
@@ -1187,12 +1140,10 @@ ShallowWrapper {
1187 1140
                 Object {
1188 1141
                   "instance": null,
1189 1142
                   "key": undefined,
1190
-                  "nodeType": "class",
1143
+                  "nodeType": "function",
1191 1144
                   "props": Object {
1192
-                    "buttonCallback": [Function],
1193 1145
                     "isEnabled": false,
1194 1146
                     "isMandatory": false,
1195
-                    "isVerified": true,
1196 1147
                     "name": "Gender (Female)",
1197 1148
                     "toggleCallback": [Function],
1198 1149
                   },
@@ -1326,7 +1277,6 @@ ShallowWrapper {
1326 1277
   "length": 1,
1327 1278
   Symbol(enzyme.__root__): [Circular],
1328 1279
   Symbol(enzyme.__unrendered__): <PetitionSummary
1329
-    addCredential={[Function]}
1330 1280
     attributes={
1331 1281
       Object {
1332 1282
         "isRequiredAttributeEnabled": true,
@@ -1442,10 +1392,8 @@ ShallowWrapper {
1442 1392
               This information is anonymised - Decidim will not receive any personally identifying data.
1443 1393
             </Text>
1444 1394
             <Attribute
1445
-              buttonCallback={[Function]}
1446 1395
               isEnabled={true}
1447 1396
               isMandatory={true}
1448
-              isVerified={false}
1449 1397
               name="Your residency status (required)"
1450 1398
               toggleCallback={[Function]}
1451 1399
             />
@@ -1457,18 +1405,14 @@ ShallowWrapper {
1457 1405
               Optional data to share:
1458 1406
             </Text>
1459 1407
             <Attribute
1460
-              buttonCallback={[Function]}
1461 1408
               isEnabled={false}
1462 1409
               isMandatory={false}
1463
-              isVerified={true}
1464 1410
               name="Age (20-29)"
1465 1411
               toggleCallback={[Function]}
1466 1412
             />
1467 1413
             <Attribute
1468
-              buttonCallback={[Function]}
1469 1414
               isEnabled={false}
1470 1415
               isMandatory={false}
1471
-              isVerified={true}
1472 1416
               name="Gender (Female)"
1473 1417
               toggleCallback={[Function]}
1474 1418
             />
@@ -1482,7 +1426,7 @@ ShallowWrapper {
1482 1426
           }
1483 1427
         >
1484 1428
           <Button
1485
-            enabled={false}
1429
+            enabled={true}
1486 1430
             name="Yes"
1487 1431
             onPress={[Function]}
1488 1432
             style={
@@ -1492,7 +1436,7 @@ ShallowWrapper {
1492 1436
             }
1493 1437
           />
1494 1438
           <Button
1495
-            enabled={false}
1439
+            enabled={true}
1496 1440
             name="No"
1497 1441
             onPress={[Function]}
1498 1442
             style={
@@ -1605,10 +1549,8 @@ ShallowWrapper {
1605 1549
                 This information is anonymised - Decidim will not receive any personally identifying data.
1606 1550
               </Text>
1607 1551
               <Attribute
1608
-                buttonCallback={[Function]}
1609 1552
                 isEnabled={true}
1610 1553
                 isMandatory={true}
1611
-                isVerified={false}
1612 1554
                 name="Your residency status (required)"
1613 1555
                 toggleCallback={[Function]}
1614 1556
               />
@@ -1620,18 +1562,14 @@ ShallowWrapper {
1620 1562
                 Optional data to share:
1621 1563
               </Text>
1622 1564
               <Attribute
1623
-                buttonCallback={[Function]}
1624 1565
                 isEnabled={false}
1625 1566
                 isMandatory={false}
1626
-                isVerified={true}
1627 1567
                 name="Age (20-29)"
1628 1568
                 toggleCallback={[Function]}
1629 1569
               />
1630 1570
               <Attribute
1631
-                buttonCallback={[Function]}
1632 1571
                 isEnabled={false}
1633 1572
                 isMandatory={false}
1634
-                isVerified={true}
1635 1573
                 name="Gender (Female)"
1636 1574
                 toggleCallback={[Function]}
1637 1575
               />
@@ -1731,10 +1669,8 @@ ShallowWrapper {
1731 1669
                   This information is anonymised - Decidim will not receive any personally identifying data.
1732 1670
                 </Text>,
1733 1671
                 <Attribute
1734
-                  buttonCallback={[Function]}
1735 1672
                   isEnabled={true}
1736 1673
                   isMandatory={true}
1737
-                  isVerified={false}
1738 1674
                   name="Your residency status (required)"
1739 1675
                   toggleCallback={[Function]}
1740 1676
                 />,
@@ -1746,18 +1682,14 @@ ShallowWrapper {
1746 1682
                   Optional data to share:
1747 1683
                 </Text>,
1748 1684
                 <Attribute
1749
-                  buttonCallback={[Function]}
1750 1685
                   isEnabled={false}
1751 1686
                   isMandatory={false}
1752
-                  isVerified={true}
1753 1687
                   name="Age (20-29)"
1754 1688
                   toggleCallback={[Function]}
1755 1689
                 />,
1756 1690
                 <Attribute
1757
-                  buttonCallback={[Function]}
1758 1691
                   isEnabled={false}
1759 1692
                   isMandatory={false}
1760
-                  isVerified={true}
1761 1693
                   name="Gender (Female)"
1762 1694
                   toggleCallback={[Function]}
1763 1695
                 />,
@@ -1828,12 +1760,10 @@ ShallowWrapper {
1828 1760
               Object {
1829 1761
                 "instance": null,
1830 1762
                 "key": undefined,
1831
-                "nodeType": "class",
1763
+                "nodeType": "function",
1832 1764
                 "props": Object {
1833
-                  "buttonCallback": [Function],
1834 1765
                   "isEnabled": true,
1835 1766
                   "isMandatory": true,
1836
-                  "isVerified": false,
1837 1767
                   "name": "Your residency status (required)",
1838 1768
                   "toggleCallback": [Function],
1839 1769
                 },
@@ -1858,12 +1788,10 @@ ShallowWrapper {
1858 1788
               Object {
1859 1789
                 "instance": null,
1860 1790
                 "key": undefined,
1861
-                "nodeType": "class",
1791
+                "nodeType": "function",
1862 1792
                 "props": Object {
1863
-                  "buttonCallback": [Function],
1864 1793
                   "isEnabled": false,
1865 1794
                   "isMandatory": false,
1866
-                  "isVerified": true,
1867 1795
                   "name": "Age (20-29)",
1868 1796
                   "toggleCallback": [Function],
1869 1797
                 },
@@ -1874,12 +1802,10 @@ ShallowWrapper {
1874 1802
               Object {
1875 1803
                 "instance": null,
1876 1804
                 "key": undefined,
1877
-                "nodeType": "class",
1805
+                "nodeType": "function",
1878 1806
                 "props": Object {
1879
-                  "buttonCallback": [Function],
1880 1807
                   "isEnabled": false,
1881 1808
                   "isMandatory": false,
1882
-                  "isVerified": true,
1883 1809
                   "name": "Gender (Female)",
1884 1810
                   "toggleCallback": [Function],
1885 1811
                 },
@@ -1900,7 +1826,7 @@ ShallowWrapper {
1900 1826
         "props": Object {
1901 1827
           "children": Array [
1902 1828
             <Button
1903
-              enabled={false}
1829
+              enabled={true}
1904 1830
               name="Yes"
1905 1831
               onPress={[Function]}
1906 1832
               style={
@@ -1910,7 +1836,7 @@ ShallowWrapper {
1910 1836
               }
1911 1837
             />,
1912 1838
             <Button
1913
-              enabled={false}
1839
+              enabled={true}
1914 1840
               name="No"
1915 1841
               onPress={[Function]}
1916 1842
               style={
@@ -1931,7 +1857,7 @@ ShallowWrapper {
1931 1857
             "key": undefined,
1932 1858
             "nodeType": "function",
1933 1859
             "props": Object {
1934
-              "enabled": false,
1860
+              "enabled": true,
1935 1861
               "name": "Yes",
1936 1862
               "onPress": [Function],
1937 1863
               "style": Object {
@@ -1947,7 +1873,7 @@ ShallowWrapper {
1947 1873
             "key": undefined,
1948 1874
             "nodeType": "function",
1949 1875
             "props": Object {
1950
-              "enabled": false,
1876
+              "enabled": true,
1951 1877
               "name": "No",
1952 1878
               "onPress": [Function],
1953 1879
               "style": Object {
@@ -2065,10 +1991,8 @@ ShallowWrapper {
2065 1991
                 This information is anonymised - Decidim will not receive any personally identifying data.
2066 1992
               </Text>
2067 1993
               <Attribute
2068
-                buttonCallback={[Function]}
2069 1994
                 isEnabled={true}
2070 1995
                 isMandatory={true}
2071
-                isVerified={false}
2072 1996
                 name="Your residency status (required)"
2073 1997
                 toggleCallback={[Function]}
2074 1998
               />
@@ -2080,18 +2004,14 @@ ShallowWrapper {
2080 2004
                 Optional data to share:
2081 2005
               </Text>
2082 2006
               <Attribute
2083
-                buttonCallback={[Function]}
2084 2007
                 isEnabled={false}
2085 2008
                 isMandatory={false}
2086
-                isVerified={true}
2087 2009
                 name="Age (20-29)"
2088 2010
                 toggleCallback={[Function]}
2089 2011
               />
2090 2012
               <Attribute
2091
-                buttonCallback={[Function]}
2092 2013
                 isEnabled={false}
2093 2014
                 isMandatory={false}
2094
-                isVerified={true}
2095 2015
                 name="Gender (Female)"
2096 2016
                 toggleCallback={[Function]}
2097 2017
               />
@@ -2105,7 +2025,7 @@ ShallowWrapper {
2105 2025
             }
2106 2026
           >
2107 2027
             <Button
2108
-              enabled={false}
2028
+              enabled={true}
2109 2029
               name="Yes"
2110 2030
               onPress={[Function]}
2111 2031
               style={
@@ -2115,7 +2035,7 @@ ShallowWrapper {
2115 2035
               }
2116 2036
             />
2117 2037
             <Button
2118
-              enabled={false}
2038
+              enabled={true}
2119 2039
               name="No"
2120 2040
               onPress={[Function]}
2121 2041
               style={
@@ -2228,10 +2148,8 @@ ShallowWrapper {
2228 2148
                   This information is anonymised - Decidim will not receive any personally identifying data.
2229 2149
                 </Text>
2230 2150
                 <Attribute
2231
-                  buttonCallback={[Function]}
2232 2151
                   isEnabled={true}
2233 2152
                   isMandatory={true}
2234
-                  isVerified={false}
2235 2153
                   name="Your residency status (required)"
2236 2154
                   toggleCallback={[Function]}
2237 2155
                 />
@@ -2243,18 +2161,14 @@ ShallowWrapper {
2243 2161
                   Optional data to share:
2244 2162
                 </Text>
2245 2163
                 <Attribute
2246
-                  buttonCallback={[Function]}
2247 2164
                   isEnabled={false}
2248 2165
                   isMandatory={false}
2249
-                  isVerified={true}
2250 2166
                   name="Age (20-29)"
2251 2167
                   toggleCallback={[Function]}
2252 2168
                 />
2253 2169
                 <Attribute
2254
-                  buttonCallback={[Function]}
2255 2170
                   isEnabled={false}
2256 2171
                   isMandatory={false}
2257
-                  isVerified={true}
2258 2172
                   name="Gender (Female)"
2259 2173
                   toggleCallback={[Function]}
2260 2174
                 />
@@ -2354,10 +2268,8 @@ ShallowWrapper {
2354 2268
                     This information is anonymised - Decidim will not receive any personally identifying data.
2355 2269
                   </Text>,
2356 2270
                   <Attribute
2357
-                    buttonCallback={[Function]}
2358 2271
                     isEnabled={true}
2359 2272
                     isMandatory={true}
2360
-                    isVerified={false}
2361 2273
                     name="Your residency status (required)"
2362 2274
                     toggleCallback={[Function]}
2363 2275
                   />,
@@ -2369,18 +2281,14 @@ ShallowWrapper {
2369 2281
                     Optional data to share:
2370 2282
                   </Text>,
2371 2283
                   <Attribute
2372
-                    buttonCallback={[Function]}
2373 2284
                     isEnabled={false}
2374 2285
                     isMandatory={false}
2375
-                    isVerified={true}
2376 2286
                     name="Age (20-29)"
2377 2287
                     toggleCallback={[Function]}
2378 2288
                   />,
2379 2289
                   <Attribute
2380
-                    buttonCallback={[Function]}
2381 2290
                     isEnabled={false}
2382 2291
                     isMandatory={false}
2383
-                    isVerified={true}
2384 2292
                     name="Gender (Female)"
2385 2293
                     toggleCallback={[Function]}
2386 2294
                   />,
@@ -2451,12 +2359,10 @@ ShallowWrapper {
2451 2359
                 Object {
2452 2360
                   "instance": null,
2453 2361
                   "key": undefined,
2454
-                  "nodeType": "class",
2362
+                  "nodeType": "function",
2455 2363
                   "props": Object {
2456
-                    "buttonCallback": [Function],
2457 2364
                     "isEnabled": true,
2458 2365
                     "isMandatory": true,
2459
-                    "isVerified": false,
2460 2366
                     "name": "Your residency status (required)",
2461 2367
                     "toggleCallback": [Function],
2462 2368
                   },
@@ -2481,12 +2387,10 @@ ShallowWrapper {
2481 2387
                 Object {
2482 2388
                   "instance": null,
2483 2389
                   "key": undefined,
2484
-                  "nodeType": "class",
2390
+                  "nodeType": "function",
2485 2391
                   "props": Object {
2486
-                    "buttonCallback": [Function],
2487 2392
                     "isEnabled": false,
2488 2393
                     "isMandatory": false,
2489
-                    "isVerified": true,
2490 2394
                     "name": "Age (20-29)",
2491 2395
                     "toggleCallback": [Function],
2492 2396
                   },
@@ -2497,12 +2401,10 @@ ShallowWrapper {
2497 2401
                 Object {
2498 2402
                   "instance": null,
2499 2403
                   "key": undefined,
2500
-                  "nodeType": "class",
2404
+                  "nodeType": "function",
2501 2405
                   "props": Object {
2502
-                    "buttonCallback": [Function],
2503 2406
                     "isEnabled": false,
2504 2407
                     "isMandatory": false,
2505
-                    "isVerified": true,
2506 2408
                     "name": "Gender (Female)",
2507 2409
                     "toggleCallback": [Function],
2508 2410
                   },
@@ -2523,7 +2425,7 @@ ShallowWrapper {
2523 2425
           "props": Object {
2524 2426
             "children": Array [
2525 2427
               <Button
2526
-                enabled={false}
2428
+                enabled={true}
2527 2429
                 name="Yes"
2528 2430
                 onPress={[Function]}
2529 2431
                 style={
@@ -2533,7 +2435,7 @@ ShallowWrapper {
2533 2435
                 }
2534 2436
               />,
2535 2437
               <Button
2536
-                enabled={false}
2438
+                enabled={true}
2537 2439
                 name="No"
2538 2440
                 onPress={[Function]}
2539 2441
                 style={
@@ -2554,7 +2456,7 @@ ShallowWrapper {
2554 2456
               "key": undefined,
2555 2457
               "nodeType": "function",
2556 2458
               "props": Object {
2557
-                "enabled": false,
2459
+                "enabled": true,
2558 2460
                 "name": "Yes",
2559 2461
                 "onPress": [Function],
2560 2462
                 "style": Object {
@@ -2570,7 +2472,7 @@ ShallowWrapper {
2570 2472
               "key": undefined,
2571 2473
               "nodeType": "function",
2572 2474
               "props": Object {
2573
-                "enabled": false,
2475
+                "enabled": true,
2574 2476
                 "name": "No",
2575 2477
                 "onPress": [Function],
2576 2478
                 "style": Object {