Compare commits

...
Author SHA1 Message Date
Akinwale Ariwodola 23cf8b15bc use react-navigation-stack module 2019-09-23 17:47:30 +01:00
Akinwale Ariwodola 76cc8eaea1 update react-navigation-drawer package 2019-09-23 16:43:54 +01:00
Akinwale Ariwodola f372b33f42 Publish UX (#44)
* persist publish form state
* better handling of pending form states
2019-09-20 10:29:37 +01:00
Akinwale Ariwodola a26fb3e06b fix channel selector issues on publish page (#43)
* fix channel selector issues on publish page
* remove future release warning
* fix channel creation error
2019-09-15 12:02:34 +01:00
Akinwale Ariwodola 8bd3bd21e8 Merge pull request #42 from lbryio/reward-range
support reward range amount
2019-09-15 11:45:41 +01:00
Akinwale Ariwodola 0115025b86 support reward range amount 2019-09-13 08:27:41 +01:00
Akinwale Ariwodola 34fa24ffd0 Channel creation and editing (#36) 2019-09-13 08:16:06 +01:00
Akinwale Ariwodola 9e8ba95fec Merge pull request #41 from lbryio/autoclaim-rewards
auto claim eligible rewards after viewing a file
2019-09-12 07:20:02 +01:00
Akinwale Ariwodola d63253cc30 auto claim eligible rewards after viewing a file 2019-09-11 12:44:44 +01:00
Akinwale Ariwodola 6ce143b145 Merge pull request #40 from lbryio/publish-currency
add currency selector on publish page
2019-09-11 09:07:34 +01:00
Akinwale Ariwodola c7ce7ea284 add currency selector on publish page 2019-09-10 13:23:34 +01:00
Akinwale Ariwodola 076122def4 Merge pull request #39 from lbryio/file-uploads
allow users to upload any file
2019-09-10 12:57:25 +01:00
Akinwale Ariwodola 625559528d allow users to upload any file 2019-09-09 16:26:50 +01:00
Akinwale Ariwodola c88961002f canonical url and transform updates (#38)
* canonical url and transform updates
* account unlock after sync apply
* fix featured search item
* unlock after sync apply
* pin lbryinc commit
* fix featured search result item stuck loading
2019-09-06 19:43:47 +01:00
Akinwale Ariwodola decf0623fb better featured search result item handling (#37) 2019-09-05 15:57:27 +01:00
Akinwale Ariwodola c7f2b78b92 fixes as per review 2019-09-05 15:53:25 +01:00
Akinwale Ariwodola 47cf15741c better featured search result item handling 2019-09-02 14:15:48 +01:00
Akinwale Ariwodola e74a419ffd cleanup 2019-08-27 07:10:09 +01:00
Akinwale Ariwodola 0c06f478c8 Merge pull request #35 from lbryio/filter-selectors
fix filter selectors getting stuck
2019-08-26 22:17:18 +01:00
40 changed files with 2307 additions and 300 deletions

No files matched your search

+158 -84
View File
@@ -4160,22 +4160,26 @@
"dependencies": {
"abbrev": {
"version": "1.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==",
"optional": true
},
"ansi-regex": {
"version": "2.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=",
"optional": true
},
"aproba": {
"version": "1.2.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==",
"optional": true
},
"are-we-there-yet": {
"version": "1.1.5",
"bundled": true,
"resolved": false,
"integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==",
"optional": true,
"requires": {
"delegates": "^1.0.0",
@@ -4184,12 +4188,14 @@
},
"balanced-match": {
"version": "1.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
"optional": true
},
"brace-expansion": {
"version": "1.1.11",
"bundled": true,
"resolved": false,
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"optional": true,
"requires": {
"balanced-match": "^1.0.0",
@@ -4198,32 +4204,38 @@
},
"chownr": {
"version": "1.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==",
"optional": true
},
"code-point-at": {
"version": "1.1.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=",
"optional": true
},
"concat-map": {
"version": "0.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
"optional": true
},
"console-control-strings": {
"version": "1.1.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=",
"optional": true
},
"core-util-is": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
"optional": true
},
"debug": {
"version": "4.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==",
"optional": true,
"requires": {
"ms": "^2.1.1"
@@ -4231,22 +4243,26 @@
},
"deep-extend": {
"version": "0.6.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==",
"optional": true
},
"delegates": {
"version": "1.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=",
"optional": true
},
"detect-libc": {
"version": "1.0.3",
"bundled": true,
"resolved": false,
"integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=",
"optional": true
},
"fs-minipass": {
"version": "1.2.5",
"bundled": true,
"resolved": false,
"integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==",
"optional": true,
"requires": {
"minipass": "^2.2.1"
@@ -4254,12 +4270,14 @@
},
"fs.realpath": {
"version": "1.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
"optional": true
},
"gauge": {
"version": "2.7.4",
"bundled": true,
"resolved": false,
"integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=",
"optional": true,
"requires": {
"aproba": "^1.0.3",
@@ -4274,7 +4292,8 @@
},
"glob": {
"version": "7.1.3",
"bundled": true,
"resolved": false,
"integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==",
"optional": true,
"requires": {
"fs.realpath": "^1.0.0",
@@ -4287,12 +4306,14 @@
},
"has-unicode": {
"version": "2.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=",
"optional": true
},
"iconv-lite": {
"version": "0.4.24",
"bundled": true,
"resolved": false,
"integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==",
"optional": true,
"requires": {
"safer-buffer": ">= 2.1.2 < 3"
@@ -4300,7 +4321,8 @@
},
"ignore-walk": {
"version": "3.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==",
"optional": true,
"requires": {
"minimatch": "^3.0.4"
@@ -4308,7 +4330,8 @@
},
"inflight": {
"version": "1.0.6",
"bundled": true,
"resolved": false,
"integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=",
"optional": true,
"requires": {
"once": "^1.3.0",
@@ -4317,17 +4340,20 @@
},
"inherits": {
"version": "2.0.3",
"bundled": true,
"resolved": false,
"integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=",
"optional": true
},
"ini": {
"version": "1.3.5",
"bundled": true,
"resolved": false,
"integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==",
"optional": true
},
"is-fullwidth-code-point": {
"version": "1.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=",
"optional": true,
"requires": {
"number-is-nan": "^1.0.0"
@@ -4335,12 +4361,14 @@
},
"isarray": {
"version": "1.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=",
"optional": true
},
"minimatch": {
"version": "3.0.4",
"bundled": true,
"resolved": false,
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"optional": true,
"requires": {
"brace-expansion": "^1.1.7"
@@ -4348,12 +4376,14 @@
},
"minimist": {
"version": "0.0.8",
"bundled": true,
"resolved": false,
"integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=",
"optional": true
},
"minipass": {
"version": "2.3.5",
"bundled": true,
"resolved": false,
"integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==",
"optional": true,
"requires": {
"safe-buffer": "^5.1.2",
@@ -4362,7 +4392,8 @@
},
"minizlib": {
"version": "1.2.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==",
"optional": true,
"requires": {
"minipass": "^2.2.1"
@@ -4370,7 +4401,8 @@
},
"mkdirp": {
"version": "0.5.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=",
"optional": true,
"requires": {
"minimist": "0.0.8"
@@ -4378,12 +4410,14 @@
},
"ms": {
"version": "2.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==",
"optional": true
},
"needle": {
"version": "2.3.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-QBZu7aAFR0522EyaXZM0FZ9GLpq6lvQ3uq8gteiDUp7wKdy0lSd2hPlgFwVuW1CBkfEs9PfDQsQzZghLs/psdg==",
"optional": true,
"requires": {
"debug": "^4.1.0",
@@ -4393,7 +4427,8 @@
},
"node-pre-gyp": {
"version": "0.12.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-4KghwV8vH5k+g2ylT+sLTjy5wmUOb9vPhnM8NHvRf9dHmnW/CndrFXy2aRPaPST6dugXSdHXfeaHQm77PIz/1A==",
"optional": true,
"requires": {
"detect-libc": "^1.0.2",
@@ -4410,7 +4445,8 @@
},
"nopt": {
"version": "4.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=",
"optional": true,
"requires": {
"abbrev": "1",
@@ -4419,12 +4455,14 @@
},
"npm-bundled": {
"version": "1.0.6",
"bundled": true,
"resolved": false,
"integrity": "sha512-8/JCaftHwbd//k6y2rEWp6k1wxVfpFzB6t1p825+cUb7Ym2XQfhwIC5KwhrvzZRJu+LtDE585zVaS32+CGtf0g==",
"optional": true
},
"npm-packlist": {
"version": "1.4.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-+TcdO7HJJ8peiiYhvPxsEDhF3PJFGUGRcFsGve3vxvxdcpO2Z4Z7rkosRM0kWj6LfbK/P0gu3dzk5RU1ffvFcw==",
"optional": true,
"requires": {
"ignore-walk": "^3.0.1",
@@ -4433,7 +4471,8 @@
},
"npmlog": {
"version": "4.1.2",
"bundled": true,
"resolved": false,
"integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==",
"optional": true,
"requires": {
"are-we-there-yet": "~1.1.2",
@@ -4444,17 +4483,20 @@
},
"number-is-nan": {
"version": "1.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=",
"optional": true
},
"object-assign": {
"version": "4.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=",
"optional": true
},
"once": {
"version": "1.4.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=",
"optional": true,
"requires": {
"wrappy": "1"
@@ -4462,17 +4504,20 @@
},
"os-homedir": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=",
"optional": true
},
"os-tmpdir": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=",
"optional": true
},
"osenv": {
"version": "0.1.5",
"bundled": true,
"resolved": false,
"integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==",
"optional": true,
"requires": {
"os-homedir": "^1.0.0",
@@ -4481,17 +4526,20 @@
},
"path-is-absolute": {
"version": "1.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=",
"optional": true
},
"process-nextick-args": {
"version": "2.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==",
"optional": true
},
"rc": {
"version": "1.2.8",
"bundled": true,
"resolved": false,
"integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==",
"optional": true,
"requires": {
"deep-extend": "^0.6.0",
@@ -4502,14 +4550,16 @@
"dependencies": {
"minimist": {
"version": "1.2.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
"optional": true
}
}
},
"readable-stream": {
"version": "2.3.6",
"bundled": true,
"resolved": false,
"integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==",
"optional": true,
"requires": {
"core-util-is": "~1.0.0",
@@ -4523,7 +4573,8 @@
},
"rimraf": {
"version": "2.6.3",
"bundled": true,
"resolved": false,
"integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==",
"optional": true,
"requires": {
"glob": "^7.1.3"
@@ -4531,37 +4582,44 @@
},
"safe-buffer": {
"version": "5.1.2",
"bundled": true,
"resolved": false,
"integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==",
"optional": true
},
"safer-buffer": {
"version": "2.1.2",
"bundled": true,
"resolved": false,
"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==",
"optional": true
},
"sax": {
"version": "1.2.4",
"bundled": true,
"resolved": false,
"integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==",
"optional": true
},
"semver": {
"version": "5.7.0",
"bundled": true,
"resolved": false,
"integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==",
"optional": true
},
"set-blocking": {
"version": "2.0.0",
"bundled": true,
"resolved": false,
"integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=",
"optional": true
},
"signal-exit": {
"version": "3.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=",
"optional": true
},
"string-width": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=",
"optional": true,
"requires": {
"code-point-at": "^1.0.0",
@@ -4571,7 +4629,8 @@
},
"string_decoder": {
"version": "1.1.1",
"bundled": true,
"resolved": false,
"integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
"optional": true,
"requires": {
"safe-buffer": "~5.1.0"
@@ -4579,7 +4638,8 @@
},
"strip-ansi": {
"version": "3.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=",
"optional": true,
"requires": {
"ansi-regex": "^2.0.0"
@@ -4587,12 +4647,14 @@
},
"strip-json-comments": {
"version": "2.0.1",
"bundled": true,
"resolved": false,
"integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=",
"optional": true
},
"tar": {
"version": "4.4.8",
"bundled": true,
"resolved": false,
"integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==",
"optional": true,
"requires": {
"chownr": "^1.1.1",
@@ -4606,12 +4668,14 @@
},
"util-deprecate": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=",
"optional": true
},
"wide-align": {
"version": "1.1.3",
"bundled": true,
"resolved": false,
"integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==",
"optional": true,
"requires": {
"string-width": "^1.0.2 || 2"
@@ -4619,12 +4683,14 @@
},
"wrappy": {
"version": "1.0.2",
"bundled": true,
"resolved": false,
"integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=",
"optional": true
},
"yallist": {
"version": "3.0.3",
"bundled": true,
"resolved": false,
"integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==",
"optional": true
}
}
@@ -5574,8 +5640,8 @@
}
},
"lbry-redux": {
"version": "github:lbryio/lbry-redux#c74deed2a63e1acd0d1827ed9b954242d74e2a1e",
"from": "github:lbryio/lbry-redux#c74deed2a63e1acd0d1827ed9b954242d74e2a1e",
"version": "github:lbryio/lbry-redux#123efacf4d45289ebda9dc291976d475de227a55",
"from": "github:lbryio/lbry-redux#123efacf4d45289ebda9dc291976d475de227a55",
"requires": {
"proxy-polyfill": "0.1.6",
"reselect": "^3.0.0",
@@ -5583,8 +5649,8 @@
}
},
"lbryinc": {
"version": "github:lbryio/lbryinc#4c761084990557d379c85e1c998fcae7e5db143a",
"from": "github:lbryio/lbryinc#4c761084990557d379c85e1c998fcae7e5db143a",
"version": "github:lbryio/lbryinc#b9f354ae50bd57691765a7d042c5054167878bf4",
"from": "github:lbryio/lbryinc#b9f354ae50bd57691765a7d042c5054167878bf4",
"requires": {
"reselect": "^3.0.0"
}
@@ -8039,11 +8105,6 @@
}
}
},
"react-native-document-picker": {
"version": "3.2.4",
"resolved": "https://registry.npmjs.org/react-native-document-picker/-/react-native-document-picker-3.2.4.tgz",
"integrity": "sha512-5l0/fkgasUZdIk9jUUkReDtNCQn2yg1+BrMPHMt45c/NVmE15ThnhIuDj8/n8h1F1RlhUb3SzF86ANK4OdZAiQ=="
},
"react-native-exception-handler": {
"version": "2.9.0",
"resolved": "https://registry.npmjs.org/react-native-exception-handler/-/react-native-exception-handler-2.9.0.tgz",
@@ -8064,9 +8125,9 @@
}
},
"react-native-gesture-handler": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.1.0.tgz",
"integrity": "sha512-E9IKHpmL+sz/iCYkUriTUjBaQBORWV+oheYPQleADkxjo2sYsQfnlyTz4EQYFONkUwJ6WmfTNkYt2/yc5U4Ziw==",
"version": "1.3.0",
"resolved": "https://registry.npmjs.org/react-native-gesture-handler/-/react-native-gesture-handler-1.3.0.tgz",
"integrity": "sha512-ASRFIXBuKRvqlmwkWJhV8yP2dTpvcqVrLNpd7FKVBFHYWr6SAxjGyO9Ik8w1lAxDhMlRP2IcJ9p9eq5X2WWeLQ==",
"requires": {
"hoist-non-react-statics": "^2.3.1",
"invariant": "^2.2.2",
@@ -8329,13 +8390,21 @@
"requires": {
"react-native-tab-view": "^1.2.0"
}
},
"react-navigation-stack": {
"version": "1.5.5",
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-1.5.5.tgz",
"integrity": "sha512-qMhOhmUmyPNfFGWMbwv5flrNVsFU4JZSBWnONSgVGK4KWGW8DbobXBi4i4sBAC9Kg8EqJK0qyWcxnkMJJtfMWA==",
"requires": {
"prop-types": "^15.7.2"
}
}
}
},
"react-navigation-drawer": {
"version": "2.0.0",
"resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-2.0.0.tgz",
"integrity": "sha512-M9Ov4kOj0nh9HDMYoYJtd6ZaIKYLlC3y2LmGr4kNIPZ1zj4fIXi8ibaolZOe28xmZakWFZzN7bbUf2f+Rbc8Og=="
"version": "2.2.2",
"resolved": "https://registry.npmjs.org/react-navigation-drawer/-/react-navigation-drawer-2.2.2.tgz",
"integrity": "sha512-KcFH7RRzT1XuREkTbNMCqfy7nK7yenzpGKvqp1dTvAE+DIyHHpf+Po959lsmITlt/njQBn+QxvdX1FZ9we3lNA=="
},
"react-navigation-redux-helpers": {
"version": "3.0.2",
@@ -8346,9 +8415,9 @@
}
},
"react-navigation-stack": {
"version": "1.5.0",
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-1.5.0.tgz",
"integrity": "sha512-XwgdQY8c7PguPw/cx6GCRMnYMe6P/izzOpeOfE8g6sWrWW2vs/vwodRb9a820QePhX0I7dkgxdnTSq+o7/R49Q==",
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/react-navigation-stack/-/react-navigation-stack-1.8.1.tgz",
"integrity": "sha512-XOkHuYlQjZKnD4jTU0Ml847sKjpwsJpQ6JX4ZfOq8D0e6fPWXbpYNhvUnzHMHMm+tnbhTqkqP1Umu40Hmx748Q==",
"requires": {
"prop-types": "^15.7.2"
}
@@ -9124,6 +9193,11 @@
"object-assign": "^4.1.1"
}
},
"seedrandom": {
"version": "3.0.3",
"resolved": "https://registry.npmjs.org/seedrandom/-/seedrandom-3.0.3.tgz",
"integrity": "sha512-PJLhhxIMjlMJaiIRtqiVW061EZn3cS+waZkbFe7eCa2R3g88HbNdWmw4NTFG1w5unxd0GeNaUUxZJP7gPAzSDQ=="
},
"semver": {
"version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
+7 -6
View File
@@ -12,8 +12,8 @@
"base-64": "^0.1.0",
"@expo/vector-icons": "^8.1.0",
"gfycat-style-urls": "^1.0.3",
"lbry-redux": "lbryio/lbry-redux#c74deed2a63e1acd0d1827ed9b954242d74e2a1e",
"lbryinc": "lbryio/lbryinc#4c761084990557d379c85e1c998fcae7e5db143a",
"lbry-redux": "lbryio/lbry-redux#123efacf4d45289ebda9dc291976d475de227a55",
"lbryinc": "lbryio/lbryinc#b9f354ae50bd57691765a7d042c5054167878bf4",
"lodash": ">=4.17.11",
"merge": ">=1.2.1",
"moment": "^2.22.1",
@@ -22,11 +22,10 @@
"@react-native-community/async-storage": "^1.5.1",
"react-native-camera": "^2.11.1",
"react-native-country-picker-modal": "^0.6.2",
"react-native-document-picker": "^3.2.4",
"react-native-exception-handler": "2.9.0",
"react-native-fast-image": "^6.1.1",
"react-native-fs": "^2.13.3",
"react-native-gesture-handler": "1.1.0",
"react-native-gesture-handler": "1.3.0",
"react-native-image-zoom-viewer": "^2.2.5",
"react-native-password-strength-meter": "^0.0.2",
"react-native-phone-input": "lbryio/react-native-phone-input",
@@ -35,8 +34,9 @@
"react-native-vector-icons": "^6.6.0",
"react-native-video": "lbryio/react-native-video#exoplayer-lbry-android",
"react-navigation": "^3.11.0",
"react-navigation-drawer": "^2.0.0",
"react-navigation-drawer": "^2.2.2",
"react-navigation-redux-helpers": "^3.0.2",
"react-navigation-stack": "^1.8.1",
"react-redux": "^5.0.3",
"redux": "^4.0.4",
"redux-persist": "^5.10.0",
@@ -44,7 +44,8 @@
"redux-persist-transform-compress": "^4.2.0",
"redux-persist-transform-filter": "0.0.18",
"redux-thunk": "^2.3.0",
"rn-fetch-blob": "0.10.15"
"rn-fetch-blob": "0.10.15",
"seedrandom": "3.0.3"
},
"devDependencies": {
"@babel/core": "^7.5.4",
+12 -3
View File
@@ -1,5 +1,6 @@
import React from 'react';
import AboutPage from 'page/about';
import ChannelCreatorPage from 'page/channelCreator';
import DiscoverPage from 'page/discover';
import DownloadsPage from 'page/downloads';
import DrawerContent from 'component/drawerContent';
@@ -17,8 +18,9 @@ import SubscriptionsPage from 'page/subscriptions';
import TransactionHistoryPage from 'page/transactionHistory';
import VerificationScreen from 'page/verification';
import WalletPage from 'page/wallet';
import { createStackNavigator, NavigationActions } from 'react-navigation';
import { NavigationActions } from 'react-navigation';
import { createDrawerNavigator } from 'react-navigation-drawer';
import { createStackNavigator } from 'react-navigation-stack';
import {
createReduxContainer,
createReactNavigationReduxMiddleware,
@@ -40,7 +42,7 @@ import {
} from 'lbryinc';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import { decode as atob } from 'base-64';
import { dispatchNavigateBack, dispatchNavigateToUri } from 'utils/helper';
import { dispatchNavigateBack, dispatchNavigateToUri, transformUrl } from 'utils/helper';
import AsyncStorage from '@react-native-community/async-storage';
import Colors from 'styles/colors';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
@@ -159,6 +161,12 @@ const drawer = createDrawerNavigator(
drawerIcon: ({ tintColor }) => <Icon name="wallet" size={drawerIconSize} style={{ color: tintColor }} />,
},
},
ChannelCreator: {
screen: ChannelCreatorPage,
navigationOptions: {
drawerIcon: ({ tintColor }) => <Icon name="at" size={drawerIconSize} style={{ color: tintColor }} />,
},
},
Publish: {
screen: PublishPage,
navigationOptions: {
@@ -203,6 +211,7 @@ const drawer = createDrawerNavigator(
},
{
drawerWidth: 300,
drawerBackgroundColor: 'transparent',
headerMode: 'none',
backBehavior: 'none',
unmountInactiveRoutes: true,
@@ -413,7 +422,7 @@ class AppWithNavigationState extends React.Component {
);
}
} else {
dispatchNavigateToUri(dispatch, nav, evt.url);
dispatchNavigateToUri(dispatch, nav, transformUrl(evt.url));
}
}
};
+6 -1
View File
@@ -13,10 +13,15 @@ export default class ChannelIconItem extends React.PureComponent {
autothumbStyle.autothumbBlue,
autothumbStyle.autothumbLightBlue,
autothumbStyle.autothumbCyan,
autothumbStyle.autothumbTeal,
autothumbStyle.autothumbGreen,
autothumbStyle.autothumbYellow,
autothumbStyle.autothumbOrange,
autothumbStyle.autothumbDeepPurple,
autothumbStyle.autothumbAmber,
autothumbStyle.autothumbLime,
autothumbStyle.autothumbLightGreen,
autothumbStyle.autothumbDeepOrange,
autothumbStyle.autothumbBrown,
];
state = {
+6 -3
View File
@@ -30,11 +30,14 @@ export default class ChannelSelector extends React.PureComponent {
if (!channels.length && !fetchingChannels) {
fetchChannelListMine();
}
this.setState({ currentSelectedValue: channelName });
}
componentDidUpdate() {
const { channelName } = this.props;
if (this.state.currentSelectedValue !== channelName) {
componentWillReceiveProps(nextProps) {
const { channels: prevChannels = [], channelName } = this.props;
const { channels = [] } = nextProps;
if (channels.length !== prevChannels.length && channelName !== this.state.currentSelectedValue) {
this.setState({ currentSelectedValue: channelName });
}
}
+5 -3
View File
@@ -94,8 +94,6 @@ class ClaimList extends React.PureComponent {
options.release_time = this.getReleaseTimeOption(time);
}
console.log(options);
return options;
}
@@ -206,7 +204,11 @@ class ClaimList extends React.PureComponent {
const options = this.buildClaimSearchOptions();
const claimSearchKey = createNormalizedClaimSearchKey(options);
const uris = claimSearchByQuery[claimSearchKey];
let uris = claimSearchByQuery[claimSearchKey];
if (uris) {
uris = uris.filter(uri => uri && uri.length > 0);
}
if (Constants.ORIENTATION_VERTICAL === orientation) {
return (
+55 -41
View File
@@ -12,6 +12,7 @@ const groupedMenuItems = {
{ icon: 'globe-americas', label: 'All content', route: Constants.DRAWER_ROUTE_TRENDING },
],
'Your content': [
{ icon: 'at', label: 'Channels', route: Constants.DRAWER_ROUTE_CHANNEL_CREATOR },
{ icon: 'download', label: 'Library', route: Constants.DRAWER_ROUTE_MY_LBRY },
{ icon: 'cloud-upload-alt', label: 'Publishes', route: Constants.DRAWER_ROUTE_PUBLISHES },
{ icon: 'upload', label: 'New publish', route: Constants.DRAWER_ROUTE_PUBLISH },
@@ -36,48 +37,61 @@ class DrawerContent extends React.PureComponent {
const activeItemKey = state.routes[state.index] ? state.routes[state.index].key : null;
return (
<ScrollView contentContainerStyle={discoverStyle.menuScrollContent}>
<SafeAreaView style={discoverStyle.drawerContentContainer} forceInset={{ top: 'always', horizontal: 'never' }}>
{groupNames.map(groupName => {
const menuItems = groupedMenuItems[groupName];
<View style={discoverStyle.drawerContentArea}>
<ScrollView contentContainerStyle={discoverStyle.menuScrollContent}>
<SafeAreaView
style={discoverStyle.drawerContentContainer}
forceInset={{ top: 'always', horizontal: 'never' }}
>
{groupNames.map(groupName => {
const menuItems = groupedMenuItems[groupName];
return (
<View key={groupName} style={discoverStyle.menuGroup}>
{groupNames[3] !== groupName && (
<Text key={`${groupName}-title`} style={discoverStyle.menuGroupName}>
{groupName}
</Text>
)}
{menuItems.map(item => {
const focused =
activeItemKey === item.route ||
(activeItemKey === Constants.FULL_ROUTE_NAME_DISCOVER &&
item.route === Constants.DRAWER_ROUTE_DISCOVER) ||
(activeItemKey === Constants.FULL_ROUTE_NAME_WALLET &&
item.route === Constants.DRAWER_ROUTE_WALLET);
return (
<TouchableOpacity
accessible
accessibilityLabel={item.label}
style={[discoverStyle.menuItemTouchArea, focused ? discoverStyle.menuItemTouchAreaFocused : null]}
key={item.label}
onPress={() => navigation.navigate({ routeName: item.route })}
delayPressIn={0}
>
<View style={discoverStyle.menuItemIcon}>
<Icon name={item.icon} size={16} solid={item.solid} color={focused ? activeTintColor : null} />
</View>
<Text style={[discoverStyle.menuItem, focused ? discoverStyle.menuItemFocused : null]}>
{item.label}
</Text>
</TouchableOpacity>
);
})}
</View>
);
})}
</SafeAreaView>
</ScrollView>
return (
<View key={groupName} style={discoverStyle.menuGroup}>
{groupNames[3] !== groupName && (
<Text key={`${groupName}-title`} style={discoverStyle.menuGroupName}>
{groupName}
</Text>
)}
{menuItems.map(item => {
const focused =
activeItemKey === item.route ||
(activeItemKey === Constants.FULL_ROUTE_NAME_DISCOVER &&
item.route === Constants.DRAWER_ROUTE_DISCOVER) ||
(activeItemKey === Constants.FULL_ROUTE_NAME_WALLET &&
item.route === Constants.DRAWER_ROUTE_WALLET);
return (
<TouchableOpacity
accessible
accessibilityLabel={item.label}
style={[
discoverStyle.menuItemTouchArea,
focused ? discoverStyle.menuItemTouchAreaFocused : null,
]}
key={item.label}
onPress={() => navigation.navigate({ routeName: item.route })}
delayPressIn={0}
>
<View style={discoverStyle.menuItemIcon}>
<Icon
name={item.icon}
size={16}
solid={item.solid}
color={focused ? activeTintColor : null}
/>
</View>
<Text style={[discoverStyle.menuItem, focused ? discoverStyle.menuItemFocused : null]}>
{item.label}
</Text>
</TouchableOpacity>
);
})}
</View>
);
})}
</SafeAreaView>
</ScrollView>
</View>
);
}
}
+28 -4
View File
@@ -3,6 +3,7 @@ import { normalizeURI, parseURI } from 'lbry-redux';
import { ActivityIndicator, Platform, Text, TouchableOpacity, View } from 'react-native';
import { navigateToUri, formatBytes } from 'utils/helper';
import Colors from 'styles/colors';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import DateTime from 'component/dateTime';
import FileItemMedia from 'component/fileItemMedia';
import Icon from 'react-native-vector-icons/FontAwesome5';
@@ -12,6 +13,10 @@ import ProgressBar from 'component/progressBar';
import fileListStyle from 'styles/fileList';
class FileListItem extends React.PureComponent {
state = {
url: null,
};
getStorageForFileInfo = fileInfo => {
if (!fileInfo.completed) {
const written = formatBytes(fileInfo.written_bytes);
@@ -41,9 +46,21 @@ class FileListItem extends React.PureComponent {
}
}
componentDidUpdate() {
const { claim, resolveUri, uri } = this.props;
if (!claim && uri !== this.state.url) {
this.setState({ url: uri }, () => resolveUri(uri));
}
}
defaultOnPress = () => {
const { autoplay, navigation, uri, shortUrl } = this.props;
navigateToUri(navigation, shortUrl || uri, { autoplay });
const { autoplay, claim, featuredResult, navigation, uri, shortUrl } = this.props;
if (featuredResult && !claim) {
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_PUBLISH, params: { vanityUrl: uri.trim() } });
} else {
navigateToUri(navigation, shortUrl || uri, { autoplay });
}
};
onPressHandler = () => {
@@ -111,7 +128,7 @@ class FileListItem extends React.PureComponent {
// shouldHide = 'channel' === claim.value_type;
}
if (shouldHide || (!isResolvingUri && !claim) || (featuredResult && !isResolvingUri && !claim && !title && !name)) {
if (shouldHide || (!isResolvingUri && !claim && !featuredResult)) {
return null;
}
@@ -130,7 +147,7 @@ class FileListItem extends React.PureComponent {
style={fileListStyle.thumbnail}
duration={duration}
resizeMode="cover"
title={title || name}
title={title || name || normalizeURI(uri).substring(7)}
thumbnail={thumbnail}
/>
{selected && (
@@ -167,6 +184,13 @@ class FileListItem extends React.PureComponent {
{isRewardContent && <Icon style={fileListStyle.rewardIcon} name="award" size={12} />}
</View>
)}
{featuredResult && !isResolving && !claim && (
<View style={fileListStyle.titleContainer}>
<Text style={fileListStyle.featuredTitle}>Nothing here. Publish something!</Text>
</View>
)}
{channel && !hideChannel && (
<Link
style={fileListStyle.publisher}
+16 -1
View File
@@ -13,6 +13,7 @@ type Props = {
id: string,
reward_title: string,
reward_amount: number,
reward_range?: string,
transaction_id: string,
created_at: string,
reward_description: string,
@@ -55,6 +56,20 @@ class RewardCard extends React.PureComponent<Props> {
});
};
getDisplayAmount = () => {
const { reward } = this.props;
if (reward) {
if (reward.reward_range && reward.reward_range.includes('-')) {
return reward.reward_range.split('-')[0] + '+'; // ex: 5+
} else if (reward.reward_amount > 0) {
return reward.reward_amount;
}
}
// unknown amount which normally shouldn't happen
return '?';
};
render() {
const { canClaim, isPending, onClaimPress, reward } = this.props;
const claimed = !!reward.transaction_id;
@@ -101,7 +116,7 @@ class RewardCard extends React.PureComponent<Props> {
)}
</View>
<View style={rewardStyle.rightCol}>
<Text style={rewardStyle.rewardAmount}>{reward.reward_amount}</Text>
<Text style={rewardStyle.rewardAmount}>{this.getDisplayAmount()}</Text>
<Text style={rewardStyle.rewardCurrency}>LBC</Text>
</View>
</TouchableOpacity>
+2 -1
View File
@@ -67,11 +67,12 @@ export default class TagSearch extends React.PureComponent {
};
render() {
const { name, style, type, selectedTags = [], showNsfwTags } = this.props;
const { editable, name, style, type, selectedTags = [], showNsfwTags } = this.props;
return (
<View>
<TextInput
editable={editable}
style={tagStyle.searchInput}
placeholder={'Search for more tags'}
underlineColorAndroid={Colors.NextLbryGreen}
+13 -6
View File
@@ -2,7 +2,7 @@
import React from 'react';
import { SEARCH_TYPES, isNameValid, isURIValid, normalizeURI } from 'lbry-redux';
import { FlatList, Keyboard, Text, TextInput, TouchableOpacity, View } from 'react-native';
import { navigateToUri } from 'utils/helper';
import { navigateToUri, transformUrl } from 'utils/helper';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import UriBarItem from './internal/uri-bar-item';
import Icon from 'react-native-vector-icons/FontAwesome5';
@@ -109,12 +109,19 @@ class UriBar extends React.PureComponent {
handleSubmitEditing = () => {
const { navigation, onSearchSubmitted, updateSearchQuery } = this.props;
if (this.state.inputText) {
let inputText = this.state.inputText;
if (inputText.startsWith('lbry://') && isURIValid(inputText)) {
let inputText = this.state.inputText,
inputTextIsUrl = false;
if (inputText.startsWith('lbry://')) {
const transformedUrl = transformUrl(inputText);
// if it's a URI (lbry://...), open the file page
const uri = normalizeURI(inputText);
navigateToUri(navigation, uri);
} else {
if (transformedUrl && isURIValid(transformedUrl)) {
inputTextIsUrl = true;
navigateToUri(navigation, transformedUrl);
}
}
// couldn't parse the inputText as a URL for some reason, so do a search instead
if (!inputTextIsUrl) {
updateSearchQuery(inputText);
// Not a URI, default to a search request
if (onSearchSubmitted) {
+15
View File
@@ -25,6 +25,9 @@ const Constants = {
PHASE_DETAILS: 'details',
PHASE_PUBLISH: 'publish',
PHASE_LIST: 'list',
PHASE_NEW: 'create',
CONTENT_TAB: 'content',
ABOUT_TAB: 'about',
@@ -56,6 +59,11 @@ const Constants = {
ACTION_SORT_BY_ITEM_CHANGED: 'SORT_BY_ITEM_CHANGED',
ACTION_TIME_ITEM_CHANGED: 'TIME_ITEM_CHANGED',
ACTION_UPDATE_PUBLISH_FORM_STATE: 'UPDATE_PUBLISH_FORM_STATE',
ACTION_UPDATE_CHANNEL_FORM_STATE: 'UPDATE_CHANNEL_FORM_STATE',
ACTION_CLEAR_PUBLISH_FORM_STATE: 'CLEAR_PUBLISH_FORM_STATE',
ACTION_CLEAR_CHANNEL_FORM_STATE: 'CLEAR_CHANNEL_FORM_STATE',
ORIENTATION_HORIZONTAL: 'horizontal',
ORIENTATION_VERTICAL: 'vertical',
@@ -69,6 +77,7 @@ const Constants = {
DRAWER_ROUTE_SUBSCRIPTIONS: 'Subscriptions',
DRAWER_ROUTE_MY_LBRY: 'Downloads',
DRAWER_ROUTE_PUBLISH: 'Publish',
DRAWER_ROUTE_PUBLISH_FORM: 'PublishForm',
DRAWER_ROUTE_PUBLISHES: 'Publishes',
DRAWER_ROUTE_REWARDS: 'Rewards',
DRAWER_ROUTE_WALLET: 'Wallet',
@@ -77,6 +86,8 @@ const Constants = {
DRAWER_ROUTE_SEARCH: 'Search',
DRAWER_ROUTE_TRANSACTION_HISTORY: 'TransactionHistory',
DRAWER_ROUTE_TAG: 'Tag',
DRAWER_ROUTE_CHANNEL_CREATOR: 'ChannelCreator',
DRAWER_ROUTE_CHANNEL_CREATOR_FORM: 'ChannnelCreatorForm',
FULL_ROUTE_NAME_DISCOVER: 'DiscoverStack',
FULL_ROUTE_NAME_WALLET: 'WalletStack',
@@ -146,4 +157,8 @@ export const DrawerRoutes = [
Constants.DRAWER_ROUTE_ABOUT,
Constants.DRAWER_ROUTE_SEARCH,
Constants.DRAWER_ROUTE_TRANSACTION_HISTORY,
Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
];
// sub-pages for main routes
export const InnerDrawerRoutes = [Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM, Constants.DRAWER_ROUTE_PUBLISH_FORM];
+2
View File
@@ -37,6 +37,7 @@ import FilesystemStorage from 'redux-persist-filesystem-storage';
import createCompressor from 'redux-persist-transform-compress';
import createFilter from 'redux-persist-transform-filter';
import moment from 'moment';
import formReducer from 'redux/reducers/form';
import drawerReducer from 'redux/reducers/drawer';
import settingsReducer from 'redux/reducers/settings';
import thunk from 'redux-thunk';
@@ -109,6 +110,7 @@ const reducers = persistCombineReducers(persistOptions, {
file: fileReducer,
fileInfo: fileInfoReducer,
filtered: filteredReducer,
form: formReducer,
homepage: homepageReducer,
nav: navigatorReducer,
notifications: notificationsReducer,
+2 -2
View File
@@ -1,5 +1,5 @@
import { connect } from 'react-redux';
import { doFetchClaimsByChannel, makeSelectClaimForUri } from 'lbry-redux';
import { makeSelectClaimForUri, selectMyChannelClaims } from 'lbry-redux';
import { doPopDrawerStack } from 'redux/actions/drawer';
import { doSetSortByItem, doSetTimeItem } from 'redux/actions/settings';
import { selectDrawerStack } from 'redux/selectors/drawer';
@@ -7,6 +7,7 @@ import { selectSortByItem, selectTimeItem } from 'redux/selectors/settings';
import ChannelPage from './view';
const select = (state, props) => ({
channels: selectMyChannelClaims(state),
claim: makeSelectClaimForUri(props.uri)(state),
drawerStack: selectDrawerStack(state),
sortByItem: selectSortByItem(state),
@@ -14,7 +15,6 @@ const select = (state, props) => ({
});
const perform = dispatch => ({
fetchClaims: (uri, page) => dispatch(doFetchClaimsByChannel(uri, page)),
popDrawerStack: () => dispatch(doPopDrawerStack()),
setSortByItem: item => dispatch(doSetSortByItem(item)),
setTimeItem: item => dispatch(doSetTimeItem(item)),
+64 -7
View File
@@ -2,6 +2,7 @@
import React from 'react';
import {
ActivityIndicator,
Alert,
Dimensions,
Image,
NativeModules,
@@ -159,10 +160,46 @@ class ChannelPage extends React.PureComponent {
);
};
onEditPressed = () => {
const { claim, navigation } = this.props;
if (claim) {
const { permanent_url: permanentUrl } = claim;
navigation.navigate({
routeName: Constants.DRAWER_ROUTE_CHANNEL_CREATOR,
params: { editChannelUrl: permanentUrl },
});
}
};
onDeletePressed = () => {
const { abandonClaim, claim, navigation } = this.props;
if (claim) {
const { txid, nout } = claim;
// show confirm alert
Alert.alert(
__('Delete channel'),
__('Are you sure you want to delete this channel?'),
[
{ text: __('No') },
{
text: __('Yes'),
onPress: () => {
abandonClaim(txid, nout);
navigation.navigate({ routeName: Constants.DRAWER_ROUTE_CHANNEL_CREATOR });
},
},
],
{ cancelable: true }
);
}
};
render() {
const { claim, navigation, uri, drawerStack, popDrawerStack, sortByItem, timeItem } = this.props;
const { channels, claim, navigation, uri, drawerStack, popDrawerStack, sortByItem, timeItem } = this.props;
const { name, permanent_url: permanentUrl } = claim;
const { autoStyle, showSortPicker, showTimePicker } = this.state;
const ownedChannel = channels ? channels.map(channel => channel.permanent_url).includes(permanentUrl) : false;
let thumbnailUrl,
coverUrl,
@@ -218,12 +255,32 @@ class ChannelPage extends React.PureComponent {
</View>
<View style={channelPageStyle.subscribeButtonContainer}>
<SubscribeButton style={channelPageStyle.subscribeButton} uri={fullUri} name={name} />
<SubscribeNotificationButton
style={[channelPageStyle.subscribeButton, channelPageStyle.bellButton]}
uri={fullUri}
name={name}
/>
{ownedChannel && (
<Button
style={channelPageStyle.actionButton}
theme={'light'}
icon={'edit'}
text={'Edit'}
onPress={this.onEditPressed}
/>
)}
{ownedChannel && (
<Button
style={channelPageStyle.deleteButton}
theme={'light'}
icon={'trash-alt'}
text={'Delete'}
onPress={this.onDeletePressed}
/>
)}
{!ownedChannel && <SubscribeButton style={channelPageStyle.subscribeButton} uri={fullUri} name={name} />}
{!ownedChannel && (
<SubscribeNotificationButton
style={[channelPageStyle.subscribeButton, channelPageStyle.bellButton]}
uri={fullUri}
name={name}
/>
)}
</View>
</View>
+50
View File
@@ -0,0 +1,50 @@
import { connect } from 'react-redux';
import {
selectAbandoningIds,
selectBalance,
selectMyChannelClaims,
selectFetchingMyChannels,
selectUpdatingChannel,
selectUpdateChannelError,
doAbandonClaim,
doFetchChannelListMine,
doCreateChannel,
doUpdateChannel,
doToast,
} from 'lbry-redux';
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
import { doUpdateChannelFormState, doClearChannelFormState } from 'redux/actions/form';
import { selectDrawerStack } from 'redux/selectors/drawer';
import { selectChannelFormState, selectHasChannelFormState } from 'redux/selectors/form';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import ChannelCreator from './view';
const select = state => ({
abandoningClaimIds: selectAbandoningIds(state),
channels: selectMyChannelClaims(state),
channelFormState: selectChannelFormState(state),
drawerStack: selectDrawerStack(state),
fetchingChannels: selectFetchingMyChannels(state),
balance: selectBalance(state),
hasFormState: selectHasChannelFormState(state),
updatingChannel: selectUpdatingChannel(state),
updateChannelError: selectUpdateChannelError(state),
});
const perform = dispatch => ({
abandonClaim: (txid, nout) => dispatch(doAbandonClaim(txid, nout)),
notify: data => dispatch(doToast(data)),
clearChannelFormState: () => dispatch(doClearChannelFormState()),
createChannel: (name, amount, optionalParams) => dispatch(doCreateChannel(name, amount, optionalParams)),
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
updateChannel: params => dispatch(doUpdateChannel(params)),
updateChannelFormState: data => dispatch(doUpdateChannelFormState(data)),
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
popDrawerStack: () => dispatch(doPopDrawerStack()),
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
});
export default connect(
select,
perform
)(ChannelCreator);
File diff suppressed because it is too large. Load diff
+6
View File
@@ -1,6 +1,7 @@
import { connect } from 'react-redux';
import {
doFetchFileInfo,
doFetchChannelListMine,
doFetchClaimListMine,
doFileGet,
doPurchaseUri,
@@ -19,12 +20,14 @@ import {
makeSelectThumbnailForUri,
makeSelectTitleForUri,
selectBalance,
selectMyChannelClaims,
selectMyClaimUrisWithoutChannels,
selectPurchasedUris,
selectFailedPurchaseUris,
selectPurchaseUriErrorMessage,
} from 'lbry-redux';
import {
doClaimEligiblePurchaseRewards,
doFetchCostInfoForUri,
makeSelectCostInfoForUri,
selectRewardContentClaimIds,
@@ -46,6 +49,7 @@ const select = (state, props) => {
return {
balance: selectBalance(state),
blackListedOutpoints: selectBlackListedOutpoints(state),
channels: selectMyChannelClaims(state),
claim: makeSelectClaimForUri(selectProps.uri)(state),
drawerStack: selectDrawerStack(state),
isResolvingUri: makeSelectIsUriResolving(selectProps.uri)(state),
@@ -69,12 +73,14 @@ const select = (state, props) => {
};
const perform = dispatch => ({
claimEligibleRewards: () => dispatch(doClaimEligiblePurchaseRewards()),
deleteFile: (fileInfo, deleteFromDevice, abandonClaim) => {
dispatch(doDeleteFile(fileInfo, deleteFromDevice, abandonClaim));
},
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
fetchMyClaims: () => dispatch(doFetchClaimListMine()),
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
fileGet: (uri, saveFile) => dispatch(doFileGet(uri, saveFile)),
notify: data => dispatch(doToast(data)),
popDrawerStack: () => dispatch(doPopDrawerStack()),
+21 -5
View File
@@ -1,5 +1,5 @@
import React from 'react';
import { Lbry, normalizeURI } from 'lbry-redux';
import { Lbry, normalizeURI, parseURI } from 'lbry-redux';
import { Lbryio } from 'lbryinc';
import {
ActivityIndicator,
@@ -100,7 +100,7 @@ class FilePage extends React.PureComponent {
DeviceEventEmitter.addListener('onDownloadUpdated', this.handleDownloadUpdated);
DeviceEventEmitter.addListener('onDownloadCompleted', this.handleDownloadCompleted);
const { fileInfo, isResolvingUri, resolveUri, navigation } = this.props;
const { fetchChannelListMine, fileInfo, isResolvingUri, resolveUri, navigation } = this.props;
const { uri, uriVars } = navigation.state.params;
this.setState({ uri, uriVars });
@@ -108,6 +108,7 @@ class FilePage extends React.PureComponent {
this.fetchFileInfo(this.props);
this.fetchCostInfo(this.props);
fetchChannelListMine();
if (NativeModules.Firebase) {
NativeModules.Firebase.track('open_file_page', { uri: uri });
@@ -477,6 +478,7 @@ class FilePage extends React.PureComponent {
return;
}
const { claimEligibleRewards } = this.props;
const { nout, claim_id: claimId, txid } = claim;
const outpoint = `${txid}:${nout}`;
const params = {
@@ -488,7 +490,9 @@ class FilePage extends React.PureComponent {
params.time_to_start = timeToStart;
}
Lbryio.call('file', 'view', params).catch(() => {});
Lbryio.call('file', 'view', params)
.then(() => claimEligibleRewards())
.catch(() => {});
this.setState({ fileViewLogged: true });
};
@@ -567,6 +571,7 @@ class FilePage extends React.PureComponent {
const {
balance,
claim,
channels,
channelUri,
costInfo,
fileInfo,
@@ -585,6 +590,10 @@ class FilePage extends React.PureComponent {
} = this.props;
const { uri, autoplay } = navigation.state.params;
const myChannelUris = channels ? channels.map(channel => channel.permanent_url) : [];
const ownedClaim = myClaimUris.includes(uri) || myChannelUris.includes(uri);
const { isChannel } = parseURI(uri);
let innerContent = null;
if ((isResolvingUri && !claim) || !claim) {
return (
@@ -597,7 +606,14 @@ class FilePage extends React.PureComponent {
)}
{claim === null && !isResolvingUri && (
<View style={filePageStyle.container}>
<Text style={filePageStyle.emptyClaimText}>There's nothing at this location.</Text>
{ownedClaim && (
<Text style={filePageStyle.emptyClaimText}>
{isChannel
? 'It looks like you just created this channel. It will appear in a few minutes.'
: 'It looks you just published this content. It will appear in a few minutes.'}
</Text>
)}
{!ownedClaim && <Text style={filePageStyle.emptyClaimText}>There's nothing at this location.</Text>}
</View>
)}
<UriBar value={uri} navigation={navigation} />
@@ -606,7 +622,7 @@ class FilePage extends React.PureComponent {
}
if (claim) {
if (claim && claim.name.length && claim.name[0] === '@') {
if (isChannel) {
return <ChannelPage uri={uri} navigation={navigation} />;
}
+1 -1
View File
@@ -46,7 +46,7 @@ const perform = dispatch => ({
syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)),
getSync: password => dispatch(doGetSync(password)),
checkSync: () => dispatch(doCheckSync()),
setDefaultAccount: () => dispatch(doSetDefaultAccount()),
setDefaultAccount: (success, failure) => dispatch(doSetDefaultAccount(success, failure)),
notify: data => dispatch(doToast(data)),
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
});
+21 -8
View File
@@ -33,7 +33,7 @@ class FirstRunScreen extends React.PureComponent {
isEmailVerified: false,
skipAccountConfirmed: false,
showBottomContainer: false,
walletPassword: null,
walletPassword: '',
syncApplyStarted: false,
};
@@ -86,12 +86,25 @@ class FirstRunScreen extends React.PureComponent {
this.setState({ showBottomContainer: true });
} else {
// password successfully verified
if (NativeModules.UtilityModule) {
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, this.state.walletPassword);
}
setDefaultAccount();
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
this.closeFinalPage();
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, this.state.walletPassword);
setDefaultAccount(
() => {
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
// unlock the wallet
Lbry.account_unlock({ password: this.state.walletPassword ? this.state.walletPassword : '' })
.then(() => this.closeFinalPage())
.catch(err =>
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' })
);
},
err => {
notify({
message:
'The account restore operation could not be completed successfully. Please restart the app and try again.',
});
}
);
}
}
@@ -253,7 +266,7 @@ class FirstRunScreen extends React.PureComponent {
};
onWalletPasswordChanged = password => {
this.setState({ walletPassword: password });
this.setState({ walletPassword: password !== null ? password : '' });
};
onWalletViewLayout = () => {
+11 -2
View File
@@ -8,22 +8,31 @@ import {
selectBalance,
selectPublishFormValues,
} from 'lbry-redux';
import { doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
import { selectDrawerStack } from 'redux/selectors/drawer';
import { doUpdatePublishFormState, doClearPublishFormState } from 'redux/actions/form';
import { doPushDrawerStack, doPopDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
import { selectPublishFormState, selectHasPublishFormState } from 'redux/selectors/form';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import PublishPage from './view';
const select = state => ({
balance: selectBalance(state),
drawerStack: selectDrawerStack(state),
hasFormState: selectHasPublishFormState(state),
publishFormState: selectPublishFormState(state),
publishFormValues: selectPublishFormValues(state),
});
const perform = dispatch => ({
notify: data => dispatch(doToast(data)),
clearPublishFormState: () => dispatch(doClearPublishFormState()),
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
updatePublishFormState: data => dispatch(doUpdatePublishFormState(data)),
uploadThumbnail: (filePath, fsAdapter) => dispatch(doUploadThumbnail(filePath, null, fsAdapter)),
publish: (success, fail) => dispatch(doPublish(success, fail)),
resolveUri: uri => dispatch(doResolveUri(uri)),
pushDrawerStack: () => dispatch(doPushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH)),
pushDrawerStack: (routeName, params) => dispatch(doPushDrawerStack(routeName, params)),
popDrawerStack: () => dispatch(doPopDrawerStack()),
setPlayerVisible: () => dispatch(doSetPlayerVisible(false)),
});
+194 -81
View File
@@ -19,6 +19,7 @@ import {
isNameValid,
buildURI,
normalizeURI,
parseURI,
regexInvalidURI,
CLAIM_VALUES,
LICENSES,
@@ -27,7 +28,6 @@ import {
} from 'lbry-redux';
import { RNCamera } from 'react-native-camera';
import { generateCombination } from 'gfycat-style-urls';
import DocumentPicker from 'react-native-document-picker';
import RNFS from 'react-native-fs';
import Button from 'component/button';
import ChannelSelector from 'component/channelSelector';
@@ -79,10 +79,12 @@ class PublishPage extends React.PureComponent {
state = {
canPublish: false,
canUseCamera: false,
documentPickerOpen: false,
editMode: false,
titleFocused: false,
descriptionFocused: false,
loadingVideos: false,
vanityUrl: null,
// gallery videos
videos: null,
@@ -101,7 +103,7 @@ class PublishPage extends React.PureComponent {
currentMedia: null,
currentThumbnailUri: null,
updatingThumbnailUri: false,
currentPhase: Constants.PHASE_SELECTOR,
currentPhase: null,
// publish
advancedMode: false,
@@ -120,10 +122,12 @@ class PublishPage extends React.PureComponent {
otherLicenseDescription: '',
name: null,
price: 0,
currency: 'LBC',
uri: null,
tags: [],
selectedChannel: null,
uploadedThumbnailUri: null,
vanityUrlSet: false,
// other
publishStarted: false,
@@ -136,6 +140,8 @@ class PublishPage extends React.PureComponent {
// this.didFocusListener = navigation.addListener('didFocus', this.onComponentFocused);
DeviceEventEmitter.addListener('onGalleryThumbnailChecked', this.handleGalleryThumbnailChecked);
DeviceEventEmitter.addListener('onAllGalleryThumbnailsChecked', this.handleAllGalleryThumbnailsChecked);
DeviceEventEmitter.addListener('onDocumentPickerFilePicked', this.onFilePicked);
DeviceEventEmitter.addListener('onDocumentPickerCanceled', this.onPickerCanceled);
}
componentWillUnmount() {
@@ -144,6 +150,8 @@ class PublishPage extends React.PureComponent {
}
DeviceEventEmitter.removeListener('onGalleryThumbnailChecked', this.handleGalleryThumbnailChecked);
DeviceEventEmitter.removeListener('onAllGalleryThumbnailsChecked', this.handleAllGalleryThumbnailsChecked);
DeviceEventEmitter.removeListener('onDocumentPickerFilePicked', this.onFilePicked);
DeviceEventEmitter.removeListener('onDocumentPickerCanceled', this.onPickerCanceled);
}
handleGalleryThumbnailChecked = evt => {
@@ -160,12 +168,18 @@ class PublishPage extends React.PureComponent {
this.setState({ allThumbnailsChecked: true });
};
onComponentFocused = () => {
const { balance, pushDrawerStack, setPlayerVisible, navigation } = this.props;
pushDrawerStack();
setPlayerVisible();
loadPendingFormState = () => {
const { publishFormState } = this.props;
const advancedMode = publishFormState.license !== null;
this.setState({ ...publishFormState, advancedMode });
};
onComponentFocused = () => {
const { balance, hasFormState, pushDrawerStack, setPlayerVisible, navigation } = this.props;
NativeModules.Firebase.setCurrentScreen('Publish').then(result => {
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH, navigation.state.params ? navigation.state.params : null);
setPlayerVisible();
NativeModules.Gallery.canUseCamera().then(canUseCamera => this.setState({ canUseCamera }));
NativeModules.Gallery.getThumbnailPath().then(thumbnailPath => this.setState({ thumbnailPath }));
this.setState(
@@ -179,19 +193,44 @@ class PublishPage extends React.PureComponent {
);
// Check if this is an edit action
let isEditMode = false,
vanityUrlSet = false;
if (navigation.state.params) {
const { editMode, claimToEdit } = navigation.state.params;
const { displayForm, editMode, claimToEdit, vanityUrl } = navigation.state.params;
if (editMode) {
this.prepareEdit(claimToEdit);
isEditMode = true;
} else if (vanityUrl) {
const { claimName } = parseURI(vanityUrl);
vanityUrlSet = true;
this.setState({
name: claimName,
hasEditedContentAddress: true,
vanityUrlSet,
vanityUrl: claimName,
});
}
}
if (!isEditMode && hasFormState) {
this.loadPendingFormState();
if (vanityUrlSet) {
// replace name with the specified vanity URL if there was one in the pending state
this.setState({ name: this.state.vanityUrl });
}
this.setState({ currentPhase: Constants.PHASE_DETAILS });
} else {
this.setState({ currentPhase: Constants.PHASE_SELECTOR });
}
});
};
prepareEdit = claim => {
let channelName;
const { pushDrawerStack } = this.props;
const { amount, name, signing_channel: signingChannel, value } = claim;
const { description, fee, languages, license, license_url: licenseUrl, tags, thumbnail, title } = value;
let channelName;
if (signingChannel) {
channelName = signingChannel.name;
}
@@ -228,18 +267,21 @@ class PublishPage extends React.PureComponent {
licenseUrl,
otherLicenseDescription,
name,
currency: fee && fee.currency ? fee.currency : 'LBC',
price: fee && fee.amount ? fee.amount : 0,
priceSet: fee && fee.amount > 0,
tags: tags && tags.length > 0 ? tags : [],
title,
currentThumbnailUri: thumbnailUrl,
uploadedThumbnailUri: thumbnailUrl,
vanityUrlSet: false,
},
() => {
this.handleNameChange(name);
if (channelName) {
this.handleChannelChange(channelName);
}
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM);
}
);
};
@@ -282,6 +324,7 @@ class PublishPage extends React.PureComponent {
bid,
channelName,
currentMedia,
currency,
description,
language,
license,
@@ -325,7 +368,7 @@ class PublishPage extends React.PureComponent {
otherLicenseDescription,
name: name || undefined,
contentIsFree: !priceSet,
fee: { currency: 'LBC', amount: price },
fee: { currency, amount: price },
uri: uri || undefined,
channel: CLAIM_VALUES.CHANNEL_ANONYMOUS === channelName ? null : channelName,
isStillEditing: false,
@@ -357,8 +400,8 @@ class PublishPage extends React.PureComponent {
}
componentWillReceiveProps(nextProps) {
const { currentRoute, publishFormValues } = nextProps;
const { currentRoute: prevRoute, notify } = this.props;
const { currentRoute: prevRoute, drawerStack: prevDrawerStack, notify, updatePublishFormState } = this.props;
const { currentRoute, drawerStack, publishFormValues } = nextProps;
if (Constants.DRAWER_ROUTE_PUBLISH === currentRoute && currentRoute !== prevRoute) {
this.onComponentFocused();
@@ -366,24 +409,38 @@ class PublishPage extends React.PureComponent {
if (publishFormValues) {
if (publishFormValues.thumbnail && !this.state.uploadedThumbnailUri) {
this.setState({
currentThumbnailUri: publishFormValues.thumbnail,
uploadedThumbnailUri: publishFormValues.thumbnail,
});
const { thumbnail } = publishFormValues;
updatePublishFormState({ currentThumbnailUri: thumbnail, uploadedThumbnailUri: thumbnail });
this.setState({ currentThumbnailUri: thumbnail, uploadedThumbnailUri: thumbnail });
}
}
if (
this.state.currentPhase === Constants.PHASE_DETAILS &&
prevDrawerStack[prevDrawerStack.length - 1].route === Constants.DRAWER_ROUTE_PUBLISH_FORM &&
drawerStack[drawerStack.length - 1].route === Constants.DRAWER_ROUTE_PUBLISH
) {
// navigated back from the form
this.showSelector();
}
}
setCurrentMedia(media) {
const { pushDrawerStack, updatePublishFormState } = this.props;
const name = generateCombination(2, ' ', true);
const newName = this.state.hasEditedContentAddress ? this.state.name : this.formatNameForTitle(name);
updatePublishFormState({ currentMedia: media, name: newName });
this.setState(
{
currentMedia: media,
title: null, // no title autogeneration (user will fill this in)
name: this.formatNameForTitle(name),
name: newName,
currentPhase: Constants.PHASE_DETAILS,
},
() => this.handleNameChange(this.state.name)
() => {
this.handleNameChange(this.state.name);
pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM);
}
);
}
@@ -397,7 +454,9 @@ class PublishPage extends React.PureComponent {
this.setState(
{
publishStarted: false,
documentPickerOpen: false,
editMode: false,
vanityUrl: null,
currentMedia: null,
currentThumbnailUri: null,
@@ -426,6 +485,8 @@ class PublishPage extends React.PureComponent {
tags: [],
selectedChannel: null,
uploadedThumbnailUri: null,
vanityUrlSet: false,
},
() => {
// reset thumbnail
@@ -446,6 +507,36 @@ class PublishPage extends React.PureComponent {
}
};
handleUploadPressed = () => {
if (this.state.documentPickerOpen) {
return;
}
this.setState(
{
documentPickerOpen: true,
},
() => {
NativeModules.UtilityModule.openDocumentPicker('*/*');
}
);
};
onFilePicked = evt => {
this.setState({ documentPickerOpen: false }, () => {
const currentMedia = {
id: -1,
filePath: `file://${evt.path}`,
duration: 0,
};
this.setCurrentMedia(currentMedia);
});
};
onPickerCanceled = () => {
this.setState({ documentPickerOpen: false });
};
handleCloseCameraPressed = () => {
this.setState({ showCameraOverlay: false, videoRecordingMode: false });
};
@@ -455,6 +546,8 @@ class PublishPage extends React.PureComponent {
};
handleCameraActionPressed = () => {
const { pushDrawerStack } = this.props;
// check if it's video or photo mode
if (this.state.videoRecordingMode) {
if (this.state.recordingVideo) {
@@ -472,14 +565,17 @@ class PublishPage extends React.PureComponent {
duration: 0,
};
this.setCurrentMedia(currentMedia);
this.setState({
currentThumbnailUri: null,
updatingThumbnailUri: false,
currentPhase: Constants.PHASE_DETAILS,
showCameraOverlay: false,
videoRecordingMode: false,
recordingVideo: false,
});
this.setState(
{
currentThumbnailUri: null,
updatingThumbnailUri: false,
currentPhase: Constants.PHASE_DETAILS,
showCameraOverlay: false,
videoRecordingMode: false,
recordingVideo: false,
},
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH_FORM)
);
});
}
} else {
@@ -493,13 +589,16 @@ class PublishPage extends React.PureComponent {
duration: 0,
};
this.setCurrentMedia(currentMedia);
this.setState({
currentPhase: Constants.PHASE_DETAILS,
currentThumbnailUri: null,
updatingThumbnailUri: false,
showCameraOverlay: false,
videoRecordingMode: false,
});
this.setState(
{
currentPhase: Constants.PHASE_DETAILS,
currentThumbnailUri: null,
updatingThumbnailUri: false,
showCameraOverlay: false,
videoRecordingMode: false,
},
() => pushDrawerStack(Constants.DRAWER_ROUTE_PUBLISH)
);
});
}
};
@@ -512,18 +611,7 @@ class PublishPage extends React.PureComponent {
});
};
handleUploadPressed = () => {
DocumentPicker.pick({ type: [DocumentPicker.types.allFiles] })
.then(file => {
// console.log(file);
})
.catch(error => {
if (!DocumentPicker.isCancel(error)) {
// notify the user
// console.log(error);
}
});
};
handleUploadPressed = () => {};
getRandomFileId = () => {
// generate a random id for a photo or recorded video between 1 and 20 (for creating thumbnails)
@@ -536,15 +624,20 @@ class PublishPage extends React.PureComponent {
};
handleBidChange = bid => {
const { updatePublishFormState } = this.props;
updatePublishFormState({ bid });
this.setState({ bid });
};
handlePriceChange = price => {
const { updatePublishFormState } = this.props;
updatePublishFormState({ price });
this.setState({ price });
};
handleNameChange = (name, userInput) => {
const { notify } = this.props;
const { notify, updatePublishFormState } = this.props;
updatePublishFormState({ name });
this.setState({ name });
if (userInput) {
this.setState({ hasEditedContentAddress: true });
@@ -560,8 +653,10 @@ class PublishPage extends React.PureComponent {
};
handleChannelChange = channel => {
const { updatePublishFormState } = this.props;
const { name } = this.state;
const uri = this.getNewUri(name, channel);
updatePublishFormState({ uri, channelName: channel, selectedChannel: channel });
this.setState({ uri, channelName: channel, selectedChannel: channel });
};
@@ -570,12 +665,13 @@ class PublishPage extends React.PureComponent {
return;
}
const { notify } = this.props;
const { notify, updatePublishFormState } = this.props;
const { tags } = this.state;
const index = tags.indexOf(tag.toLowerCase());
if (index === -1) {
const newTags = tags.slice();
newTags.push(tag);
updatePublishFormState({ tags: newTags });
this.setState({ tags: newTags });
} else {
notify({ message: __(`You already added the "${tag}" tag.`) });
@@ -587,11 +683,13 @@ class PublishPage extends React.PureComponent {
return;
}
const { updatePublishFormState } = this.props;
const newTags = this.state.tags.slice();
const index = newTags.indexOf(tag.toLowerCase());
if (index > -1) {
newTags.splice(index, 1);
updatePublishFormState({ tags: newTags });
this.setState({ tags: newTags });
}
};
@@ -639,6 +737,8 @@ class PublishPage extends React.PureComponent {
};
handleTitleChange = title => {
const { updatePublishFormState } = this.props;
updatePublishFormState({ title });
this.setState({ title });
if (!this.state.editMode && !this.state.hasEditedContentAddress) {
@@ -655,35 +755,47 @@ class PublishPage extends React.PureComponent {
}
};
handleCurrencyValueChange = currency => {
const { updatePublishFormState } = this.props;
updatePublishFormState({ currency });
this.setState({ currency });
};
handleDescriptionChange = description => {
const { updatePublishFormState } = this.props;
updatePublishFormState({ description });
this.setState({ description });
};
handleLanguageValueChange = language => {
const { updatePublishFormState } = this.props;
updatePublishFormState({ language });
this.setState({ language });
};
handleLicenseValueChange = license => {
const { updatePublishFormState } = this.props;
const otherLicenseDescription = [LICENSES.COPYRIGHT, LICENSES.OTHER].includes(license)
? this.state.otherLicenseDescription
: '';
this.setState({
otherLicenseDescription,
license,
licenseUrl: LICENSES.CC_LICENSES.reduce((value, item) => {
if (typeof value === 'object') {
value = '';
}
if (license === item.value) {
value = item.url;
}
return value;
}),
const licenseUrl = LICENSES.CC_LICENSES.reduce((value, item) => {
if (typeof value === 'object') {
value = '';
}
if (license === item.value) {
value = item.url;
}
return value;
});
updatePublishFormState({ otherLicenseDescription, license, licenseUrl });
this.setState({ otherLicenseDescription, license, licenseUrl });
};
handleChangeLicenseDescription = otherLicenseDescription => {
const { updatePublishFormState } = this.props;
updatePublishFormState({ otherLicenseDescription });
this.setState({ otherLicenseDescription });
};
@@ -727,12 +839,10 @@ class PublishPage extends React.PureComponent {
<Icon name="camera" size={48} color={Colors.White} />
<Text style={publishStyle.actionText}>Take a photo</Text>
</TouchableOpacity>
{false && (
<TouchableOpacity style={publishStyle.upload} onPress={this.handleUploadPressed}>
<Icon name="file-upload" size={48} color={Colors.White} />
<Text style={publishStyle.actionText}>Upload a file</Text>
</TouchableOpacity>
)}
<TouchableOpacity style={publishStyle.upload} onPress={this.handleUploadPressed}>
<Icon name="file-upload" size={48} color={Colors.White} />
<Text style={publishStyle.actionText}>Upload a file</Text>
</TouchableOpacity>
</View>
</View>
</View>
@@ -790,17 +900,17 @@ class PublishPage extends React.PureComponent {
resizeMode={FastImage.resizeMode.contain}
source={{ uri: currentThumbnailUri }}
/>
{this.state.uploadThumbnailStarted && !this.state.uploadedThumbnailUri && (
<View style={publishStyle.thumbnailUploadContainer}>
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
<Text style={publishStyle.thumbnailUploadText}>Uploading thumbnail...</Text>
</View>
)}
</View>
)}
{!this.state.canPublish && <PublishRewardsDriver navigation={navigation} />}
{this.state.uploadThumbnailStarted && !this.state.uploadedThumbnailUri && (
<View style={publishStyle.thumbnailUploadContainer}>
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
<Text style={publishStyle.thumbnailUploadText}>Uploading thumbnail...</Text>
</View>
)}
<View style={publishStyle.card}>
<View style={publishStyle.textInputLayout}>
{(this.state.titleFocused || (this.state.title != null && this.state.title.trim().length > 0)) && (
@@ -826,6 +936,7 @@ class PublishPage extends React.PureComponent {
)}
<TextInput
editable={this.state.canPublish && !this.state.publishStarted}
multiline
placeholder={this.state.descriptionFocused ? '' : 'Description'}
style={publishStyle.inputText}
value={this.state.description}
@@ -888,7 +999,16 @@ class PublishPage extends React.PureComponent {
value={String(this.state.price)}
onChangeText={this.handlePriceChange}
/>
<Text style={publishStyle.currency}>LBC</Text>
<Picker
style={publishStyle.currencyPicker}
enabled={this.state.canPublish && !this.state.publishStarted}
selectedValue={this.state.currency}
itemStyle={publishStyle.pickerItem}
onValueChange={this.handleCurrencyValueChange}
>
<Picker.Item label={'LBC'} value={'LBC'} />
<Picker.Item label={'USD'} value={'USD'} />
</Picker>
</View>
)}
</View>
@@ -984,17 +1104,10 @@ class PublishPage extends React.PureComponent {
/>
</View>
<View style={publishStyle.warning}>
<Text style={publishStyle.warningText}>
Please ensure that you have filled everything correctly as you cannot edit published content in this
release. This feature will be available in a future release.
</Text>
</View>
<View style={publishStyle.actionButtons}>
{(this.state.publishStarted || publishFormValues.publishing) && (
<View style={publishStyle.progress}>
<ActivityIndicator size={'small'} color={Colors.LbryGreen} />
<ActivityIndicator size={'small'} color={Colors.NextLbryGreen} />
</View>
)}
+18
View File
@@ -33,6 +33,15 @@ class PublishesPage extends React.PureComponent {
this.onComponentFocused();
}
componentWillReceiveProps(nextProps) {
const { currentRoute } = nextProps;
const { currentRoute: prevRoute } = this.props;
if (Constants.DRAWER_ROUTE_PUBLISHES === currentRoute && currentRoute !== prevRoute) {
this.onComponentFocused();
}
}
onComponentFocused = () => {
const { checkPendingPublishes, fetchMyClaims, pushDrawerStack, setPlayerVisible } = this.props;
pushDrawerStack();
@@ -148,6 +157,15 @@ class PublishesPage extends React.PureComponent {
initialNumToRender={8}
maxToRenderPerBatch={24}
removeClippedSubviews
ListFooterComponent={
<View style={publishStyle.publishesFooter}>
<Button
style={publishStyle.publishesFooterButton}
text={__('Publish something new')}
onPress={() => navigation.navigate({ routeName: Constants.DRAWER_ROUTE_PUBLISH })}
/>
</View>
}
renderItem={({ item }) => (
<FileListItem
key={item}
+1 -7
View File
@@ -101,13 +101,7 @@ class SearchPage extends React.PureComponent {
const { currentUri } = this.state;
return (
<FileListItem
uri={currentUri}
featuredResult
style={searchStyle.featuredResultItem}
navigation={navigation}
onPress={() => navigateToUri(navigation, this.state.currentUri)}
/>
<FileListItem uri={currentUri} featuredResult style={searchStyle.featuredResultItem} navigation={navigation} />
);
};
+5 -5
View File
@@ -3,7 +3,7 @@ import { Lbry } from 'lbry-redux';
import { ActivityIndicator, Linking, NativeModules, Platform, Text, View } from 'react-native';
import { NavigationActions, StackActions } from 'react-navigation';
import { decode as atob } from 'base-64';
import { navigateToUri } from 'utils/helper';
import { navigateToUri, transformUrl } from 'utils/helper';
import moment from 'moment';
import AsyncStorage from '@react-native-community/async-storage';
import Button from 'component/button';
@@ -81,7 +81,7 @@ class SplashScreen extends React.PureComponent {
});
}
} else {
navigateToUri(navigation, launchUrl);
navigateToUri(navigation, transformUrl(launchUrl));
}
}
};
@@ -130,7 +130,7 @@ class SplashScreen extends React.PureComponent {
if (user && user.id && user.has_verified_email) {
// user already authenticated
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
if (walletPassword && walletPassword.trim().length > 0) {
if (walletPassword) {
getSync(walletPassword);
}
this.navigateToMain();
@@ -166,14 +166,14 @@ class SplashScreen extends React.PureComponent {
// For now, automatically unlock the wallet if a password is set so that downloads work
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(password => {
if (password && password.trim().length > 0) {
if (password) {
this.setState({
message: 'Unlocking account',
details: 'Decrypting wallet',
});
// unlock the wallet and then finish the splash screen
Lbry.account_unlock({ password })
Lbry.account_unlock({ password: password || '' })
.then(() => {
this.setState({
message: testingNetwork,
+3 -3
View File
@@ -29,7 +29,7 @@ import {
} from 'lbryinc';
import { doSetClientSetting } from 'redux/actions/settings';
import { makeSelectClientSetting } from 'redux/selectors/settings';
import Constants from 'constants';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import Verification from './view';
const select = state => ({
@@ -54,13 +54,13 @@ const select = state => ({
const perform = dispatch => ({
addUserEmail: email => dispatch(doUserEmailNew(email)),
addUserPhone: (phone, country_code) => dispatch(doUserPhoneNew(phone, country_code)),
addUserPhone: (phone, countryCode) => dispatch(doUserPhoneNew(phone, countryCode)),
getSync: password => dispatch(doGetSync(password)),
checkSync: () => dispatch(doCheckSync()),
verifyPhone: verificationCode => dispatch(doUserPhoneVerify(verificationCode)),
notify: data => dispatch(doToast(data)),
setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
setDefaultAccount: () => dispatch(doSetDefaultAccount()),
setDefaultAccount: (success, failure) => dispatch(doSetDefaultAccount(success, failure)),
setEmailToVerify: email => dispatch(doUserEmailToVerify(email)),
syncApply: (hash, data, password) => dispatch(doSyncApply(hash, data, password)),
resendVerificationEmail: email => dispatch(doUserResendVerificationEmail(email)),
@@ -5,7 +5,7 @@ import { BarPasswordStrengthDisplay } from 'react-native-password-strength-meter
import Button from 'component/button';
import Link from 'component/link';
import Colors from 'styles/colors';
import Constants from 'constants';
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
import firstRunStyle from 'styles/firstRun';
import Icon from 'react-native-vector-icons/FontAwesome5';
import rewardStyle from 'styles/reward';
@@ -62,11 +62,29 @@ class SyncVerifyPage extends React.PureComponent {
} else {
// password successfully verified
if (NativeModules.UtilityModule) {
NativeModules.UtilityModule.setSecureValue(Constants.KEY_FIRST_RUN_PASSWORD, this.state.password);
NativeModules.UtilityModule.setSecureValue(
Constants.KEY_FIRST_RUN_PASSWORD,
this.state.password ? this.state.password : ''
);
}
setDefaultAccount();
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
navigation.goBack();
setDefaultAccount(
() => {
setClientSetting(Constants.SETTING_DEVICE_WALLET_SYNCED, true);
// unlock the wallet
Lbry.account_unlock({ password: this.state.password ? this.state.password : '' })
.then(() => navigation.goBack())
.catch(err =>
notify({ message: 'The wallet could not be unlocked at this time. Please restart the app.' })
);
},
err => {
notify({
message:
'The account restore operation could not be completed successfully. Please restart the app and try again.',
});
}
);
}
}
}
+1 -1
View File
@@ -47,7 +47,7 @@ class WalletPage extends React.PureComponent {
const { deviceWalletSynced, getSync, user } = this.props;
if (deviceWalletSynced && user && user.has_verified_email) {
NativeModules.UtilityModule.getSecureValue(Constants.KEY_FIRST_RUN_PASSWORD).then(walletPassword => {
if (walletPassword && walletPassword.trim().length > 0) {
if (walletPassword) {
getSync(walletPassword);
}
});
+23
View File
@@ -0,0 +1,23 @@
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
export const doUpdatePublishFormState = publishFormValue => dispatch =>
dispatch({
type: Constants.ACTION_UPDATE_PUBLISH_FORM_STATE,
data: { ...publishFormValue },
});
export const doUpdateChannelFormState = channelFormValue => dispatch =>
dispatch({
type: Constants.ACTION_UPDATE_CHANNEL_FORM_STATE,
data: { ...channelFormValue },
});
export const doClearPublishFormState = () => dispatch =>
dispatch({
type: Constants.ACTION_CLEAR_PUBLISH_FORM_STATE,
});
export const doClearChannelFormState = () => dispatch =>
dispatch({
type: Constants.ACTION_CLEAR_CHANNEL_FORM_STATE,
});
+13 -1
View File
@@ -16,7 +16,19 @@ reducers[Constants.ACTION_PUSH_DRAWER_STACK] = (state, action) => {
const { routeName, params } = action.data;
const newStack = state.stack.slice();
if (routeName !== newStack[newStack.length - 1].route) {
const lastRoute = newStack[newStack.length - 1].route;
let canPushStack = routeName !== lastRoute;
if (
lastRoute === Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM &&
routeName === Constants.DRAWER_ROUTE_CHANNEL_CREATOR
) {
canPushStack = false;
}
if (lastRoute === Constants.DRAWER_ROUTE_PUBLISH_FORM && routeName === Constants.DRAWER_ROUTE_PUBLISH) {
canPushStack = false;
}
if (canPushStack) {
newStack.push({ route: routeName, params });
}
+49
View File
@@ -0,0 +1,49 @@
import Constants from 'constants'; // eslint-disable-line node/no-deprecated-api
const reducers = {};
const defaultState = {
channelFormValues: {},
publishFormValues: {},
};
reducers[Constants.ACTION_UPDATE_PUBLISH_FORM_STATE] = (state, action) => {
const { data } = action;
const publishFormValues = Object.assign({}, state.publishFormValues);
const newPublishFormValues = Object.assign(publishFormValues, data);
return {
...state,
publishFormValues: newPublishFormValues,
};
};
reducers[Constants.ACTION_UPDATE_CHANNEL_FORM_STATE] = (state, action) => {
const { data } = action;
const channelFormValues = Object.assign({}, state.channelFormValues);
const newChannelFormValues = Object.assign(channelFormValues, data);
return {
...state,
channelFormValues: newChannelFormValues,
};
};
reducers[Constants.ACTION_CLEAR_PUBLISH_FORM_STATE] = state => {
return {
...state,
publishFormValues: {},
};
};
reducers[Constants.ACTION_CLEAR_CHANNEL_FORM_STATE] = state => {
return {
...state,
channelFormValues: {},
};
};
export default function reducer(state = defaultState, action) {
const handler = reducers[action.type];
if (handler) return handler(state, action);
return state;
}
+23
View File
@@ -0,0 +1,23 @@
import { createSelector } from 'reselect';
export const selectState = state => state.form || {};
export const selectPublishFormState = createSelector(
selectState,
state => state.publishFormValues || {}
);
export const selectChannelFormState = createSelector(
selectState,
state => state.channelFormValues || {}
);
export const selectHasPublishFormState = createSelector(
selectPublishFormState,
values => Object.keys(values).length > 0
);
export const selectHasChannelFormState = createSelector(
selectChannelFormState,
values => Object.keys(values).length > 0
);
+18
View File
@@ -4,6 +4,9 @@ const autothumbStyle = StyleSheet.create({
autothumbPurple: {
backgroundColor: '#9c27b0',
},
autothumbDeepPurple: {
backgroundColor: '#5e35b1',
},
autothumbRed: {
backgroundColor: '#e53935',
},
@@ -34,6 +37,21 @@ const autothumbStyle = StyleSheet.create({
autothumbOrange: {
backgroundColor: '#ffa726',
},
autothumbAmber: {
backgroundColor: '#ffb300',
},
autothumbLime: {
backgroundColor: '#c0ca33',
},
autothumbLightGreen: {
backgroundColor: '#7cb342',
},
autothumbDeepOrange: {
backgroundColor: '#f4511e',
},
autothumbBrown: {
backgroundColor: '#6d4c41',
},
});
export default autothumbStyle;
+259
View File
@@ -0,0 +1,259 @@
import { Dimensions, StyleSheet } from 'react-native';
import Colors from './colors';
const screenDimension = Dimensions.get('window');
const screenWidth = screenDimension.width;
const channelCreatorStyle = StyleSheet.create({
card: {
backgroundColor: Colors.White,
marginTop: 16,
marginLeft: 16,
marginRight: 16,
padding: 16,
},
container: {
flex: 1,
backgroundColor: Colors.PageBackground,
},
channelPicker: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
height: 52,
width: '100%',
},
bidRow: {
flexDirection: 'row',
alignItems: 'center',
},
label: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
},
channelNameInput: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
paddingLeft: 20,
},
bidAmountInput: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
marginLeft: 16,
textAlign: 'right',
width: 80,
},
helpText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 12,
},
channelTitleInput: {
marginBottom: 4,
},
createChannelContainer: {
marginTop: 60,
flex: 1,
},
channelAt: {
position: 'absolute',
left: 4,
top: 13,
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
},
buttonContainer: {
marginTop: 24,
marginBottom: 16,
},
buttons: {
marginLeft: 16,
marginRight: 16,
flexDirection: 'row',
alignItems: 'center',
justifyContent: 'space-between',
},
cancelLink: {
marginRight: 16,
},
createButton: {
backgroundColor: Colors.LbryGreen,
alignSelf: 'flex-end',
},
inlineError: {
fontFamily: 'Inter-UI-Regular',
fontSize: 12,
color: Colors.Red,
marginTop: 2,
},
imageSelectors: {
width: '100%',
height: 160,
},
coverImageTouchArea: {
position: 'absolute',
left: 0,
right: 0,
top: 0,
bottom: 0,
alignItems: 'center',
justifyContent: 'center',
},
coverImage: {
width: '100%',
height: '100%',
},
avatarImageContainer: {
position: 'absolute',
left: screenWidth / 2 - 80 / 2,
bottom: -16,
width: 80,
height: 80,
borderRadius: 160,
overflow: 'hidden',
},
avatarTouchArea: {
width: 80,
height: 80,
alignItems: 'center',
justifyContent: 'center',
},
avatarImage: {
width: '100%',
height: '100%',
},
listFooter: {
marginTop: 24,
},
createChannelButton: {
backgroundColor: Colors.LbryGreen,
alignSelf: 'flex-start',
},
scrollContainer: {
marginTop: 60,
},
scrollPadding: {
padding: 16,
},
channelListItem: {
flexDirection: 'row',
marginBottom: 16,
alignItems: 'center',
},
channelListTitle: {
fontFamily: 'Inter-UI-Regular',
fontSize: 18,
marginBottom: 4,
},
channelListName: {
fontFamily: 'Inter-UI-Regular',
fontSize: 14,
},
channelListAvatar: {
marginRight: 16,
width: 80,
height: 80,
borderRadius: 160,
overflow: 'hidden',
alignItems: 'center',
justifyContent: 'center',
},
selectedOverlay: {
position: 'absolute',
left: 0,
top: 0,
width: 80,
height: 80,
borderRadius: 160,
overflow: 'hidden',
alignItems: 'center',
justifyContent: 'center',
backgroundColor: '#000000aa',
},
listHeader: {
alignItems: 'center',
marginTop: 16,
marginBottom: 16,
},
textInputLayout: {
marginBottom: 4,
},
textInputTitle: {
fontFamily: 'Inter-UI-Regular',
fontSize: 12,
marginBottom: -10,
marginLeft: 4,
},
inputText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 16,
},
toggleContainer: {
marginTop: 24,
alignItems: 'center',
justifyContent: 'flex-end',
},
modeLink: {
color: Colors.LbryGreen,
alignSelf: 'flex-end',
marginRight: 16,
},
cardTitle: {
fontFamily: 'Inter-UI-Regular',
fontSize: 20,
marginBottom: 8,
},
tag: {
marginRight: 4,
marginBottom: 4,
},
tagList: {
flexDirection: 'row',
flexWrap: 'wrap',
},
editOverlay: {
alignItems: 'center',
justifyContent: 'center',
borderRadius: 24,
position: 'absolute',
padding: 8,
left: 4,
bottom: 4,
backgroundColor: '#00000077',
},
thumbnailEditOverlay: {
alignItems: 'center',
justifyContent: 'center',
borderRadius: 24,
position: 'absolute',
padding: 8,
left: 80 / 2 - 32 / 2,
bottom: 4,
backgroundColor: '#00000077',
},
editIcon: {
color: Colors.White,
fontFamily: 'Inter-UI-SemiBold',
fontSize: 12,
},
uploadProgress: {
alignItems: 'center',
borderRadius: 16,
flexDirection: 'row',
position: 'absolute',
top: 8,
right: 8,
backgroundColor: '#00000077',
paddingLeft: 8,
paddingRight: 8,
paddingTop: 4,
paddingBottom: 4,
justifyContent: 'center',
},
uploadText: {
color: Colors.White,
fontFamily: 'Inter-UI-SemiBold',
fontSize: 12,
marginLeft: 4,
},
});
export default channelCreatorStyle;
+4
View File
@@ -31,6 +31,7 @@ const channelPageStyle = StyleSheet.create({
flex: 1,
justifyContent: 'center',
alignItems: 'center',
padding: 24,
},
infoText: {
fontFamily: 'Inter-UI-Regular',
@@ -165,6 +166,9 @@ const channelPageStyle = StyleSheet.create({
claimListContent: {
paddingTop: 16,
},
actionButton: {
backgroundColor: Colors.White,
},
});
export default channelPageStyle;
+4
View File
@@ -22,6 +22,10 @@ const discoverStyle = StyleSheet.create({
flex: 1,
backgroundColor: Colors.PageBackground,
},
drawerContentArea: {
flex: 1,
backgroundColor: Colors.White,
},
drawerContentContainer: {
flex: 1,
},
+2 -2
View File
@@ -41,8 +41,8 @@ const filePageStyle = StyleSheet.create({
fontFamily: 'Inter-UI-Regular',
textAlign: 'center',
fontSize: 20,
marginLeft: 16,
marginRight: 16,
marginLeft: 24,
marginRight: 24,
},
scrollContainer: {
flex: 1,
+33 -10
View File
@@ -86,7 +86,7 @@ const publishStyle = StyleSheet.create({
marginTop: 8,
},
photo: {
height: 240,
height: 120,
justifyContent: 'center',
alignItems: 'center',
},
@@ -156,6 +156,10 @@ const publishStyle = StyleSheet.create({
fontSize: 16,
marginLeft: 8,
},
listEmptyText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 14,
},
titleRow: {
flexDirection: 'row',
justifyContent: 'space-between',
@@ -324,18 +328,24 @@ const publishStyle = StyleSheet.create({
marginLeft: 4,
},
thumbnailUploadContainer: {
marginTop: 16,
marginLeft: 16,
marginRight: 16,
paddingLeft: 2,
paddingRight: 2,
flexDirection: 'row',
alignItems: 'center',
borderRadius: 16,
flexDirection: 'row',
position: 'absolute',
top: 8,
right: 8,
backgroundColor: '#00000077',
paddingLeft: 8,
paddingRight: 8,
paddingTop: 4,
paddingBottom: 4,
justifyContent: 'center',
},
thumbnailUploadText: {
fontFamily: 'Inter-UI-Regular',
fontSize: 14,
marginLeft: 8,
color: Colors.White,
fontFamily: 'Inter-UI-SemiBold',
fontSize: 12,
marginLeft: 4,
},
toggleField: {
flexDirection: 'row',
@@ -362,6 +372,9 @@ const publishStyle = StyleSheet.create({
alignItems: 'center',
justifyContent: 'center',
},
currencyPicker: {
width: 100,
},
fullCentered: {
position: 'absolute',
left: 0,
@@ -420,6 +433,16 @@ const publishStyle = StyleSheet.create({
fontSize: 14,
color: Colors.DescriptionGrey,
},
publishesFooter: {
marginTop: 16,
marginLeft: 16,
marginRight: 16,
},
publishesFooterButton: {
alignSelf: 'flex-start',
backgroundColor: Colors.LbryGreen,
marginTop: 16,
},
});
export default publishStyle;
+85 -7
View File
@@ -1,7 +1,7 @@
import { NavigationActions, StackActions } from 'react-navigation';
import { buildURI, isURIValid } from 'lbry-redux';
import { buildURI, isURIValid, normalizeURI } from 'lbry-redux';
import { doPopDrawerStack, doPushDrawerStack, doSetPlayerVisible } from 'redux/actions/drawer';
import Constants, { DrawerRoutes } from 'constants'; // eslint-disable-line node/no-deprecated-api
import Constants, { DrawerRoutes, InnerDrawerRoutes } from 'constants'; // eslint-disable-line node/no-deprecated-api
const tagNameLength = 10;
@@ -156,10 +156,26 @@ export function navigateBack(navigation, drawerStack, popDrawerStack) {
const target = drawerStack[drawerStack.length > 1 ? drawerStack.length - 2 : 0];
const { route, params } = target;
navigation.goBack(navigation.state.key);
if (DrawerRoutes.indexOf(route) === -1 && isURIValid(route)) {
if (!DrawerRoutes.includes(route) && !InnerDrawerRoutes.includes(route) && isURIValid(route)) {
navigateToUri(navigation, route, null, true);
} else {
navigation.navigate({ routeName: route, params });
let targetRoute = route;
let targetParams = params;
if (InnerDrawerRoutes.includes(route)) {
if (Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM === route) {
targetRoute = Constants.DRAWER_ROUTE_CHANNEL_CREATOR;
} else if (Constants.DRAWER_ROUTE_PUBLISH_FORM === route) {
targetRoute = Constants.DRAWER_ROUTE_PUBLISH_FORM;
}
if (targetParams) {
targetParams.displayForm = true;
} else {
targetParams = { displayForm: true };
}
}
navigation.navigate({ routeName: targetRoute, targetParams });
}
}
@@ -169,14 +185,31 @@ export function dispatchNavigateBack(dispatch, nav, drawerStack) {
const target = drawerStack[drawerStack.length > 1 ? drawerStack.length - 2 : 0];
const { route } = target;
dispatch(NavigationActions.back());
if (DrawerRoutes.indexOf(route) === -1 && isURIValid(route)) {
if (!DrawerRoutes.includes(route) && !InnerDrawerRoutes.includes(route) && isURIValid(route)) {
dispatchNavigateToUri(dispatch, nav, route, true);
} else {
const newTarget = drawerStack[drawerStack.length > 1 ? drawerStack.length - 2 : 0];
let targetRoute = newTarget.route;
let targetParams = newTarget.params;
if (InnerDrawerRoutes.includes(targetRoute)) {
if (Constants.DRAWER_ROUTE_CHANNEL_CREATOR_FORM === route) {
targetRoute = Constants.DRAWER_ROUTE_CHANNEL_CREATOR;
} else if (Constants.DRAWER_ROUTE_PUBLISH_FORM === route) {
targetRoute = Constants.DRAWER_ROUTE_PUBLISH_FORM;
}
if (targetParams) {
targetParams.displayForm = true;
} else {
targetParams = { displayForm: true };
}
}
const navigateAction = NavigationActions.navigate({
routeName: newTarget.route,
params: newTarget.params,
routeName: targetRoute,
params: targetParams,
});
dispatch(navigateAction);
}
}
@@ -246,7 +279,52 @@ export function getOrderBy(item) {
return orderBy;
}
// replace occurrences of ':' with '#' in a url (entered in the URI bar)
export function transformUrl(url) {
const start = 'lbry://'.length;
return normalizeURI(url.substring(start).replace(/:/g, '#'));
}
// i18n placeholder until we find a good react-native i18n module
export function __(str) {
return str;
}
export function uploadImageAsset(filePath, success, failure) {
const makeid = () => {
let text = '';
const possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for (let i = 0; i < 24; i += 1) text += possible.charAt(Math.floor(Math.random() * 62));
return text;
};
const fileName = filePath.substring(filePath.lastIndexOf('/') + 1);
let fileExt = fileName.indexOf('.') > -1 ? fileName.substring(fileName.lastIndexOf('.') + 1).trim() : 0;
if (!fileExt) {
fileExt = 'jpg'; // default to jpg
}
const fileType = `image/${fileExt}`;
const data = new FormData();
const name = makeid();
data.append('name', name);
data.append('file', { uri: 'file://' + filePath, type: fileType, name: fileName });
return fetch('https://spee.ch/api/claim/publish', {
method: 'POST',
body: data,
})
.then(response => response.json())
.then(json => {
if (json.success) {
if (success) {
success({ url: `${json.data.url}.${fileExt}` });
}
}
})
.catch(err => {
if (failure) {
failure(err.message ? err.message : 'The image failed to upload.');
}
});
}