Browse Source

feat(rn,ui) introduce react-native-paper

master
Calinteodor 3 years ago
parent
commit
07eb19b98a
No account linked to committer's email address

+ 9
- 0
babel.config.js View File

@@ -0,0 +1,9 @@
1
+module.exports = {
2
+    presets: [ 'module:metro-react-native-babel-preset' ],
3
+    env: {
4
+        production: {
5
+            plugins: [ 'react-native-paper/babel' ]
6
+        }
7
+    },
8
+    plugins: [ 'optional-require' ]
9
+};

+ 319
- 130
package-lock.json View File

@@ -450,20 +450,22 @@
450 450
       }
451 451
     },
452 452
     "@babel/core": {
453
-      "version": "7.5.5",
454
-      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.5.5.tgz",
455
-      "integrity": "sha512-i4qoSr2KTtce0DmkuuQBV4AuQgGPUcPXMr9L5MyYAtk06z068lQ10a4O009fe5OB/DfNV+h+qqT7ddNV8UnRjg==",
456
-      "requires": {
457
-        "@babel/code-frame": "^7.5.5",
458
-        "@babel/generator": "^7.5.5",
459
-        "@babel/helpers": "^7.5.5",
460
-        "@babel/parser": "^7.5.5",
461
-        "@babel/template": "^7.4.4",
462
-        "@babel/traverse": "^7.5.5",
463
-        "@babel/types": "^7.5.5",
464
-        "convert-source-map": "^1.1.0",
453
+      "version": "7.9.0",
454
+      "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.9.0.tgz",
455
+      "integrity": "sha512-kWc7L0fw1xwvI0zi8OKVBuxRVefwGOrKSQMvrQ3dW+bIIavBY3/NpXmpjMy7bQnLgwgzWQZ8TlM57YHpHNHz4w==",
456
+      "requires": {
457
+        "@babel/code-frame": "^7.8.3",
458
+        "@babel/generator": "^7.9.0",
459
+        "@babel/helper-module-transforms": "^7.9.0",
460
+        "@babel/helpers": "^7.9.0",
461
+        "@babel/parser": "^7.9.0",
462
+        "@babel/template": "^7.8.6",
463
+        "@babel/traverse": "^7.9.0",
464
+        "@babel/types": "^7.9.0",
465
+        "convert-source-map": "^1.7.0",
465 466
         "debug": "^4.1.0",
466
-        "json5": "^2.1.0",
467
+        "gensync": "^1.0.0-beta.1",
468
+        "json5": "^2.1.2",
467 469
         "lodash": "^4.17.13",
468 470
         "resolve": "^1.3.2",
469 471
         "semver": "^5.4.1",
@@ -471,88 +473,188 @@
471 473
       },
472 474
       "dependencies": {
473 475
         "@babel/code-frame": {
474
-          "version": "7.5.5",
475
-          "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
476
-          "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
476
+          "version": "7.12.13",
477
+          "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
478
+          "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==",
477 479
           "requires": {
478
-            "@babel/highlight": "^7.0.0"
480
+            "@babel/highlight": "^7.12.13"
479 481
           }
480 482
         },
481 483
         "@babel/generator": {
482
-          "version": "7.5.5",
483
-          "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz",
484
-          "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==",
484
+          "version": "7.14.1",
485
+          "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz",
486
+          "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==",
485 487
           "requires": {
486
-            "@babel/types": "^7.5.5",
488
+            "@babel/types": "^7.14.1",
487 489
             "jsesc": "^2.5.1",
488
-            "lodash": "^4.17.13",
489
-            "source-map": "^0.5.0",
490
-            "trim-right": "^1.0.1"
490
+            "source-map": "^0.5.0"
491
+          }
492
+        },
493
+        "@babel/helper-function-name": {
494
+          "version": "7.12.13",
495
+          "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz",
496
+          "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==",
497
+          "requires": {
498
+            "@babel/helper-get-function-arity": "^7.12.13",
499
+            "@babel/template": "^7.12.13",
500
+            "@babel/types": "^7.12.13"
501
+          }
502
+        },
503
+        "@babel/helper-get-function-arity": {
504
+          "version": "7.12.13",
505
+          "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz",
506
+          "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==",
507
+          "requires": {
508
+            "@babel/types": "^7.12.13"
509
+          }
510
+        },
511
+        "@babel/helper-member-expression-to-functions": {
512
+          "version": "7.13.12",
513
+          "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.13.12.tgz",
514
+          "integrity": "sha512-48ql1CLL59aKbU94Y88Xgb2VFy7a95ykGRbJJaaVv+LX5U8wFpLfiGXJJGUozsmA1oEh/o5Bp60Voq7ACyA/Sw==",
515
+          "requires": {
516
+            "@babel/types": "^7.13.12"
517
+          }
518
+        },
519
+        "@babel/helper-module-imports": {
520
+          "version": "7.13.12",
521
+          "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.13.12.tgz",
522
+          "integrity": "sha512-4cVvR2/1B693IuOvSI20xqqa/+bl7lqAMR59R4iu39R9aOX8/JoYY1sFaNvUMyMBGnHdwvJgUrzNLoUZxXypxA==",
523
+          "requires": {
524
+            "@babel/types": "^7.13.12"
525
+          }
526
+        },
527
+        "@babel/helper-module-transforms": {
528
+          "version": "7.14.0",
529
+          "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.0.tgz",
530
+          "integrity": "sha512-L40t9bxIuGOfpIGA3HNkJhU9qYrf4y5A5LUSw7rGMSn+pcG8dfJ0g6Zval6YJGd2nEjI7oP00fRdnhLKndx6bw==",
531
+          "requires": {
532
+            "@babel/helper-module-imports": "^7.13.12",
533
+            "@babel/helper-replace-supers": "^7.13.12",
534
+            "@babel/helper-simple-access": "^7.13.12",
535
+            "@babel/helper-split-export-declaration": "^7.12.13",
536
+            "@babel/helper-validator-identifier": "^7.14.0",
537
+            "@babel/template": "^7.12.13",
538
+            "@babel/traverse": "^7.14.0",
539
+            "@babel/types": "^7.14.0"
540
+          }
541
+        },
542
+        "@babel/helper-optimise-call-expression": {
543
+          "version": "7.12.13",
544
+          "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.12.13.tgz",
545
+          "integrity": "sha512-BdWQhoVJkp6nVjB7nkFWcn43dkprYauqtk++Py2eaf/GRDFm5BxRqEIZCiHlZUGAVmtwKcsVL1dC68WmzeFmiA==",
546
+          "requires": {
547
+            "@babel/types": "^7.12.13"
548
+          }
549
+        },
550
+        "@babel/helper-replace-supers": {
551
+          "version": "7.13.12",
552
+          "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.13.12.tgz",
553
+          "integrity": "sha512-Gz1eiX+4yDO8mT+heB94aLVNCL+rbuT2xy4YfyNqu8F+OI6vMvJK891qGBTqL9Uc8wxEvRW92Id6G7sDen3fFw==",
554
+          "requires": {
555
+            "@babel/helper-member-expression-to-functions": "^7.13.12",
556
+            "@babel/helper-optimise-call-expression": "^7.12.13",
557
+            "@babel/traverse": "^7.13.0",
558
+            "@babel/types": "^7.13.12"
559
+          }
560
+        },
561
+        "@babel/helper-simple-access": {
562
+          "version": "7.13.12",
563
+          "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.13.12.tgz",
564
+          "integrity": "sha512-7FEjbrx5SL9cWvXioDbnlYTppcZGuCY6ow3/D5vMggb2Ywgu4dMrpTJX0JdQAIcRRUElOIxF3yEooa9gUb9ZbA==",
565
+          "requires": {
566
+            "@babel/types": "^7.13.12"
491 567
           }
492 568
         },
493 569
         "@babel/helper-split-export-declaration": {
494
-          "version": "7.4.4",
495
-          "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz",
496
-          "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==",
570
+          "version": "7.12.13",
571
+          "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz",
572
+          "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==",
497 573
           "requires": {
498
-            "@babel/types": "^7.4.4"
574
+            "@babel/types": "^7.12.13"
575
+          }
576
+        },
577
+        "@babel/helper-validator-identifier": {
578
+          "version": "7.14.0",
579
+          "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
580
+          "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A=="
581
+        },
582
+        "@babel/highlight": {
583
+          "version": "7.14.0",
584
+          "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz",
585
+          "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==",
586
+          "requires": {
587
+            "@babel/helper-validator-identifier": "^7.14.0",
588
+            "chalk": "^2.0.0",
589
+            "js-tokens": "^4.0.0"
499 590
           }
500 591
         },
501 592
         "@babel/parser": {
502
-          "version": "7.5.5",
503
-          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz",
504
-          "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g=="
593
+          "version": "7.14.1",
594
+          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz",
595
+          "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q=="
505 596
         },
506 597
         "@babel/template": {
507
-          "version": "7.4.4",
508
-          "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz",
509
-          "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==",
598
+          "version": "7.12.13",
599
+          "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz",
600
+          "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==",
510 601
           "requires": {
511
-            "@babel/code-frame": "^7.0.0",
512
-            "@babel/parser": "^7.4.4",
513
-            "@babel/types": "^7.4.4"
602
+            "@babel/code-frame": "^7.12.13",
603
+            "@babel/parser": "^7.12.13",
604
+            "@babel/types": "^7.12.13"
514 605
           }
515 606
         },
516 607
         "@babel/traverse": {
517
-          "version": "7.5.5",
518
-          "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz",
519
-          "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==",
520
-          "requires": {
521
-            "@babel/code-frame": "^7.5.5",
522
-            "@babel/generator": "^7.5.5",
523
-            "@babel/helper-function-name": "^7.1.0",
524
-            "@babel/helper-split-export-declaration": "^7.4.4",
525
-            "@babel/parser": "^7.5.5",
526
-            "@babel/types": "^7.5.5",
608
+          "version": "7.14.0",
609
+          "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz",
610
+          "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==",
611
+          "requires": {
612
+            "@babel/code-frame": "^7.12.13",
613
+            "@babel/generator": "^7.14.0",
614
+            "@babel/helper-function-name": "^7.12.13",
615
+            "@babel/helper-split-export-declaration": "^7.12.13",
616
+            "@babel/parser": "^7.14.0",
617
+            "@babel/types": "^7.14.0",
527 618
             "debug": "^4.1.0",
528
-            "globals": "^11.1.0",
529
-            "lodash": "^4.17.13"
619
+            "globals": "^11.1.0"
530 620
           }
531 621
         },
532 622
         "@babel/types": {
533
-          "version": "7.5.5",
534
-          "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz",
535
-          "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==",
623
+          "version": "7.14.1",
624
+          "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz",
625
+          "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==",
536 626
           "requires": {
537
-            "esutils": "^2.0.2",
538
-            "lodash": "^4.17.13",
627
+            "@babel/helper-validator-identifier": "^7.14.0",
539 628
             "to-fast-properties": "^2.0.0"
540 629
           }
541 630
         },
631
+        "convert-source-map": {
632
+          "version": "1.7.0",
633
+          "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz",
634
+          "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==",
635
+          "requires": {
636
+            "safe-buffer": "~5.1.1"
637
+          }
638
+        },
542 639
         "debug": {
543
-          "version": "4.1.1",
544
-          "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
545
-          "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
640
+          "version": "4.3.1",
641
+          "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
642
+          "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
546 643
           "requires": {
547
-            "ms": "^2.1.1"
644
+            "ms": "2.1.2"
548 645
           }
549 646
         },
647
+        "js-tokens": {
648
+          "version": "4.0.0",
649
+          "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
650
+          "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
651
+        },
550 652
         "json5": {
551
-          "version": "2.1.0",
552
-          "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.0.tgz",
553
-          "integrity": "sha512-8Mh9h6xViijj36g7Dxi+Y4S6hNGV96vcJZr/SrlHh1LR/pEn/8j/+qIBbs44YKl69Lrfctp4QD+AdWLTMqEZAQ==",
653
+          "version": "2.2.0",
654
+          "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz",
655
+          "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==",
554 656
           "requires": {
555
-            "minimist": "^1.2.0"
657
+            "minimist": "^1.2.5"
556 658
           }
557 659
         },
558 660
         "ms": {
@@ -901,94 +1003,126 @@
901 1003
       }
902 1004
     },
903 1005
     "@babel/helpers": {
904
-      "version": "7.5.5",
905
-      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.5.5.tgz",
906
-      "integrity": "sha512-nRq2BUhxZFnfEn/ciJuhklHvFOqjJUD5wpx+1bxUF2axL9C+v4DE/dmp5sT2dKnpOs4orZWzpAZqlCy8QqE/7g==",
1006
+      "version": "7.14.0",
1007
+      "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.0.tgz",
1008
+      "integrity": "sha512-+ufuXprtQ1D1iZTO/K9+EBRn+qPWMJjZSw/S0KlFrxCw4tkrzv9grgpDHkY9MeQTjTY8i2sp7Jep8DfU6tN9Mg==",
907 1009
       "requires": {
908
-        "@babel/template": "^7.4.4",
909
-        "@babel/traverse": "^7.5.5",
910
-        "@babel/types": "^7.5.5"
1010
+        "@babel/template": "^7.12.13",
1011
+        "@babel/traverse": "^7.14.0",
1012
+        "@babel/types": "^7.14.0"
911 1013
       },
912 1014
       "dependencies": {
1015
+        "@babel/code-frame": {
1016
+          "version": "7.12.13",
1017
+          "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz",
1018
+          "integrity": "sha512-HV1Cm0Q3ZrpCR93tkWOYiuYIgLxZXZFVG2VgK+MBWjUqZTundupbfx2aXarXuw5Ko5aMcjtJgbSs4vUGBS5v6g==",
1019
+          "requires": {
1020
+            "@babel/highlight": "^7.12.13"
1021
+          }
1022
+        },
913 1023
         "@babel/generator": {
914
-          "version": "7.5.5",
915
-          "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.5.5.tgz",
916
-          "integrity": "sha512-ETI/4vyTSxTzGnU2c49XHv2zhExkv9JHLTwDAFz85kmcwuShvYG2H08FwgIguQf4JC75CBnXAUM5PqeF4fj0nQ==",
1024
+          "version": "7.14.1",
1025
+          "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.1.tgz",
1026
+          "integrity": "sha512-TMGhsXMXCP/O1WtQmZjpEYDhCYC9vFhayWZPJSZCGkPJgUqX0rF0wwtrYvnzVxIjcF80tkUertXVk5cwqi5cAQ==",
917 1027
           "requires": {
918
-            "@babel/types": "^7.5.5",
1028
+            "@babel/types": "^7.14.1",
919 1029
             "jsesc": "^2.5.1",
920
-            "lodash": "^4.17.13",
921
-            "source-map": "^0.5.0",
922
-            "trim-right": "^1.0.1"
1030
+            "source-map": "^0.5.0"
1031
+          }
1032
+        },
1033
+        "@babel/helper-function-name": {
1034
+          "version": "7.12.13",
1035
+          "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.12.13.tgz",
1036
+          "integrity": "sha512-TZvmPn0UOqmvi5G4vvw0qZTpVptGkB1GL61R6lKvrSdIxGm5Pky7Q3fpKiIkQCAtRCBUwB0PaThlx9vebCDSwA==",
1037
+          "requires": {
1038
+            "@babel/helper-get-function-arity": "^7.12.13",
1039
+            "@babel/template": "^7.12.13",
1040
+            "@babel/types": "^7.12.13"
1041
+          }
1042
+        },
1043
+        "@babel/helper-get-function-arity": {
1044
+          "version": "7.12.13",
1045
+          "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.12.13.tgz",
1046
+          "integrity": "sha512-DjEVzQNz5LICkzN0REdpD5prGoidvbdYk1BVgRUOINaWJP2t6avB27X1guXK1kXNrX0WMfsrm1A/ZBthYuIMQg==",
1047
+          "requires": {
1048
+            "@babel/types": "^7.12.13"
923 1049
           }
924 1050
         },
925 1051
         "@babel/helper-split-export-declaration": {
926
-          "version": "7.4.4",
927
-          "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz",
928
-          "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==",
1052
+          "version": "7.12.13",
1053
+          "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.12.13.tgz",
1054
+          "integrity": "sha512-tCJDltF83htUtXx5NLcaDqRmknv652ZWCHyoTETf1CXYJdPC7nohZohjUgieXhv0hTJdRf2FjDueFehdNucpzg==",
929 1055
           "requires": {
930
-            "@babel/types": "^7.4.4"
1056
+            "@babel/types": "^7.12.13"
1057
+          }
1058
+        },
1059
+        "@babel/helper-validator-identifier": {
1060
+          "version": "7.14.0",
1061
+          "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.0.tgz",
1062
+          "integrity": "sha512-V3ts7zMSu5lfiwWDVWzRDGIN+lnCEUdaXgtVHJgLb1rGaA6jMrtB9EmE7L18foXJIE8Un/A/h6NJfGQp/e1J4A=="
1063
+        },
1064
+        "@babel/highlight": {
1065
+          "version": "7.14.0",
1066
+          "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.14.0.tgz",
1067
+          "integrity": "sha512-YSCOwxvTYEIMSGaBQb5kDDsCopDdiUGsqpatp3fOlI4+2HQSkTmEVWnVuySdAC5EWCqSWWTv0ib63RjR7dTBdg==",
1068
+          "requires": {
1069
+            "@babel/helper-validator-identifier": "^7.14.0",
1070
+            "chalk": "^2.0.0",
1071
+            "js-tokens": "^4.0.0"
931 1072
           }
932 1073
         },
933 1074
         "@babel/parser": {
934
-          "version": "7.5.5",
935
-          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.5.5.tgz",
936
-          "integrity": "sha512-E5BN68cqR7dhKan1SfqgPGhQ178bkVKpXTPEXnFJBrEt8/DKRZlybmy+IgYLTeN7tp1R5Ccmbm2rBk17sHYU3g=="
1075
+          "version": "7.14.1",
1076
+          "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.1.tgz",
1077
+          "integrity": "sha512-muUGEKu8E/ftMTPlNp+mc6zL3E9zKWmF5sDHZ5MSsoTP9Wyz64AhEf9kD08xYJ7w6Hdcu8H550ircnPyWSIF0Q=="
937 1078
         },
938 1079
         "@babel/template": {
939
-          "version": "7.4.4",
940
-          "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz",
941
-          "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==",
1080
+          "version": "7.12.13",
1081
+          "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.12.13.tgz",
1082
+          "integrity": "sha512-/7xxiGA57xMo/P2GVvdEumr8ONhFOhfgq2ihK3h1e6THqzTAkHbkXgB0xI9yeTfIUoH3+oAeHhqm/I43OTbbjA==",
942 1083
           "requires": {
943
-            "@babel/code-frame": "^7.0.0",
944
-            "@babel/parser": "^7.4.4",
945
-            "@babel/types": "^7.4.4"
1084
+            "@babel/code-frame": "^7.12.13",
1085
+            "@babel/parser": "^7.12.13",
1086
+            "@babel/types": "^7.12.13"
946 1087
           }
947 1088
         },
948 1089
         "@babel/traverse": {
949
-          "version": "7.5.5",
950
-          "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.5.5.tgz",
951
-          "integrity": "sha512-MqB0782whsfffYfSjH4TM+LMjrJnhCNEDMDIjeTpl+ASaUvxcjoiVCo/sM1GhS1pHOXYfWVCYneLjMckuUxDaQ==",
952
-          "requires": {
953
-            "@babel/code-frame": "^7.5.5",
954
-            "@babel/generator": "^7.5.5",
955
-            "@babel/helper-function-name": "^7.1.0",
956
-            "@babel/helper-split-export-declaration": "^7.4.4",
957
-            "@babel/parser": "^7.5.5",
958
-            "@babel/types": "^7.5.5",
1090
+          "version": "7.14.0",
1091
+          "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.0.tgz",
1092
+          "integrity": "sha512-dZ/a371EE5XNhTHomvtuLTUyx6UEoJmYX+DT5zBCQN3McHemsuIaKKYqsc/fs26BEkHs/lBZy0J571LP5z9kQA==",
1093
+          "requires": {
1094
+            "@babel/code-frame": "^7.12.13",
1095
+            "@babel/generator": "^7.14.0",
1096
+            "@babel/helper-function-name": "^7.12.13",
1097
+            "@babel/helper-split-export-declaration": "^7.12.13",
1098
+            "@babel/parser": "^7.14.0",
1099
+            "@babel/types": "^7.14.0",
959 1100
             "debug": "^4.1.0",
960
-            "globals": "^11.1.0",
961
-            "lodash": "^4.17.13"
962
-          },
963
-          "dependencies": {
964
-            "@babel/code-frame": {
965
-              "version": "7.5.5",
966
-              "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz",
967
-              "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==",
968
-              "requires": {
969
-                "@babel/highlight": "^7.0.0"
970
-              }
971
-            }
1101
+            "globals": "^11.1.0"
972 1102
           }
973 1103
         },
974 1104
         "@babel/types": {
975
-          "version": "7.5.5",
976
-          "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.5.5.tgz",
977
-          "integrity": "sha512-s63F9nJioLqOlW3UkyMd+BYhXt44YuaFm/VV0VwuteqjYwRrObkU7ra9pY4wAJR3oXi8hJrMcrcJdO/HH33vtw==",
1105
+          "version": "7.14.1",
1106
+          "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.1.tgz",
1107
+          "integrity": "sha512-S13Qe85fzLs3gYRUnrpyeIrBJIMYv33qSTg1qoBwiG6nPKwUWAD9odSzWhEedpwOIzSEI6gbdQIWEMiCI42iBA==",
978 1108
           "requires": {
979
-            "esutils": "^2.0.2",
980
-            "lodash": "^4.17.13",
1109
+            "@babel/helper-validator-identifier": "^7.14.0",
981 1110
             "to-fast-properties": "^2.0.0"
982 1111
           }
983 1112
         },
984 1113
         "debug": {
985
-          "version": "4.1.1",
986
-          "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz",
987
-          "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
1114
+          "version": "4.3.1",
1115
+          "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz",
1116
+          "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==",
988 1117
           "requires": {
989
-            "ms": "^2.1.1"
1118
+            "ms": "2.1.2"
990 1119
           }
991 1120
         },
1121
+        "js-tokens": {
1122
+          "version": "4.0.0",
1123
+          "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
1124
+          "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
1125
+        },
992 1126
         "ms": {
993 1127
           "version": "2.1.2",
994 1128
           "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz",
@@ -1851,18 +1985,11 @@
1851 1985
       }
1852 1986
     },
1853 1987
     "@babel/runtime": {
1854
-      "version": "7.5.5",
1855
-      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.5.5.tgz",
1856
-      "integrity": "sha512-28QvEGyQyNkB0/m2B4FU7IEZGK2NUrcMtT6BZEFALTguLk+AUT6ofsHtPk5QyjAdUkpMJ+/Em+quwz4HOt30AQ==",
1988
+      "version": "7.9.0",
1989
+      "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.9.0.tgz",
1990
+      "integrity": "sha512-cTIudHnzuWLS56ik4DnRnqqNf8MkdUzV4iFFI1h7Jo9xvrpQROYaAnaSd2mHLQAzzZAPfATynX5ord6YlNYNMA==",
1857 1991
       "requires": {
1858
-        "regenerator-runtime": "^0.13.2"
1859
-      },
1860
-      "dependencies": {
1861
-        "regenerator-runtime": {
1862
-          "version": "0.13.3",
1863
-          "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz",
1864
-          "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw=="
1865
-        }
1992
+        "regenerator-runtime": "^0.13.4"
1866 1993
       }
1867 1994
     },
1868 1995
     "@babel/template": {
@@ -1938,6 +2065,15 @@
1938 2065
         }
1939 2066
       }
1940 2067
     },
2068
+    "@callstack/react-theme-provider": {
2069
+      "version": "3.0.6",
2070
+      "resolved": "https://registry.npmjs.org/@callstack/react-theme-provider/-/react-theme-provider-3.0.6.tgz",
2071
+      "integrity": "sha512-wwKMXfmklfogpalNZT0W+jh76BIquiYUiQHOaPmt/PCyCEP/E6rP+e7Uie6mBZrfkea9WJYJ+mus6r+45JAEhg==",
2072
+      "requires": {
2073
+        "deepmerge": "^3.2.0",
2074
+        "hoist-non-react-statics": "^3.3.0"
2075
+      }
2076
+    },
1941 2077
     "@cnakazawa/watch": {
1942 2078
       "version": "1.0.4",
1943 2079
       "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.4.tgz",
@@ -5277,6 +5413,39 @@
5277 5413
         }
5278 5414
       }
5279 5415
     },
5416
+    "babel-plugin-optional-require": {
5417
+      "version": "0.3.1",
5418
+      "resolved": "https://registry.npmjs.org/babel-plugin-optional-require/-/babel-plugin-optional-require-0.3.1.tgz",
5419
+      "integrity": "sha512-qL9pdz6fgMjO3NZ1igO8BEJrWooLgkuhJ2yc4ligr3lMvEq7tzFZuz3JWSa6P05khrvTz1USf0POkxAjlFnkLw==",
5420
+      "dev": true,
5421
+      "requires": {
5422
+        "is-builtin-module": "^2.0.0",
5423
+        "resolve-from": "^4.0.0"
5424
+      },
5425
+      "dependencies": {
5426
+        "builtin-modules": {
5427
+          "version": "2.0.0",
5428
+          "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-2.0.0.tgz",
5429
+          "integrity": "sha512-3U5kUA5VPsRUA3nofm/BXX7GVHKfxz0hOBAPxXrIvHzlDRkQVqEn6yi8QJegxl4LzOHLdvb7XF5dVawa/VVYBg==",
5430
+          "dev": true
5431
+        },
5432
+        "is-builtin-module": {
5433
+          "version": "2.0.0",
5434
+          "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-2.0.0.tgz",
5435
+          "integrity": "sha512-G2jLHphOywpgrL/AaJKWDXpdpGR9X4V1PCkB+EwG5Z28z8EukgdWnAUFAS2wdBtIpwHhHBIiq0NBOWEbSXN0Rg==",
5436
+          "dev": true,
5437
+          "requires": {
5438
+            "builtin-modules": "^2.0.0"
5439
+          }
5440
+        },
5441
+        "resolve-from": {
5442
+          "version": "4.0.0",
5443
+          "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz",
5444
+          "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==",
5445
+          "dev": true
5446
+        }
5447
+      }
5448
+    },
5280 5449
     "babel-plugin-syntax-jsx": {
5281 5450
       "version": "6.18.0",
5282 5451
       "resolved": "https://registry.npmjs.org/babel-plugin-syntax-jsx/-/babel-plugin-syntax-jsx-6.18.0.tgz",
@@ -12803,6 +12972,11 @@
12803 12972
         "is-wsl": "^1.1.0"
12804 12973
       }
12805 12974
     },
