Browse Source

[+Elisa] #163 - Style sign buttons to be side by side

Elena Cristina Raffay Iglesias 1 year ago
parent
commit
fa1d1e79f5

+ 18 - 10
apps/wallet/screens/PetitionSummary.js

@@ -137,16 +137,24 @@ class PetitionSummary extends React.Component {
137 137
           </View>
138 138
           { this.props.petition && petitionAttributes }
139 139
         </ScrollView>
140
-        <Button
141
-          enabled={isAttributeVerified && this.props.attributes.isRequiredAttributeEnabled}
142
-          onPress={() => { this.sign(this.props.petition, this.props.walletId, 'Yes'); }}
143
-          name="Yes"
144
-        />
145
-        <Button
146
-          enabled={isAttributeVerified && this.props.attributes.isRequiredAttributeEnabled}
147
-          onPress={() => { this.sign(this.props.petition, this.props.walletId, 'No'); }}
148
-          name="No"
149
-        />
140
+        <View style={{ flexDirection: 'row' }}>
141
+          <Button
142
+            enabled={isAttributeVerified && this.props.attributes.isRequiredAttributeEnabled}
143
+            onPress={() => { this.sign(this.props.petition, this.props.walletId, 'Yes'); }}
144
+            name="Yes"
145
+            style={{
146
+              flex: 1,
147
+            }}
148
+          />
149
+          <Button
150
+            enabled={isAttributeVerified && this.props.attributes.isRequiredAttributeEnabled}
151
+            onPress={() => { this.sign(this.props.petition, this.props.walletId, 'No'); }}
152
+            name="No"
153
+            style={{
154
+              flex: 1,
155
+            }}
156
+          />
157
+        </View>
150 158
         <Text
151 159
           style={styles.cancelSigningPetition}
152 160
           onPress={this.openPetitionInBrowser}

+ 352 - 128
apps/wallet/test/snapshot/__snapshots__/PetitionSummary.test.js.snap

@@ -164,18 +164,34 @@ ShallowWrapper {
164 164
             />
165 165
           </View>
166 166
         </ScrollViewMock>,
167
-        <Button
168
-          enabled={true}
169
-          name="Yes"
170
-          onPress={[Function]}
171
-          style={Object {}}
172
-        />,
173
-        <Button
174
-          enabled={true}
175
-          name="No"
176
-          onPress={[Function]}
177
-          style={Object {}}
178
-        />,
167
+        <View
168
+          style={
169
+            Object {
170
+              "flexDirection": "row",
171
+            }
172
+          }
173
+        >
174
+          <Button
175
+            enabled={true}
176
+            name="Yes"
177
+            onPress={[Function]}
178
+            style={
179
+              Object {
180
+                "flex": 1,
181
+              }
182
+            }
183
+          />
184
+          <Button
185
+            enabled={true}
186
+            name="No"
187
+            onPress={[Function]}
188
+            style={
189
+              Object {
190
+                "flex": 1,
191
+              }
192
+            }
193
+          />
194
+        </View>,
179 195
         <Text
180 196
           accessible={true}
181 197
           allowFontScaling={true}
@@ -570,29 +586,69 @@ ShallowWrapper {
570 586
       Object {
571 587
         "instance": null,
572 588
         "key": undefined,
573
-        "nodeType": "function",
574
-        "props": Object {
575
-          "enabled": true,
576
-          "name": "Yes",
577
-          "onPress": [Function],
578
-          "style": Object {},
579
-        },
580
-        "ref": null,
581
-        "rendered": null,
582
-        "type": [Function],
583
-      },
584
-      Object {
585
-        "instance": null,
586
-        "key": undefined,
587
-        "nodeType": "function",
589
+        "nodeType": "class",
588 590
         "props": Object {
589
-          "enabled": true,
590
-          "name": "No",
591
-          "onPress": [Function],
592
-          "style": Object {},
591
+          "children": Array [
592
+            <Button
593
+              enabled={true}
594
+              name="Yes"
595
+              onPress={[Function]}
596
+              style={
597
+                Object {
598
+                  "flex": 1,
599
+                }
600
+              }
601
+            />,
602
+            <Button
603
+              enabled={true}
604
+              name="No"
605
+              onPress={[Function]}
606
+              style={
607
+                Object {
608
+                  "flex": 1,
609
+                }
610
+              }
611
+            />,
612
+          ],
613
+          "style": Object {
614
+            "flexDirection": "row",
615
+          },
593 616
         },
594 617
         "ref": null,
595
-        "rendered": null,
618
+        "rendered": Array [
619
+          Object {
620
+            "instance": null,
621
+            "key": undefined,
622
+            "nodeType": "function",
623
+            "props": Object {
624
+              "enabled": true,
625
+              "name": "Yes",
626
+              "onPress": [Function],
627
+              "style": Object {
628
+                "flex": 1,
629
+              },
630
+            },
631
+            "ref": null,
632
+            "rendered": null,
633
+            "type": [Function],
634
+          },
635
+          Object {
636
+            "instance": null,
637
+            "key": undefined,
638
+            "nodeType": "function",
639
+            "props": Object {
640
+              "enabled": true,
641
+              "name": "No",
642
+              "onPress": [Function],
643
+              "style": Object {
644
+                "flex": 1,
645
+              },
646
+            },
647
+            "ref": null,
648
+            "rendered": null,
649
+            "type": [Function],
650
+          },
651
+        ],
596 652
         "type": [Function],
597 653
       },
598 654
       Object {
@@ -731,18 +787,34 @@ ShallowWrapper {
731 787
               />
732 788
             </View>
733 789
           </ScrollViewMock>,
734
-          <Button
735
-            enabled={true}
736
-            name="Yes"
737
-            onPress={[Function]}
738
-            style={Object {}}
739
-          />,
740
-          <Button
741
-            enabled={true}
742
-            name="No"
743
-            onPress={[Function]}
744
-            style={Object {}}
745
-          />,
790
+          <View
791
+            style={
792
+              Object {
793
+                "flexDirection": "row",
794
+              }
795
+            }
796
+          >
797
+            <Button
798
+              enabled={true}
799
+              name="Yes"
800
+              onPress={[Function]}
801
+              style={
802
+                Object {
803
+                  "flex": 1,
804
+                }
805
+              }
806
+            />
807
+            <Button
808
+              enabled={true}
809
+              name="No"
810
+              onPress={[Function]}
811
+              style={
812
+                Object {
813
+                  "flex": 1,
814
+                }
815
+              }
816
+            />
817
+          </View>,
746 818
           <Text
747 819
             accessible={true}
748 820
             allowFontScaling={true}
@@ -1137,29 +1209,69 @@ ShallowWrapper {
1137 1209
         Object {
1138 1210
           "instance": null,
1139 1211
           "key": undefined,
1140
-          "nodeType": "function",
1141
-          "props": Object {
1142
-            "enabled": true,
1143
-            "name": "Yes",
1144
-            "onPress": [Function],
1145
-            "style": Object {},
1146
-          },
1147
-          "ref": null,
1148
-          "rendered": null,
1149
-          "type": [Function],
1150
-        },
1151
-        Object {
1152
-          "instance": null,
1153
-          "key": undefined,
1154
-          "nodeType": "function",
1212
+          "nodeType": "class",
1155 1213
           "props": Object {
1156
-            "enabled": true,
1157
-            "name": "No",
1158
-            "onPress": [Function],
1159
-            "style": Object {},
1214
+            "children": Array [
1215
+              <Button
1216
+                enabled={true}
1217
+                name="Yes"
1218
+                onPress={[Function]}
1219
+                style={
1220
+                  Object {
1221
+                    "flex": 1,
1222
+                  }
1223
+                }
1224
+              />,
1225
+              <Button
1226
+                enabled={true}
1227
+                name="No"
1228
+                onPress={[Function]}
1229
+                style={
1230
+                  Object {
1231
+                    "flex": 1,
1232
+                  }
1233
+                }
1234
+              />,
1235
+            ],
1236
+            "style": Object {
1237
+              "flexDirection": "row",
1238
+            },
1160 1239
           },
1161 1240
           "ref": null,
1162
-          "rendered": null,
1241
+          "rendered": Array [
1242
+            Object {
1243
+              "instance": null,
1244
+              "key": undefined,
1245
+              "nodeType": "function",
1246
+              "props": Object {
1247
+                "enabled": true,
1248
+                "name": "Yes",
1249
+                "onPress": [Function],
1250
+                "style": Object {
1251
+                  "flex": 1,
1252
+                },
1253
+              },
1254
+              "ref": null,
1255
+              "rendered": null,
1256
+              "type": [Function],
1257
+            },
1258
+            Object {
1259
+              "instance": null,
1260
+              "key": undefined,
1261
+              "nodeType": "function",
1262
+              "props": Object {
1263
+                "enabled": true,
1264
+                "name": "No",
1265
+                "onPress": [Function],
1266
+                "style": Object {
1267
+                  "flex": 1,
1268
+                },
1269
+              },
1270
+              "ref": null,
1271
+              "rendered": null,
1272
+              "type": [Function],
1273
+            },
1274
+          ],
1163 1275
           "type": [Function],
1164 1276
         },
1165 1277
         Object {
@@ -1362,18 +1474,34 @@ ShallowWrapper {
1362 1474
             />
1363 1475
           </View>
1364 1476
         </ScrollViewMock>,
1365
-        <Button
1366
-          enabled={false}
1367
-          name="Yes"
1368
-          onPress={[Function]}
1369
-          style={Object {}}
1370
-        />,
1371
-        <Button
1372
-          enabled={false}
1373
-          name="No"
1374
-          onPress={[Function]}
1375
-          style={Object {}}
1376
-        />,
1477
+        <View
1478
+          style={
1479
+            Object {
1480
+              "flexDirection": "row",
1481
+            }
1482
+          }
1483
+        >
1484
+          <Button
1485
+            enabled={false}
1486
+            name="Yes"
1487
+            onPress={[Function]}
1488
+            style={
1489
+              Object {
1490
+                "flex": 1,
1491
+              }
1492
+            }
1493
+          />
1494
+          <Button
1495
+            enabled={false}
1496
+            name="No"
1497
+            onPress={[Function]}
1498
+            style={
1499
+              Object {
1500
+                "flex": 1,
1501
+              }
1502
+            }
1503
+          />
1504
+        </View>,
1377 1505
         <Text
1378 1506
           accessible={true}
1379 1507
           allowFontScaling={true}
@@ -1768,29 +1896,69 @@ ShallowWrapper {
1768 1896
       Object {
1769 1897
         "instance": null,
1770 1898
         "key": undefined,
1771
-        "nodeType": "function",
1772
-        "props": Object {
1773
-          "enabled": false,
1774
-          "name": "Yes",
1775
-          "onPress": [Function],
1776
-          "style": Object {},
1777
-        },
1778
-        "ref": null,
1779
-        "rendered": null,
1780
-        "type": [Function],
1781
-      },
1782
-      Object {
1783
-        "instance": null,
1784
-        "key": undefined,
1785
-        "nodeType": "function",
1899
+        "nodeType": "class",
1786 1900
         "props": Object {
1787
-          "enabled": false,
1788
-          "name": "No",
1789
-          "onPress": [Function],
1790
-          "style": Object {},
1901
+          "children": Array [
1902
+            <Button
1903
+              enabled={false}
1904
+              name="Yes"
1905
+              onPress={[Function]}
1906
+              style={
1907
+                Object {
1908
+                  "flex": 1,
1909
+                }
1910
+              }
1911
+            />,
1912
+            <Button
1913
+              enabled={false}
1914
+              name="No"
1915
+              onPress={[Function]}
1916
+              style={
1917
+                Object {
1918
+                  "flex": 1,
1919
+                }
1920
+              }
1921
+            />,
1922
+          ],
1923
+          "style": Object {
1924
+            "flexDirection": "row",
1925
+          },
1791 1926
         },
1792 1927
         "ref": null,
1793
-        "rendered": null,
1928
+        "rendered": Array [
1929
+          Object {
1930
+            "instance": null,
1931
+            "key": undefined,
1932
+            "nodeType": "function",
1933
+            "props": Object {
1934
+              "enabled": false,
1935
+              "name": "Yes",
1936
+              "onPress": [Function],
1937
+              "style": Object {
1938
+                "flex": 1,
1939
+              },
1940
+            },
1941
+            "ref": null,
1942
+            "rendered": null,
1943
+            "type": [Function],
1944
+          },
1945
+          Object {
1946
+            "instance": null,
1947
+            "key": undefined,
1948
+            "nodeType": "function",
1949
+            "props": Object {
1950
+              "enabled": false,
1951
+              "name": "No",
1952
+              "onPress": [Function],
1953
+              "style": Object {
1954
+                "flex": 1,
1955
+              },
1956
+            },
1957
+            "ref": null,
1958
+            "rendered": null,
1959
+            "type": [Function],
1960
+          },
1961
+        ],
1794 1962
         "type": [Function],
1795 1963
       },
1796 1964
       Object {
@@ -1929,18 +2097,34 @@ ShallowWrapper {
1929 2097
               />
1930 2098
             </View>
1931 2099
           </ScrollViewMock>,
1932
-          <Button
1933
-            enabled={false}
1934
-            name="Yes"
1935
-            onPress={[Function]}
1936
-            style={Object {}}
1937
-          />,
1938
-          <Button
1939
-            enabled={false}
1940
-            name="No"
1941
-            onPress={[Function]}
1942
-            style={Object {}}
1943
-          />,
2100
+          <View
2101
+            style={
2102
+              Object {
2103
+                "flexDirection": "row",
2104
+              }
2105
+            }
2106
+          >
2107
+            <Button
2108
+              enabled={false}
2109
+              name="Yes"
2110
+              onPress={[Function]}
2111
+              style={
2112
+                Object {
2113
+                  "flex": 1,
2114
+                }
2115
+              }
2116
+            />
2117
+            <Button
2118
+              enabled={false}
2119
+              name="No"
2120
+              onPress={[Function]}
2121
+              style={
2122
+                Object {
2123
+                  "flex": 1,
2124
+                }
2125
+              }
2126
+            />
2127
+          </View>,
1944 2128
           <Text
1945 2129
             accessible={true}
1946 2130
             allowFontScaling={true}
@@ -2335,29 +2519,69 @@ ShallowWrapper {
2335 2519
         Object {
2336 2520
           "instance": null,
2337 2521
           "key": undefined,
2338
-          "nodeType": "function",
2339
-          "props": Object {
2340
-            "enabled": false,
2341
-            "name": "Yes",
2342
-            "onPress": [Function],
2343
-            "style": Object {},
2344
-          },
2345
-          "ref": null,
2346
-          "rendered": null,
2347
-          "type": [Function],
2348
-        },
2349
-        Object {
2350
-          "instance": null,
2351
-          "key": undefined,
2352
-          "nodeType": "function",
2522
+          "nodeType": "class",
2353 2523
           "props": Object {
2354
-            "enabled": false,
2355
-            "name": "No",
2356
-            "onPress": [Function],
2357
-            "style": Object {},
2524
+            "children": Array [
2525
+              <Button
2526
+                enabled={false}
2527
+                name="Yes"
2528
+                onPress={[Function]}
2529
+                style={
2530
+                  Object {
2531
+                    "flex": 1,
2532
+                  }
2533
+                }
2534
+              />,
2535
+              <Button
2536
+                enabled={false}
2537
+                name="No"
2538
+                onPress={[Function]}
2539
+                style={
2540
+                  Object {
2541
+                    "flex": 1,
2542
+                  }
2543
+                }
2544
+              />,
2545
+            ],
2546
+            "style": Object {
2547
+              "flexDirection": "row",
2548
+            },
2358 2549
           },
2359 2550
           "ref": null,
2360
-          "rendered": null,
2551
+          "rendered": Array [
2552
+            Object {
2553
+              "instance": null,
2554
+              "key": undefined,
2555
+              "nodeType": "function",
2556
+              "props": Object {
2557
+                "enabled": false,
2558
+                "name": "Yes",
2559
+                "onPress": [Function],
2560
+                "style": Object {
2561
+                  "flex": 1,
2562
+                },
2563
+              },
2564
+              "ref": null,
2565
+              "rendered": null,
2566
+              "type": [Function],
2567
+            },
2568
+            Object {
2569
+              "instance": null,
2570
+              "key": undefined,
2571
+              "nodeType": "function",
2572
+              "props": Object {
2573
+                "enabled": false,
2574
+                "name": "No",
2575
+                "onPress": [Function],
2576
+                "style": Object {
2577
+                  "flex": 1,
2578
+                },
2579
+              },
2580
+              "ref": null,
2581
+              "rendered": null,
2582
+              "type": [Function],
2583
+            },
2584
+          ],
2361 2585
           "type": [Function],
2362 2586
         },
2363 2587
         Object {