12975
+    "optional-require": {
12976
+      "version": "1.0.3",
12977
+      "resolved": "https://registry.npmjs.org/optional-require/-/optional-require-1.0.3.tgz",
12978
+      "integrity": "sha512-RV2Zp2MY2aeYK5G+B/Sps8lW5NHAzE5QClbFP15j+PWmP+T9PxlJXBOOLoSAdgwFvS4t0aMR4vpedMkbHfh0nA=="
12979
+    },
12806 12980
     "optionator": {
12807 12981
       "version": "0.8.2",
12808 12982
       "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz",
@@ -14789,11 +14963,26 @@
14789 14963
       "resolved": "https://registry.npmjs.org/react-native-immersive/-/react-native-immersive-2.0.0.tgz",
14790 14964
       "integrity": "sha512-9TL05nTHN/x9sN1wbUlBoGyzH4NCuZ/7WEEUp5CvOoKuUABvdYosov0O0SAMbm/5J913RRoy98VB6tGNi9lRSw=="
14791 14965
     },
14966
+    "react-native-iphone-x-helper": {
14967
+      "version": "1.3.1",
14968
+      "resolved": "https://registry.npmjs.org/react-native-iphone-x-helper/-/react-native-iphone-x-helper-1.3.1.tgz",
14969
+      "integrity": "sha512-HOf0jzRnq2/aFUcdCJ9w9JGzN3gdEg0zFE4FyYlp4jtidqU03D5X7ZegGKfT1EWteR0gPBGp9ye5T5FvSWi9Yg=="
14970
+    },
14792 14971
     "react-native-keep-awake": {
14793 14972
       "version": "4.0.0",
14794 14973
       "resolved": "https://registry.npmjs.org/react-native-keep-awake/-/react-native-keep-awake-4.0.0.tgz",
14795 14974
       "integrity": "sha512-0Fotox+eLXQooeibVs3P60yASYUWjtRw9MZNmbuHt5UZQrgUrAKsE4jm7gTr4tPU1m1RkwGzcgUFpcOkh/ec7g=="
14796 14975
     },
14976
+    "react-native-paper": {
14977
+      "version": "4.8.1",
14978
+      "resolved": "https://registry.npmjs.org/react-native-paper/-/react-native-paper-4.8.1.tgz",
14979
+      "integrity": "sha512-WgmqrDdcrr0ZbuiLCwMpmOMhl1n8uIvNulxsl2oCGtD8oeMkPJKHf4G/ONR+iNrSXcFbJek+uDRSmcGA5kDfUA==",
14980
+      "requires": {
14981
+        "@callstack/react-theme-provider": "^3.0.5",
14982
+        "color": "^3.1.2",
14983
+        "react-native-iphone-x-helper": "^1.3.1"
14984
+      }
14985
+    },
14797 14986
     "react-native-sound": {
14798 14987
       "version": "github:jitsi/react-native-sound#3fe5480fce935e888d5089d94a191c7c7e3aa190",
14799 14988
       "from": "github:jitsi/react-native-sound#3fe5480fce935e888d5089d94a191c7c7e3aa190"

+ 5
- 2
package.json View File

@@ -60,6 +60,7 @@
60 60
     "moment": "2.29.1",
61 61
     "moment-duration-format": "2.2.2",
62 62
     "olm": "https://packages.matrix.org/npm/olm/olm-3.2.1.tgz",
63
+    "optional-require": "1.0.3",
63 64
     "pixelmatch": "5.1.0",
64 65
     "promise.allsettled": "1.0.4",
65 66
     "punycode": "2.1.1",
@@ -77,6 +78,7 @@
77 78
     "react-native-device-info": "8.0.0",
78 79
     "react-native-immersive": "2.0.0",
79 80
     "react-native-keep-awake": "4.0.0",
81
+    "react-native-paper": "4.8.1",
80 82
     "react-native-sound": "github:jitsi/react-native-sound#3fe5480fce935e888d5089d94a191c7c7e3aa190",
81 83
     "react-native-splash-screen": "3.2.0",
82 84
     "react-native-svg": "12.1.0",
@@ -102,7 +104,7 @@
102 104
     "zxcvbn": "4.4.2"
103 105
   },
104 106
   "devDependencies": {
105
-    "@babel/core": "7.5.5",
107
+    "@babel/core": "7.9.0",
106 108
     "@babel/plugin-proposal-class-properties": "7.1.0",
107 109
     "@babel/plugin-proposal-export-default-from": "7.0.0",
108 110
     "@babel/plugin-proposal-export-namespace-from": "7.0.0",
@@ -112,9 +114,10 @@
112 114
     "@babel/preset-env": "7.1.0",
113 115
     "@babel/preset-flow": "7.0.0",
114 116
     "@babel/preset-react": "7.0.0",
115
-    "@babel/runtime": "7.5.5",
117
+    "@babel/runtime": "7.9.0",
116 118
     "babel-eslint": "10.0.1",
117 119
     "babel-loader": "8.0.4",
120
+    "babel-plugin-optional-require": "0.3.1",
118 121
     "circular-dependency-plugin": "5.2.0",
119 122
     "clean-css-cli": "4.3.0",
120 123
     "css-loader": "3.6.0",

+ 7
- 4
react/features/app/components/App.native.js View File

@@ -11,6 +11,7 @@ import { getFeatureFlag } from '../../base/flags/functions';
11 11
 import { Platform } from '../../base/react';
12 12
 import { DimensionsDetector, clientResized } from '../../base/responsive-ui';
13 13
 import { updateSettings } from '../../base/settings';
14
+import JitsiThemePaperProvider from '../../base/ui/components/JitsiThemeProvider.native';
14 15
 import logger from '../logger';
15 16
 
16 17
 import { AbstractApp } from './AbstractApp';
@@ -127,10 +128,12 @@ export class App extends AbstractApp {
127 128
      */
128 129
     _createMainElement(component, props) {
129 130
         return (
130
-            <DimensionsDetector
131
-                onDimensionsChanged = { this._onDimensionsChanged }>
132
-                { super._createMainElement(component, props) }
133
-            </DimensionsDetector>
131
+            <JitsiThemePaperProvider>
132
+                <DimensionsDetector
133
+                    onDimensionsChanged = { this._onDimensionsChanged }>
134
+                    { super._createMainElement(component, props) }
135
+                </DimensionsDetector>
136
+            </JitsiThemePaperProvider>
134 137
         );
135 138
     }
136 139
 

+ 11
- 2
react/features/base/ui/Tokens.js View File

@@ -1,6 +1,6 @@
1 1
 // @flow
2 2
 
3
-// Default color pallete
3
+// Default color palette
4 4
 export const colors = {
5 5
     error03: '#7A141F',
6 6
     error04: '#A21B29',
@@ -157,6 +157,15 @@ export const colorMap = {
157 157
     // Disabled background for high-contrast input fields
158 158
     field02Disabled: 'surface06',
159 159
 
160
+    // Background for section header
161
+    section01: 'surface10',
162
+
163
+    // Active color for section header
164
+    section01Active: 'primary04',
165
+
166
+    // Inactive color for section header
167
+    section01Inactive: 'surface01',
168
+
160 169
     // Borders
161 170
     // Border for the input fields in hover state
162 171
     border01: 'surface08',
@@ -184,7 +193,7 @@ export const colorMap = {
184 193
     // Color for positive messages applied to icons & borders
185 194
     success01: 'success05',
186 195
 
187
-    // Color for positive messages applied tobackgrounds
196
+    // Color for positive messages applied to backgrounds
188 197
     success02: 'success05',
189 198
 
190 199
     // Color for warning messages applied to icons, borders & backgrounds

+ 13
- 0
react/features/base/ui/components/BaseTheme.native.js View File

@@ -0,0 +1,13 @@
1
+// @flow
2
+
3
+import { font, colors, colorMap, spacing, shape, typography } from '../Tokens';
4
+import { createNativeTheme } from '../functions.native';
5
+
6
+export default createNativeTheme({
7
+    font,
8
+    colors,
9
+    colorMap,
10
+    spacing,
11
+    shape,
12
+    typography
13
+});

+ 24
- 0
react/features/base/ui/components/JitsiThemeProvider.native.js View File

@@ -0,0 +1,24 @@
1
+// @flow
2
+
3
+import * as React from 'react';
4
+import { Provider as PaperProvider } from 'react-native-paper';
5
+
6
+import BaseTheme from './BaseTheme.native';
7
+
8
+type Props = {
9
+
10
+   /**
11
+    * The children of the component.
12
+    */
13
+    children: React.ChildrenArray<any>
14
+}
15
+
16
+/**
17
+ * The theme provider for the mobile app.
18
+ *
19
+ * @param {Object} props - The props of the component.
20
+ * @returns {React.ReactNode}
21
+ */
22
+export default function JitsiThemePaperProvider(props: Props) {
23
+    return <PaperProvider theme = { BaseTheme }>{ props.children }</PaperProvider>;
24
+}

+ 24
- 0
react/features/base/ui/functions.native.js View File

@@ -0,0 +1,24 @@
1
+// @flow
2
+
3
+import { DefaultTheme } from 'react-native-paper';
4
+
5
+import { createColorTokens } from './utils';
6
+
7
+/**
8
+ * Creates a React Native Paper theme based on local UI tokens.
9
+ *
10
+ * @param {Object} arg - The ui tokens.
11
+ * @returns {Object}
12
+ */
13
+export function createNativeTheme({ font, colors, colorMap, shape, spacing, typography }: Object) {
14
+    return {
15
+        ...DefaultTheme,
16
+        palette: createColorTokens(colorMap, colors),
17
+        shape,
18
+        spacing,
19
+        typography: {
20
+            font,
21
+            ...typography
22
+        }
23
+    };
24
+}

react/features/base/ui/functions.js → react/features/base/ui/functions.web.js View File

@@ -2,19 +2,7 @@
2 2
 
3 3
 import { createMuiTheme } from '@material-ui/core/styles';
4 4
 
5
-/**
6
- * Creates the color tokens based on the color theme and the association map.
7
- * If a key is not fonund in the association map it defaults to the current value.
8
- *
9
- * @param {Object} colorMap - A map between the token name and the actual color value.
10
- * @param {Object} colors - An object containing all the theme colors.
11
- * @returns {Object}
12
- */
13
-function createColorTokens(colorMap: Object, colors: Object): Object {
14
-    return Object.entries(colorMap)
15
-        .reduce((result, [ token, value ]) =>
16
-            Object.assign(result, { [token]: colors[value] || value }), {});
17
-}
5
+import { createColorTokens } from './utils';
18 6
 
19 7
 /**
20 8
  * Creates a MUI theme based on local UI tokens.

+ 15
- 0
react/features/base/ui/utils.js View File

@@ -0,0 +1,15 @@
1
+// @flow
2
+
3
+/**
4
+ * Creates the color tokens based on the color theme and the association map.
5
+ * If a key is not found in the association map it defaults to the current value.
6
+ *
7
+ * @param {Object} colorMap - A map between the token name and the actual color value.
8
+ * @param {Object} colors - An object containing all the theme colors.
9
+ * @returns {Object}
10
+ */
11
+export function createColorTokens(colorMap: Object, colors: Object): Object {
12
+    return Object.entries(colorMap)
13
+        .reduce((result, [ token, value ]) =>
14
+            Object.assign(result, { [token]: colors[value] || value }), {});
15
+}

+ 87
- 0
react/features/settings/components/native/FormSectionAccordion.js View File

@@ -0,0 +1,87 @@
1
+// @flow
2
+
3
+import React, { useState } from 'react';
4
+import { List } from 'react-native-paper';
5
+
6
+import { translate } from '../../../base/i18n';
7
+import { Icon, IconArrowDown, IconArrowUp } from '../../../base/icons';
8
+
9
+import styles from './styles';
10
+
11
+/**
12
+ * The type of the React {@code Component} props of {@link FormSectionAccordion}
13
+ */
14
+type Props = {
15
+
16
+    /**
17
+     * Is the section an accordion or not.
18
+     */
19
+    accordion: boolean,
20
+
21
+    /**
22
+     * The children to be displayed within this Link.
23
+     */
24
+    children: React$Node,
25
+
26
+    /**
27
+     * Whether the accordion is expandable.
28
+     */
29
+    expandable: boolean,
30
+
31
+    /**
32
+     * The i18n key of the text label of the section.
33
+     */
34
+    label: string,
35
+
36
+    /**
37
+     * An external style object passed to the component.
38
+     */
39
+    style: Object,
40
+
41
+    /**
42
+     * Invoked to obtain translated strings.
43
+     */
44
+    t: Function
45
+}
46
+
47
+/**
48
+ * Section accordion on settings form.
49
+ *
50
+ * @returns {React$Element<any>}
51
+ */
52
+function FormSectionAccordion({ accordion, children, expandable, label, style, t }: Props) {
53
+    const [ expandSection, setExpandSection ] = useState(false);
54
+
55
+    /**
56
+     * Press handler for expanding form section.
57
+     *
58
+     * @returns {void}
59
+     */
60
+    function onPress() {
61
+        setExpandSection(!expandSection);
62
+    }
63
+
64
+    return (
65
+        <List.Accordion
66
+            expanded = { expandSection || !expandable }
67
+            onPress = { onPress }
68
+            /* eslint-disable-next-line react/jsx-no-bind */
69
+            right = { props =>
70
+                accordion && <Icon
71
+                    { ...props }
72
+                    src = { expandSection ? IconArrowUp : IconArrowDown }
73
+                    style = { expandSection ? styles.sectionOpen : styles.sectionClose } /> }
74
+            style = { [
75
+                styles.formSectionTitle,
76
+                style
77
+            ] }
78
+            title = { t(label) }
79
+            titleStyle = {
80
+                expandSection || !expandable
81
+                    ? styles.formSectionTitleActive : styles.formSectionTitleInActive }>
82
+            { children }
83
+        </List.Accordion>
84
+    );
85
+}
86
+
87
+export default translate(FormSectionAccordion);

+ 0
- 60
react/features/settings/components/native/FormSectionHeader.js View File

@@ -1,60 +0,0 @@
1
-// @flow
2
-
3
-import React, { Component } from 'react';
4
-import { Text, View } from 'react-native';
5
-
6
-import { translate } from '../../../base/i18n';
7
-
8
-import styles from './styles';
9
-
10
-/**
11
- * The type of the React {@code Component} props of {@link FormSectionHeader}
12
- */
13
-type Props = {
14
-
15
-    /**
16
-     * The i18n key of the text label of the section.
17
-     */
18
-    label: string,
19
-
20
-    /**
21
-     * An external style object passed to the component.
22
-     */
23
-    style: Object,
24
-
25
-    /**
26
-     * Invoked to obtain translated strings.
27
-     */
28
-    t: Function
29
-}
30
-
31
-/**
32
- * Implements a React {@code Component} which renders a section header on a
33
- * form.
34
- */
35
-class FormSectionHeader extends Component<Props> {
36
-    /**
37
-     * Implements React's {@link Component#render()}.
38
-     *
39
-     * @inheritdoc
40
-     * @override
41
-     * @returns {ReactElement}
42
-     */
43
-    render() {
44
-        const { label, style, t } = this.props;
45
-
46
-        return (
47
-            <View
48
-                style = { [
49
-                    styles.formSectionTitle,
50
-                    style
51
-                ] } >
52
-                <Text>
53
-                    { t(label) }
54
-                </Text>
55
-            </View>
56
-        );
57
-    }
58
-}
59
-
60
-export default translate(FormSectionHeader);

+ 123
- 117
react/features/settings/components/native/SettingsView.js View File

@@ -1,7 +1,8 @@
1 1
 // @flow
2 2
 
3 3
 import React from 'react';
4
-import { Alert, NativeModules, ScrollView, Switch, Text, TextInput } from 'react-native';
4
+import { Alert, NativeModules, ScrollView, Text } from 'react-native';
5
+import { Divider, Switch, TextInput, withTheme } from 'react-native-paper';
5 6
 
6 7
 import { translate } from '../../../base/i18n';
7 8
 import { JitsiModal } from '../../../base/modal';
@@ -15,7 +16,8 @@ import {
15 16
 } from '../AbstractSettingsView';
16 17
 
17 18
 import FormRow from './FormRow';
18
-import FormSectionHeader from './FormSectionHeader';
19
+import FormSectionAccordion from './FormSectionAccordion';
20
+import styles, { THUMB_COLOR } from './styles';
19 21
 
20 22
 /**
21 23
  * Application information module.
@@ -54,11 +56,6 @@ type State = {
54 56
      */
55 57
     serverURL: string,
56 58
 
57
-    /**
58
-     * Whether to show advanced settings or not.
59
-     */
60
-    showAdvanced: boolean,
61
-
62 59
     /**
63 60
      * State variable for the start with audio muted switch.
64 61
      */
@@ -67,7 +64,7 @@ type State = {
67 64
     /**
68 65
      * State variable for the start with video muted switch.
69 66
      */
70
-    startWithVideoMuted: boolean,
67
+    startWithVideoMuted: boolean
71 68
 }
72 69
 
73 70
 /**
@@ -81,7 +78,12 @@ type Props = AbstractProps & {
81 78
      *
82 79
      * @protected
83 80
      */
84
-    _serverURLChangeEnabled: boolean
81
+    _serverURLChangeEnabled: boolean,
82
+
83
+    /**
84
+     * Theme used for styles.
85
+     */
86
+    theme: Object
85 87
 }
86 88
 
87 89
 /**
@@ -117,7 +119,6 @@ class SettingsView extends AbstractSettingsView<Props, State> {
117 119
             displayName,
118 120
             email,
119 121
             serverURL,
120
-            showAdvanced: false,
121 122
             startWithAudioMuted,
122 123
             startWithVideoMuted
123 124
         };
@@ -128,7 +129,6 @@ class SettingsView extends AbstractSettingsView<Props, State> {
128 129
         this._onDisableCallIntegration = this._onDisableCallIntegration.bind(this);
129 130
         this._onDisableCrashReporting = this._onDisableCrashReporting.bind(this);
130 131
         this._onDisableP2P = this._onDisableP2P.bind(this);
131
-        this._onShowAdvanced = this._onShowAdvanced.bind(this);
132 132
         this._setURLFieldReference = this._setURLFieldReference.bind(this);
133 133
         this._showURLAlert = this._showURLAlert.bind(this);
134 134
     }
@@ -140,7 +140,17 @@ class SettingsView extends AbstractSettingsView<Props, State> {
140 140
      * @returns {ReactElement}
141 141
      */
142 142
     render() {
143
-        const { displayName, email, serverURL, startWithAudioMuted, startWithVideoMuted } = this.state;
143
+        const {
144
+            disableCallIntegration,
145
+            disableCrashReporting,
146
+            disableP2P,
147
+            displayName,
148
+            email,
149
+            serverURL,
150
+            startWithAudioMuted,
151
+            startWithVideoMuted
152
+        } = this.state;
153
+        const { palette } = this.props.theme;
144 154
 
145 155
         return (
146 156
             <JitsiModal
@@ -150,71 +160,130 @@ class SettingsView extends AbstractSettingsView<Props, State> {
150 160
                 modalId = { SETTINGS_VIEW_ID }
151 161
                 onClose = { this._onClose }>
152 162
                 <ScrollView>
153
-                    <FormSectionHeader
154
-                        label = 'settingsView.profileSection' />
155
-                    <FormRow
156
-                        fieldSeparator = { true }
157
-                        label = 'settingsView.displayName'
158
-                        layout = 'column'>
163
+                    <FormSectionAccordion
164
+                        accordion = { false }
165
+                        expandable = { false }
166
+                        label = 'settingsView.profileSection'>
159 167
                         <TextInput
160 168
                             autoCorrect = { false }
169
+                            label = { this.props.t('settingsView.displayName') }
170
+                            mode = 'outlined'
161 171
                             onChangeText = { this._onChangeDisplayName }
162 172
                             placeholder = 'John Doe'
173
+                            style = { styles.textInputContainer }
163 174
                             textContentType = { 'name' } // iOS only
175
+                            theme = {{
176
+                                colors: {
177
+                                    primary: palette.action01Active,
178
+                                    underlineColor: 'transparent'
179
+                                }
180
+                            }}
164 181
                             value = { displayName } />
165
-                    </FormRow>
166
-                    <FormRow
167
-                        label = 'settingsView.email'
168
-                        layout = 'column'>
182
+                        <Divider style = { styles.fieldSeparator } />
169 183
                         <TextInput
170 184
                             autoCapitalize = 'none'
171 185
                             autoCorrect = { false }
172 186
                             keyboardType = { 'email-address' }
187
+                            label = { this.props.t('settingsView.email') }
188
+                            mode = 'outlined'
173 189
                             onChangeText = { this._onChangeEmail }
174 190
                             placeholder = 'email@example.com'
191
+                            style = { styles.textInputContainer }
175 192
                             textContentType = { 'emailAddress' } // iOS only
193
+                            theme = {{
194
+                                colors: {
195
+                                    primary: palette.action01Active,
196
+                                    underlineColor: 'transparent'
197
+                                }
198
+                            }}
176 199
                             value = { email } />
177
-                    </FormRow>
178
-                    <FormSectionHeader
179
-                        label = 'settingsView.conferenceSection' />
180
-                    <FormRow
181
-                        fieldSeparator = { true }
182
-                        label = 'settingsView.serverURL'
183
-                        layout = 'column'>
200
+                    </FormSectionAccordion>
201
+                    <FormSectionAccordion
202
+                        accordion = { false }
203
+                        expandable = { false }
204
+                        label = 'settingsView.conferenceSection'>
184 205
                         <TextInput
185 206
                             autoCapitalize = 'none'
186 207
                             autoCorrect = { false }
187 208
                             editable = { this.props._serverURLChangeEnabled }
188 209
                             keyboardType = { 'url' }
210
+                            label = { this.props.t('settingsView.serverURL') }
211
+                            mode = 'outlined'
189 212
                             onBlur = { this._onBlurServerURL }
190 213
                             onChangeText = { this._onChangeServerURL }
191 214
                             placeholder = { this.props._serverURL }
215
+                            style = { styles.textInputContainer }
192 216
                             textContentType = { 'URL' } // iOS only
217
+                            theme = {{
218
+                                colors: {
219
+                                    primary: palette.action01Active,
220
+                                    underlineColor: 'transparent'
221
+                                }
222
+                            }}
193 223
                             value = { serverURL } />
194
-                    </FormRow>
195
-                    <FormRow
196
-                        fieldSeparator = { true }
197
-                        label = 'settingsView.startWithAudioMuted'>
198
-                        <Switch
199
-                            onValueChange = { this._onStartAudioMutedChange }
200
-                            value = { startWithAudioMuted } />
201
-                    </FormRow>
202
-                    <FormRow label = 'settingsView.startWithVideoMuted'>
203
-                        <Switch
204
-                            onValueChange = { this._onStartVideoMutedChange }
205
-                            value = { startWithVideoMuted } />
206
-                    </FormRow>
207
-                    <FormSectionHeader
208
-                        label = 'settingsView.buildInfoSection' />
209
-                    <FormRow
210
-                        label = 'settingsView.version'>
211
-                        <Text>
212
-                            {`${AppInfo.version} build ${AppInfo.buildNumber}`}
213
-                        </Text>
214
-                    </FormRow>
215
-                    <FormSectionHeader
216
-                        label = 'settingsView.advanced' />
217
-                    {this._renderAdvancedSettings()}
224
+                        <Divider style = { styles.fieldSeparator } />
225
+                        <FormRow
226
+                            label = 'settingsView.startWithAudioMuted'>
227
+                            <Switch
228
+                                onValueChange = { this._onStartAudioMutedChange }
229
+                                thumbColor = { THUMB_COLOR }
230
+                                trackColor = {{ true: palette.action01Active }}
231
+                                value = { startWithAudioMuted } />
232
+                        </FormRow>
233
+                        <Divider style = { styles.fieldSeparator } />
234
+                        <FormRow label = 'settingsView.startWithVideoMuted'>
235
+                            <Switch
236
+                                onValueChange = { this._onStartVideoMutedChange }
237
+                                thumbColor = { THUMB_COLOR }
238
+                                trackColor = {{ true: palette.action01Active }}
239
+                                value = { startWithVideoMuted } />
240
+                        </FormRow>
241
+                    </FormSectionAccordion>
242
+                    <FormSectionAccordion
243
+                        accordion = { false }
244
+                        expandable = { false }
245
+                        label = 'settingsView.buildInfoSection'>
246
+                        <FormRow
247
+                            label = 'settingsView.version'>
248
+                            <Text>
249
+                                {`${AppInfo.version} build ${AppInfo.buildNumber}`}
250
+                            </Text>
251
+                        </FormRow>
252
+                    </FormSectionAccordion>
253
+                    <FormSectionAccordion
254
+                        accordion = { true }
255
+                        expandable = { true }
256
+                        label = 'settingsView.advanced'>
257
+                        <FormRow
258
+                            label = 'settingsView.disableCallIntegration'>
259
+                            <Switch
260
+                                onValueChange = { this._onDisableCallIntegration }
261
+                                thumbColor = { THUMB_COLOR }
262
+                                trackColor = {{ true: palette.action01Active }}
263
+                                value = { disableCallIntegration } />
264
+                        </FormRow>
265
+                        <Divider style = { styles.fieldSeparator } />
266
+                        <FormRow
267
+                            label = 'settingsView.disableP2P'>
268
+                            <Switch
269
+                                onValueChange = { this._onDisableP2P }
270
+                                thumbColor = { THUMB_COLOR }
271
+                                trackColor = {{ true: palette.action01Active }}
272
+                                value = { disableP2P } />
273
+                        </FormRow>
274
+                        <Divider style = { styles.fieldSeparator } />
275
+                        {AppInfo.GOOGLE_SERVICES_ENABLED && (
276
+                            <FormRow
277
+                                fieldSeparator = { true }
278
+                                label = 'settingsView.disableCrashReporting'>
279
+                                <Switch
280
+                                    onValueChange = { this._onDisableCrashReporting }
281
+                                    thumbColor = { THUMB_COLOR }
282
+                                    trackColor = {{ true: palette.action01Active }}
283
+                                    value = { disableCrashReporting } />
284
+                            </FormRow>
285
+                        )}
286
+                    </FormSectionAccordion>
218 287
                 </ScrollView>
219 288
             </JitsiModal>
220 289
         );
@@ -337,22 +406,9 @@ class SettingsView extends AbstractSettingsView<Props, State> {
337 406
      * @returns {boolean} - True if the modal can be closed.
338 407
      */
339 408
     _onClose() {
340
-        this.setState({ showAdvanced: false });
341
-
342 409
         return this._processServerURL(true /* hideOnSuccess */);
343 410
     }
344 411
 
345
-    _onShowAdvanced: () => void;
346
-
347
-    /**
348
-     * Handles the advanced settings button.
349
-     *
350
-     * @returns {void}
351
-     */
352
-    _onShowAdvanced() {
353
-        this.setState({ showAdvanced: !this.state.showAdvanced });
354
-    }
355
-
356 412
     /**
357 413
      * Callback to update the start with audio muted value.
358 414
      *
@@ -403,56 +459,6 @@ class SettingsView extends AbstractSettingsView<Props, State> {
403 459
         return hideOnSuccess;
404 460
     }
405 461
 
406
-    /**
407
-     * Renders the advanced settings options.
408
-     *
409
-     * @private
410
-     * @returns {React$Element}
411
-     */
412
-    _renderAdvancedSettings() {
413
-        const { disableCallIntegration, disableP2P, disableCrashReporting, showAdvanced } = this.state;
414
-
415
-        if (!showAdvanced) {
416
-            return (
417
-                <FormRow
418
-                    fieldSeparator = { true }
419
-                    label = 'settingsView.showAdvanced'>
420
-                    <Switch
421
-                        onValueChange = { this._onShowAdvanced }
422
-                        value = { showAdvanced } />
423
-                </FormRow>
424
-            );
425
-        }
426
-
427
-        return (
428
-            <>
429
-                <FormRow
430
-                    fieldSeparator = { true }
431
-                    label = 'settingsView.disableCallIntegration'>
432
-                    <Switch
433
-                        onValueChange = { this._onDisableCallIntegration }
434
-                        value = { disableCallIntegration } />
435
-                </FormRow>
436
-                <FormRow
437
-                    fieldSeparator = { true }
438
-                    label = 'settingsView.disableP2P'>
439
-                    <Switch
440
-                        onValueChange = { this._onDisableP2P }
441
-                        value = { disableP2P } />
442
-                </FormRow>
443
-                {AppInfo.GOOGLE_SERVICES_ENABLED && (
444
-                    <FormRow
445
-                        fieldSeparator = { true }
446
-                        label = 'settingsView.disableCrashReporting'>
447
-                        <Switch
448
-                            onValueChange = { this._onDisableCrashReporting }
449
-                            value = { disableCrashReporting } />
450
-                    </FormRow>
451
-                )}
452
-            </>
453
-        );
454
-    }
455
-
456 462
     _setURLFieldReference: (React$ElementRef<*> | null) => void;
457 463
 
458 464
     /**
@@ -538,4 +544,4 @@ function _mapStateToProps(state) {
538 544
     };
539 545
 }
540 546
 
541
-export default translate(connect(_mapStateToProps)(SettingsView));
547
+export default translate(connect(_mapStateToProps)(withTheme(SettingsView)));

+ 44
- 13
react/features/settings/components/native/styles.js View File

@@ -1,9 +1,9 @@
1
-import { ColorPalette } from '../../../base/styles';
2
-
1
+import BaseTheme from '../../../base/ui/components/BaseTheme.native';
3 2
 export const ANDROID_UNDERLINE_COLOR = 'transparent';
4
-export const PLACEHOLDER_COLOR = ColorPalette.lightGrey;
3
+export const PLACEHOLDER_COLOR = BaseTheme.palette.action02Focus;
4
+export const THUMB_COLOR = BaseTheme.palette.field02;
5 5
 
6
-const TEXT_SIZE = 17;
6
+const TEXT_SIZE = 14;
7 7
 
8 8
 /**
9 9
  * The styles of the native components of the feature {@code settings}.
@@ -15,7 +15,7 @@ export default {
15 15
     fieldContainer: {
16 16
         alignItems: 'center',
17 17
         flexDirection: 'row',
18
-        minHeight: 65,
18
+        minHeight: 56,
19 19
         paddingHorizontal: 8
20 20
     },
21 21
 
@@ -24,8 +24,7 @@ export default {
24 24
      */
25 25
     fieldContainerColumn: {
26 26
         alignItems: 'flex-start',
27
-        flexDirection: 'column',
28
-        paddingVertical: 3
27
+        flexDirection: 'column'
29 28
     },
30 29
 
31 30
     /**
@@ -34,7 +33,7 @@ export default {
34 33
     fieldLabelContainer: {
35 34
         alignItems: 'center',
36 35
         flexDirection: 'row',
37
-        marginRight: 5
36
+        paddingLeft: 8
38 37
     },
39 38
 
40 39
     /**
@@ -67,29 +66,61 @@ export default {
67 66
         alignItems: 'center',
68 67
         flex: 1,
69 68
         flexDirection: 'row',
70
-        justifyContent: 'flex-end'
69
+        justifyContent: 'flex-end',
70
+        paddingRight: 8
71 71
     },
72 72
 
73 73
     /**
74 74
      * Style for the form section separator titles.
75 75
      */
76 76
     formSectionTitle: {
77
-        backgroundColor: 'rgba(0, 0, 0, 0.1)',
78
-        padding: 5
77
+        backgroundColor: BaseTheme.palette.section01,
78
+        paddingBottom: 0,
79
+        paddingTop: 0
80
+    },
81
+
82
+    formSectionTitleActive: {
83
+        color: BaseTheme.palette.section01Active
84
+    },
85
+
86
+    formSectionTitleInActive: {
87
+        color: BaseTheme.palette.section01Inactive
88
+    },
89
+
90
+    sectionClose: {
91
+        color: BaseTheme.palette.section01Inactive,
92
+        fontSize: 14
93
+    },
94
+
95
+    sectionOpen: {
96
+        color: BaseTheme.palette.section01Active,
97
+        fontSize: 14
79 98
     },
80 99
 
81 100
     /**
82 101
      * Global {@code Text} color for the components.
83 102
      */
84 103
     text: {
85
-        color: ColorPalette.black
104
+        color: BaseTheme.palette.field01
105
+    },
106
+
107
+    /**
108
+     * Text input container style.
109
+     */
110
+    textInputContainer: {
111
+        flex: 1,
112
+        height: 40,
113
+        paddingBottom: 8,
114
+        paddingTop: 2,
115
+        paddingLeft: 16,
116
+        paddingRight: 16
86 117
     },
87 118
 
88 119
     /**
89 120
      * Standard text input field style.
90 121
      */
91 122
     textInputField: {
92
-        color: ColorPalette.black,
123
+        color: BaseTheme.palette.field01,
93 124
         flex: 1,
94 125
         fontSize: TEXT_SIZE,
95 126
         textAlign: 'right'

+ 3
- 0
webpack.config.js View File

@@ -77,6 +77,9 @@ const config = {
77 77
             ],
78 78
             loader: 'babel-loader',
79 79
             options: {
80
+                // Avoid loading babel.config.js, since we only use it for React Native.
81
+                configFile: false,
82
+
80 83
                 // XXX The require.resolve bellow solves failures to locate the
81 84
                 // presets when lib-jitsi-meet, for example, is npm linked in
82 85
                 // jitsi-meet.

Loading…
Cancel
Save