Compare commits
1249 Commits
v0.46.3
...
feat/code-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec16061c09 | ||
|
|
7fdc689776 | ||
|
|
9eba15b344 | ||
|
|
9825529b29 | ||
|
|
d44fdde33e | ||
|
|
7f0e3dc6b1 | ||
|
|
b6320384a0 | ||
|
|
04b47295ad | ||
|
|
7dc44194f9 | ||
|
|
5e1240df42 | ||
|
|
dc1738f1a5 | ||
|
|
25e999645c | ||
|
|
7dccba5813 | ||
|
|
49532920a6 | ||
|
|
2c90ad2136 | ||
|
|
469e9cddc0 | ||
|
|
0d850742f5 | ||
|
|
9192828505 | ||
|
|
dbbe499a86 | ||
|
|
bd42418ff3 | ||
|
|
4cc2f28f3d | ||
|
|
7a66be1d54 | ||
|
|
7702477e71 | ||
|
|
4e9a4f41c8 | ||
|
|
19c5132ac5 | ||
|
|
a33087440c | ||
|
|
11fdbcaee5 | ||
|
|
1f3035b2f9 | ||
|
|
d47b6eae0c | ||
|
|
dc1be2791f | ||
|
|
31ec01542f | ||
|
|
db2e1aafb1 | ||
|
|
d6aa72ed94 | ||
|
|
6b50d4e7b8 | ||
|
|
909b81c4ba | ||
|
|
af8b683308 | ||
|
|
db1b2909e8 | ||
|
|
659c9937b4 | ||
|
|
c92fc2e16b | ||
|
|
05383701af | ||
|
|
7d3653d787 | ||
|
|
15123d161d | ||
|
|
90b559618c | ||
|
|
b2c643d7f1 | ||
|
|
2be8575afb | ||
|
|
e52ad0c2f8 | ||
|
|
6a2c90d9ec | ||
|
|
1d12fc8102 | ||
|
|
1e4c79cf06 | ||
|
|
2e49421960 | ||
|
|
35955f067d | ||
|
|
dbdb9fcfe9 | ||
|
|
e361289c06 | ||
|
|
7521ac53a3 | ||
|
|
b6d613fe47 | ||
|
|
9be8a3036c | ||
|
|
6eebf8ff46 | ||
|
|
46f58c63c8 | ||
|
|
d21a4fe8ab | ||
|
|
3fb0ac80ae | ||
|
|
0b20f73841 | ||
|
|
5a6743a4ce | ||
|
|
6345549c88 | ||
|
|
e2bd128cc4 | ||
|
|
88c5552352 | ||
|
|
84bab875bc | ||
|
|
eb0e0cb7cc | ||
|
|
92ff0fd336 | ||
|
|
ea74a66dbd | ||
|
|
277a1d5d1f | ||
|
|
df17504649 | ||
|
|
0f096af963 | ||
|
|
9c1a0d8633 | ||
|
|
3fba7f0797 | ||
|
|
c67b92cfa4 | ||
|
|
812a06f001 | ||
|
|
9d03968b5e | ||
|
|
fd0e56daa6 | ||
|
|
94fe68eb45 | ||
|
|
351890decf | ||
|
|
dabdc980a1 | ||
|
|
891207df3d | ||
|
|
05740cad75 | ||
|
|
217ae3ecf7 | ||
|
|
bf5b2370e2 | ||
|
|
aa8b1f8602 | ||
|
|
52878efae1 | ||
|
|
e7adc607fa | ||
|
|
3d6304bc25 | ||
|
|
f0912f9051 | ||
|
|
1c14928f44 | ||
|
|
c52ddb9e03 | ||
|
|
68d13f9ff3 | ||
|
|
d71f977a55 | ||
|
|
45a603c1d6 | ||
|
|
6f67af5ec3 | ||
|
|
545ee46a02 | ||
|
|
f660267dc5 | ||
|
|
530bd14f4a | ||
|
|
9e9183aa95 | ||
|
|
b0cc1d7f51 | ||
|
|
2f7880a697 | ||
|
|
cf832d14b4 | ||
|
|
232841ef5e | ||
|
|
00017e241e | ||
|
|
6144b08cf9 | ||
|
|
8d21acf64c | ||
|
|
ddae2e8ac5 | ||
|
|
62c7216b43 | ||
|
|
e2d30e708e | ||
|
|
e39c6c6208 | ||
|
|
67192ea23f | ||
|
|
06681017ee | ||
|
|
05b998c0ee | ||
|
|
675cb3119d | ||
|
|
b231b1a51f | ||
|
|
391190f33f | ||
|
|
647d2f74df | ||
|
|
9442d586ee | ||
|
|
0a8d43e932 | ||
|
|
b98178c97a | ||
|
|
d5d97fe6e7 | ||
|
|
0fff2542b7 | ||
|
|
21523fe707 | ||
|
|
dc56b2bc93 | ||
|
|
1329b28af3 | ||
|
|
09b689ba1c | ||
|
|
d26d76fc70 | ||
|
|
8b791cb511 | ||
|
|
52a5655b26 | ||
|
|
a127fce561 | ||
|
|
c29dccc1b1 | ||
|
|
02792b8f0c | ||
|
|
8e9f6eb905 | ||
|
|
642e872296 | ||
|
|
4b8f2dfdd6 | ||
|
|
5ef19696a9 | ||
|
|
92fc807e3d | ||
|
|
3fec0da6e6 | ||
|
|
ca4ca536fa | ||
|
|
02019edcb7 | ||
|
|
1f117e43bd | ||
|
|
db87125dc8 | ||
|
|
bce86ae8a3 | ||
|
|
c59d827a39 | ||
|
|
d6663074e3 | ||
|
|
0ffa85f86f | ||
|
|
4f75fa6a94 | ||
|
|
b6f3559621 | ||
|
|
cecde2058b | ||
|
|
d03cfa0b2d | ||
|
|
d01f3da174 | ||
|
|
03f419a49c | ||
|
|
c784c5393d | ||
|
|
bbf92b06f0 | ||
|
|
40408e25be | ||
|
|
18682fdac0 | ||
|
|
dc65f6140b | ||
|
|
a85c9a1f48 | ||
|
|
d47d55098e | ||
|
|
913c3c22b6 | ||
|
|
b4dd6f3bfa | ||
|
|
e95896fd08 | ||
|
|
0423d30a4e | ||
|
|
6aae5987e6 | ||
|
|
11e4480328 | ||
|
|
e74170507c | ||
|
|
ac6bf00b93 | ||
|
|
958fb0b085 | ||
|
|
e8de12bf91 | ||
|
|
11931d4037 | ||
|
|
64874c773b | ||
|
|
d78d965183 | ||
|
|
49dab0fb3a | ||
|
|
44de139236 | ||
|
|
7510703b5a | ||
|
|
0699c55229 | ||
|
|
9f9da5fd64 | ||
|
|
44458c2b8c | ||
|
|
19275f8f3d | ||
|
|
599f9e106e | ||
|
|
1698ca8775 | ||
|
|
1f66132cd2 | ||
|
|
ec875a6cdf | ||
|
|
aa6fcbddc4 | ||
|
|
5be380abdc | ||
|
|
77d90b807e | ||
|
|
b27395607c | ||
|
|
30678e3c41 | ||
|
|
618d8823b9 | ||
|
|
f28707504a | ||
|
|
5314100714 | ||
|
|
17f0997ec3 | ||
|
|
a8dc336df6 | ||
|
|
97263149fb | ||
|
|
1155f5512d | ||
|
|
4dd17832ef | ||
|
|
d7f9d7ef7f | ||
|
|
9bd9b5c121 | ||
|
|
6a16d8e0cd | ||
|
|
4c97cb4ba4 | ||
|
|
77f6bf6fac | ||
|
|
2488cc690d | ||
|
|
9378704701 | ||
|
|
beccb9cdf0 | ||
|
|
b87d27db1d | ||
|
|
3c1a478ff3 | ||
|
|
8c21ec30e8 | ||
|
|
99d7487bc2 | ||
|
|
9a395a0284 | ||
|
|
d6e5df540e | ||
|
|
3d38739be1 | ||
|
|
1f48dab312 | ||
|
|
84bba58d64 | ||
|
|
b4cf2f85e7 | ||
|
|
33f880758a | ||
|
|
7419fefa2d | ||
|
|
153ebbca63 | ||
|
|
b68600d978 | ||
|
|
a2046be0ee | ||
|
|
8ea6ea87ad | ||
|
|
4cf9a455bc | ||
|
|
d04b0f09ba | ||
|
|
6ee0f13383 | ||
|
|
e9d28918cd | ||
|
|
0a2f9fa0be | ||
|
|
10a83bbfe9 | ||
|
|
a178cdba08 | ||
|
|
1faca2dcee | ||
|
|
de51b23a18 | ||
|
|
3d58c4eca6 | ||
|
|
e318bb38b4 | ||
|
|
7b1f645caf | ||
|
|
52f883be4e | ||
|
|
ee28648852 | ||
|
|
d8564cda5a | ||
|
|
68ae2d571f | ||
|
|
7c8383f2dc | ||
|
|
912489cce0 | ||
|
|
5573374aa9 | ||
|
|
0c8c4938d9 | ||
|
|
d3244593a5 | ||
|
|
549e7bce75 | ||
|
|
e4b43abe05 | ||
|
|
e3283fa4ad | ||
|
|
08f2d7cc40 | ||
|
|
d2dda1f629 | ||
|
|
6903836ebe | ||
|
|
00cdb5197c | ||
|
|
7152f9b04f | ||
|
|
d7f95ddd43 | ||
|
|
513e239771 | ||
|
|
26ece81da8 | ||
|
|
2adfa8b6b6 | ||
|
|
855d13e735 | ||
|
|
a8a26fabd8 | ||
|
|
61ace3566a | ||
|
|
8552515e34 | ||
|
|
18f1f983ae | ||
|
|
79a85db7e4 | ||
|
|
5420a6a887 | ||
|
|
2f1fae23cf | ||
|
|
7156f4b36b | ||
|
|
b767fc4db1 | ||
|
|
2bf4a96d09 | ||
|
|
bb3354581a | ||
|
|
21cbb64001 | ||
|
|
c166060f0d | ||
|
|
6ed103b33f | ||
|
|
a2d93bc7cc | ||
|
|
bb828385d0 | ||
|
|
65ce47a7d1 | ||
|
|
3bcdd78514 | ||
|
|
95b4f89e50 | ||
|
|
46102c0b3a | ||
|
|
b6f79a9f95 | ||
|
|
33564b8620 | ||
|
|
a8cc17624c | ||
|
|
6211c243dd | ||
|
|
ccd13f2233 | ||
|
|
80a7cbe16f | ||
|
|
ee0bdf3a82 | ||
|
|
72ac5a5437 | ||
|
|
d9b8f0310a | ||
|
|
93834fb281 | ||
|
|
45bc5182ce | ||
|
|
5435dc88d4 | ||
|
|
e94d4bcd28 | ||
|
|
55182e0b94 | ||
|
|
554ca1a4f4 | ||
|
|
eac7e100cc | ||
|
|
6cb2377266 | ||
|
|
ae032cb557 | ||
|
|
d3b53f69da | ||
|
|
68de0a8107 | ||
|
|
65709e1139 | ||
|
|
148fa4f4cd | ||
|
|
4f1bd23442 | ||
|
|
72945b45c5 | ||
|
|
6fb345dbbc | ||
|
|
7c3ff32496 | ||
|
|
7778896a64 | ||
|
|
26e2816229 | ||
|
|
b65934cc7f | ||
|
|
d43c4d053e | ||
|
|
b43593a996 | ||
|
|
c09a7e8bbc | ||
|
|
a65162c204 | ||
|
|
eb398c419a | ||
|
|
d92f6d3e18 | ||
|
|
09decf796a | ||
|
|
8b6d31658e | ||
|
|
65d524dfdf | ||
|
|
f538ab3670 | ||
|
|
1b3bc0f4e3 | ||
|
|
2436c3eb70 | ||
|
|
f59cdb1929 | ||
|
|
dd1d956bfe | ||
|
|
3317d32ae2 | ||
|
|
d0f42ce6b3 | ||
|
|
cbac21746f | ||
|
|
e677fa21d5 | ||
|
|
7ccfcdd167 | ||
|
|
e2d26d75c4 | ||
|
|
2bfc20ef41 | ||
|
|
663fa3eec1 | ||
|
|
4ce716d607 | ||
|
|
c7aa91311d | ||
|
|
533d9c7760 | ||
|
|
5d8822df40 | ||
|
|
6aa07de973 | ||
|
|
58fc61ac0f | ||
|
|
a43f49cef2 | ||
|
|
83b96fd0c0 | ||
|
|
a7f3252f17 | ||
|
|
e4eb8f4a26 | ||
|
|
ad420670a7 | ||
|
|
c6a1a7539a | ||
|
|
30a9bb010f | ||
|
|
24161f93e5 | ||
|
|
7f175094bb | ||
|
|
a8cb4d7d57 | ||
|
|
5fa57e1859 | ||
|
|
070d051e16 | ||
|
|
91f25abf2c | ||
|
|
f84eb929cb | ||
|
|
cbe4cb1cf1 | ||
|
|
f93a40aa18 | ||
|
|
f2d00f2ad9 | ||
|
|
63d8f1731e | ||
|
|
75b1bf3a77 | ||
|
|
3de290f04f | ||
|
|
53d3efe895 | ||
|
|
a0123c2a6f | ||
|
|
01ee79b022 | ||
|
|
9a5d0954df | ||
|
|
a09216da76 | ||
|
|
35653bb115 | ||
|
|
49abbecbd7 | ||
|
|
4a4247180f | ||
|
|
4b03a30121 | ||
|
|
0d374725d6 | ||
|
|
5d1b1f5293 | ||
|
|
187cbd9695 | ||
|
|
a0ec5097d9 | ||
|
|
4760f00050 | ||
|
|
267c019d7a | ||
|
|
897128a168 | ||
|
|
b9f8fd73f1 | ||
|
|
e21b5be6f6 | ||
|
|
77739c971a | ||
|
|
047e84ac8c | ||
|
|
1aefdba5ab | ||
|
|
9ecd9457d3 | ||
|
|
9d273fb91f | ||
|
|
be702e12f7 | ||
|
|
cc568fb8cf | ||
|
|
0cc3af28a3 | ||
|
|
124f5ad331 | ||
|
|
bb4cb337ec | ||
|
|
f825533afa | ||
|
|
b491973414 | ||
|
|
99ab165a8f | ||
|
|
73dea00e41 | ||
|
|
d8c4ff62cb | ||
|
|
1168cd291b | ||
|
|
87d54d9c88 | ||
|
|
e6b502dd4a | ||
|
|
0d4659472b | ||
|
|
62dfaf0709 | ||
|
|
71b948f2fc | ||
|
|
dd582f4009 | ||
|
|
664e969730 | ||
|
|
540a527a61 | ||
|
|
8eedefddd3 | ||
|
|
1df7e8be2c | ||
|
|
138d84155b | ||
|
|
d3f0e471e5 | ||
|
|
85f8965d44 | ||
|
|
3f1913e5f4 | ||
|
|
93709fbeb8 | ||
|
|
04fbde49ec | ||
|
|
4a88b3f847 | ||
|
|
e648f15fdc | ||
|
|
f420785bfb | ||
|
|
9c5ffdc1bf | ||
|
|
38a916dcc4 | ||
|
|
6ac3b0d6cd | ||
|
|
9a90a00c83 | ||
|
|
a5e9557e4b | ||
|
|
05d625484d | ||
|
|
120300643f | ||
|
|
d3bfdfe1ec | ||
|
|
61b33b7050 | ||
|
|
b35e68c6d3 | ||
|
|
a75840ab4d | ||
|
|
fab7fb3662 | ||
|
|
b0026a562a | ||
|
|
cffc70fb6b | ||
|
|
996a5c40b1 | ||
|
|
b86f748700 | ||
|
|
c2213d9008 | ||
|
|
dccb1c93e1 | ||
|
|
45afd22e9e | ||
|
|
cfeefbed23 | ||
|
|
f9c37ecc70 | ||
|
|
d8787cb4c5 | ||
|
|
4b53d1267c | ||
|
|
a23b3c8d26 | ||
|
|
e81d11fd55 | ||
|
|
d257c312c1 | ||
|
|
f7279c1d49 | ||
|
|
4b9155e7c9 | ||
|
|
caae63b44b | ||
|
|
0ef0966226 | ||
|
|
b9bd7d3f7b | ||
|
|
e802827299 | ||
|
|
f8d09994f6 | ||
|
|
495cf89a38 | ||
|
|
459a4752ed | ||
|
|
fe5eea2a08 | ||
|
|
cf1d051288 | ||
|
|
f0a961b8f8 | ||
|
|
00c6d80ec9 | ||
|
|
16e45c452f | ||
|
|
4e0e1e2f2b | ||
|
|
0de87521b8 | ||
|
|
fac2050485 | ||
|
|
1ff2dec93f | ||
|
|
4f9c72277b | ||
|
|
ca5f53e7f5 | ||
|
|
409fff7ee4 | ||
|
|
112e8aeaa0 | ||
|
|
30d8a0406d | ||
|
|
dc679add87 | ||
|
|
960a0277aa | ||
|
|
828dab73a8 | ||
|
|
d6abf5b8df | ||
|
|
b736444306 | ||
|
|
adde73605d | ||
|
|
c059f3dced | ||
|
|
52e2d3b77a | ||
|
|
919c2bd22a | ||
|
|
33a4ab340f | ||
|
|
0495dff904 | ||
|
|
2740f908b0 | ||
|
|
d7856b7618 | ||
|
|
3a3ffcd983 | ||
|
|
7a29ebf398 | ||
|
|
d0773cec4a | ||
|
|
d012300fe9 | ||
|
|
28e7fec338 | ||
|
|
e12506feef | ||
|
|
dc87f48040 | ||
|
|
7fb7560f75 | ||
|
|
c9831d1949 | ||
|
|
d4bc2ca9a5 | ||
|
|
d1b07d2094 | ||
|
|
d42586dc9e | ||
|
|
fe2656cfa9 | ||
|
|
e15998afe7 | ||
|
|
c822f1702f | ||
|
|
505bae77ac | ||
|
|
a5792423d5 | ||
|
|
aa4886344e | ||
|
|
9801f43d3e | ||
|
|
b769a7c40b | ||
|
|
c4573df90f | ||
|
|
26963a7d85 | ||
|
|
89aaf523ca | ||
|
|
bbfed3fbb1 | ||
|
|
e5301dec04 | ||
|
|
00350fec80 | ||
|
|
21b8db7ddf | ||
|
|
44602c4213 | ||
|
|
29e7af5bfc | ||
|
|
3b6882412a | ||
|
|
eadf2f9a45 | ||
|
|
bdb0add5ac | ||
|
|
3a7854f896 | ||
|
|
18debf51cd | ||
|
|
ef06c75e8f | ||
|
|
69a5750fc5 | ||
|
|
f334c07c29 | ||
|
|
00fb833c38 | ||
|
|
24542aa10a | ||
|
|
07916059ed | ||
|
|
a4c9115063 | ||
|
|
026b416ca1 | ||
|
|
4a893bb2f0 | ||
|
|
49a7dfd76d | ||
|
|
abacafb0c5 | ||
|
|
f1adfddded | ||
|
|
cfb10db4ea | ||
|
|
8822a901ae | ||
|
|
dfef97d715 | ||
|
|
96e28aadf5 | ||
|
|
5cfa46d14d | ||
|
|
509cbb07fe | ||
|
|
92817203fc | ||
|
|
64ea6e6adc | ||
|
|
c7ede0083e | ||
|
|
fc79c87bba | ||
|
|
fce6c17f4f | ||
|
|
881ce59ade | ||
|
|
8cc4517fb0 | ||
|
|
fff599d56a | ||
|
|
697651b0e8 | ||
|
|
463f72ee56 | ||
|
|
94f8db4da9 | ||
|
|
73e1db7bb4 | ||
|
|
3da7ec5c2c | ||
|
|
fe8adaaa49 | ||
|
|
ad7a0c9cac | ||
|
|
47f45fce0c | ||
|
|
60bac01a4a | ||
|
|
4b59bd0223 | ||
|
|
1023f30b4c | ||
|
|
353c1a5689 | ||
|
|
1814733d5b | ||
|
|
f0cabbff7d | ||
|
|
55768fc6b5 | ||
|
|
e2b30b7d17 | ||
|
|
ca6ce23494 | ||
|
|
f63de7f930 | ||
|
|
35ab5b1578 | ||
|
|
631d67ad0b | ||
|
|
391ab15b15 | ||
|
|
f9e24ea536 | ||
|
|
f4c17e50a2 | ||
|
|
b8d483ae7e | ||
|
|
1ef587b8c2 | ||
|
|
1cc7be746b | ||
|
|
67d1652cf4 | ||
|
|
6626cc1059 | ||
|
|
467d9b9f47 | ||
|
|
a71c66bfb7 | ||
|
|
3a96382901 | ||
|
|
159e1c10e0 | ||
|
|
e00b98226c | ||
|
|
f0c6887d37 | ||
|
|
0ab43fc37e | ||
|
|
c21fef5b24 | ||
|
|
98855d4fd5 | ||
|
|
d408b0fd96 | ||
|
|
dc3fac6a4c | ||
|
|
fd5cde08c3 | ||
|
|
485a734c9b | ||
|
|
a836467714 | ||
|
|
d549aab89c | ||
|
|
4755a7b57f | ||
|
|
8f7c16cc39 | ||
|
|
cb50b8a9bc | ||
|
|
68b1a0971c | ||
|
|
3f76092a3b | ||
|
|
3f7d7674ff | ||
|
|
c94d22994f | ||
|
|
25085fe881 | ||
|
|
63f1fed33c | ||
|
|
07377a4e2a | ||
|
|
e6016538b4 | ||
|
|
1eec5a182d | ||
|
|
591f604073 | ||
|
|
2952bec959 | ||
|
|
52eb4de7a9 | ||
|
|
dfe1bf5c62 | ||
|
|
46fbcb5a0f | ||
|
|
419dd6431e | ||
|
|
b33f14cca4 | ||
|
|
57a69be7e8 | ||
|
|
9b38ba6c02 | ||
|
|
734e08a209 | ||
|
|
c4d05a5a1a | ||
|
|
54466edafc | ||
|
|
91f748d566 | ||
|
|
3a0499bb94 | ||
|
|
ed61ac44bf | ||
|
|
3c448d3d27 | ||
|
|
f2c6986a6f | ||
|
|
73c146b9ac | ||
|
|
4d9731d9c2 | ||
|
|
e198caffd7 | ||
|
|
9c20a63ad5 | ||
|
|
aed74c4608 | ||
|
|
cf40313383 | ||
|
|
e901daa849 | ||
|
|
43c2e9e0ed | ||
|
|
93b1de8ed9 | ||
|
|
ad20e355cf | ||
|
|
92f3337c4c | ||
|
|
d8aecaeb29 | ||
|
|
9d4f7dc642 | ||
|
|
f54a0de797 | ||
|
|
19664726d6 | ||
|
|
ca7a0794a8 | ||
|
|
2716d9441c | ||
|
|
aeeaaf6605 | ||
|
|
0b17aa7c74 | ||
|
|
ffdac06b80 | ||
|
|
82b460f53d | ||
|
|
6516d9ffa6 | ||
|
|
f54f4fc65d | ||
|
|
54fa36abc0 | ||
|
|
1711dc6601 | ||
|
|
5a1eecfc4b | ||
|
|
33bf50e91b | ||
|
|
6c6dacb195 | ||
|
|
8c43457622 | ||
|
|
221ae5b821 | ||
|
|
c9fdaec997 | ||
|
|
6659ef50ff | ||
|
|
ad88d8993d | ||
|
|
851b2d13e4 | ||
|
|
cd3f30e03e | ||
|
|
bf27692a65 | ||
|
|
1cb0685b61 | ||
|
|
788fd153da | ||
|
|
51c94d334a | ||
|
|
fab03d337e | ||
|
|
295b8cf2e1 | ||
|
|
3b20104261 | ||
|
|
14e1b6c1f7 | ||
|
|
91d034954e | ||
|
|
41dfd8a0f8 | ||
|
|
dc6267f757 | ||
|
|
a0320f8cef | ||
|
|
a045ddf23e | ||
|
|
106f5a0ac2 | ||
|
|
2f84d94c66 | ||
|
|
264a85d837 | ||
|
|
4287003509 | ||
|
|
0249e620fd | ||
|
|
636ab7427d | ||
|
|
9fb13975b4 | ||
|
|
2311fbdaae | ||
|
|
8767d25cff | ||
|
|
2b336ad385 | ||
|
|
3bb5c06f44 | ||
|
|
b3f1b7919c | ||
|
|
7ac27d7b37 | ||
|
|
65bb37a93a | ||
|
|
6284f86026 | ||
|
|
f5900795c4 | ||
|
|
cc94c4e01e | ||
|
|
cfd4e8a05d | ||
|
|
ba786fa50e | ||
|
|
bcb65cd9fa | ||
|
|
c5a2126abe | ||
|
|
e947307f86 | ||
|
|
5b2cd12d2b | ||
|
|
511a746871 | ||
|
|
80b4600f60 | ||
|
|
d7a178d259 | ||
|
|
6dd40df93b | ||
|
|
567316cfbe | ||
|
|
e8e6000b13 | ||
|
|
44bcc943a0 | ||
|
|
75d21d41b8 | ||
|
|
f9c4348fd8 | ||
|
|
77aa580690 | ||
|
|
cd5cf5941a | ||
|
|
172e918de5 | ||
|
|
9268fa45e7 | ||
|
|
4b98cf45f3 | ||
|
|
88c86ff447 | ||
|
|
4815aa9ff1 | ||
|
|
65c39cbbc8 | ||
|
|
c1eb7d9621 | ||
|
|
efb03d016b | ||
|
|
a5a1f72555 | ||
|
|
03f1fe3ee5 | ||
|
|
8bb6643a41 | ||
|
|
4b6058beff | ||
|
|
7a9cfdfaa5 | ||
|
|
a0003340da | ||
|
|
60569de672 | ||
|
|
b1bca7982a | ||
|
|
480d8a8786 | ||
|
|
6d4a92ad27 | ||
|
|
c1bd9ad6af | ||
|
|
a59e0c928f | ||
|
|
39f08f878f | ||
|
|
761b93d811 | ||
|
|
d808d91e72 | ||
|
|
0ea287a7bf | ||
|
|
7678eedf4d | ||
|
|
1100a07108 | ||
|
|
5d2d6d2a94 | ||
|
|
c43eff8587 | ||
|
|
3e70d5a398 | ||
|
|
6198ab57de | ||
|
|
4294e0109a | ||
|
|
54cdf2a7e6 | ||
|
|
bb56d92147 | ||
|
|
4a2e9bf1c7 | ||
|
|
d2396b674e | ||
|
|
85e2ee28a3 | ||
|
|
d677468fe8 | ||
|
|
3ca19744c4 | ||
|
|
10ce772bcb | ||
|
|
72f5684b6f | ||
|
|
e61f8551a3 | ||
|
|
ec3307320a | ||
|
|
f534291767 | ||
|
|
0326e266d4 | ||
|
|
c1b5280446 | ||
|
|
fc2a79242e | ||
|
|
00c05437ca | ||
|
|
136d73d2ff | ||
|
|
329f6b3da6 | ||
|
|
c159f34b24 | ||
|
|
9d51cee72c | ||
|
|
7f00a01c2b | ||
|
|
d9acb034e1 | ||
|
|
00b23cbee4 | ||
|
|
46a0d213fb | ||
|
|
2abd1ca6c2 | ||
|
|
489a4855e9 | ||
|
|
61dfc2f74a | ||
|
|
d121f5c39c | ||
|
|
248e7a1f9e | ||
|
|
d4df1c8384 | ||
|
|
ae191afeec | ||
|
|
eb84a366d2 | ||
|
|
dc42df3bf2 | ||
|
|
bdc7c7c666 | ||
|
|
892fb6f687 | ||
|
|
56cd1ddfa7 | ||
|
|
aa127e45aa | ||
|
|
ec3a763f5d | ||
|
|
3913c03163 | ||
|
|
746f0db1f1 | ||
|
|
4053a920d9 | ||
|
|
590feab1d1 | ||
|
|
57a09cd3c6 | ||
|
|
108a898ebf | ||
|
|
589903f5e8 | ||
|
|
ef12914cad | ||
|
|
985aada5e4 | ||
|
|
92b211dd94 | ||
|
|
3df7ea71d3 | ||
|
|
abeb7a852c | ||
|
|
16b1605a35 | ||
|
|
3588111938 | ||
|
|
48787a1feb | ||
|
|
4c3728a20f | ||
|
|
b666a34863 | ||
|
|
6850a8f264 | ||
|
|
f665ed772b | ||
|
|
20c65928cb | ||
|
|
faa4e7364f | ||
|
|
3fb4efb08e | ||
|
|
e954bce821 | ||
|
|
5f9fda0e7c | ||
|
|
859814a17b | ||
|
|
b5dd996bae | ||
|
|
5ab94e25b7 | ||
|
|
a92a3305b1 | ||
|
|
0138eccb60 | ||
|
|
5df4ed2783 | ||
|
|
1628f32fe1 | ||
|
|
0ee1ad69e9 | ||
|
|
5fb1b07d23 | ||
|
|
bd4ac1ae8a | ||
|
|
848495f82a | ||
|
|
f979d23175 | ||
|
|
ad88f7de7f | ||
|
|
63ce107cc1 | ||
|
|
bdb3d695ee | ||
|
|
b0d19455c1 | ||
|
|
d493a5f9ea | ||
|
|
7a13a53bdd | ||
|
|
2c1d97f759 | ||
|
|
672a79cc09 | ||
|
|
110ba59ea0 | ||
|
|
4f770ec83e | ||
|
|
bf9be7c46d | ||
|
|
51d8d85c60 | ||
|
|
fa2d69f943 | ||
|
|
40d32a6065 | ||
|
|
6b8a38b894 | ||
|
|
23f218a568 | ||
|
|
7d8277b4db | ||
|
|
299301b633 | ||
|
|
4e1076e01b | ||
|
|
f8e01c7c99 | ||
|
|
c6e2b54d33 | ||
|
|
6ed57822d6 | ||
|
|
c1e6e90896 | ||
|
|
1a3e1ba003 | ||
|
|
cc0b1aea65 | ||
|
|
0b0e92d250 | ||
|
|
93c2e753b2 | ||
|
|
ac770518bf | ||
|
|
db43769cbb | ||
|
|
29f524981f | ||
|
|
dd5636c2b3 | ||
|
|
707abdd280 | ||
|
|
4facd12c7c | ||
|
|
65dfd54cdd | ||
|
|
edc30ce8bd | ||
|
|
86003c73a3 | ||
|
|
b3d8a82897 | ||
|
|
30e18a2d99 | ||
|
|
35d959208a | ||
|
|
cdd0a3c96f | ||
|
|
0bb129e7a6 | ||
|
|
acea7d75fb | ||
|
|
3b9f5c17f7 | ||
|
|
c049274e0e | ||
|
|
f547053ebc | ||
|
|
baafd60f4f | ||
|
|
295fec0370 | ||
|
|
bc89d774ba | ||
|
|
dec63d7a2e | ||
|
|
28e27e937d | ||
|
|
83a6589cd0 | ||
|
|
c9d7b46372 | ||
|
|
d3a8cb31ae | ||
|
|
5014b1a027 | ||
|
|
37f18abb26 | ||
|
|
e0914c68e3 | ||
|
|
b26b143c31 | ||
|
|
37383953fa | ||
|
|
6e80dbba04 | ||
|
|
11c797fa0c | ||
|
|
7e8b2bb184 | ||
|
|
61b6c19320 | ||
|
|
d434e62673 | ||
|
|
3f32f5a0ca | ||
|
|
14355ed966 | ||
|
|
49a7f30f45 | ||
|
|
a386b4dc7e | ||
|
|
8af8a97344 | ||
|
|
6602f0505e | ||
|
|
1f2fabe81b | ||
|
|
7f6ab894d1 | ||
|
|
391cc76bd8 | ||
|
|
a5107f075c | ||
|
|
5beb219ff6 | ||
|
|
87247feb23 | ||
|
|
88fac1b30b | ||
|
|
b8430e34bf | ||
|
|
5ac404c01a | ||
|
|
2dee81b624 | ||
|
|
248e578422 | ||
|
|
b4106b1a65 | ||
|
|
61b1ca89d3 | ||
|
|
19fb7d7f06 | ||
|
|
02d2962004 | ||
|
|
adaee548e2 | ||
|
|
ba0c22e080 | ||
|
|
427f788cf8 | ||
|
|
5b897e5748 | ||
|
|
4e6fdd890c | ||
|
|
9f59dac965 | ||
|
|
389fce161c | ||
|
|
68ef9a0561 | ||
|
|
241c87b9f1 | ||
|
|
c0a76ba790 | ||
|
|
14113f3c35 | ||
|
|
98e1dd880d | ||
|
|
51214bd246 | ||
|
|
2b252731d3 | ||
|
|
65f1339630 | ||
|
|
2403187917 | ||
|
|
df13f97588 | ||
|
|
ee1a37a806 | ||
|
|
9127266956 | ||
|
|
99955ba59c | ||
|
|
5f54469971 | ||
|
|
3b23f09bed | ||
|
|
2ad7088553 | ||
|
|
70284e5dfd | ||
|
|
6a73e02bf1 | ||
|
|
0d3d3f49e4 | ||
|
|
631b069f9a | ||
|
|
ccd1cabe04 | ||
|
|
153a17af72 | ||
|
|
a23b65edf9 | ||
|
|
81f32ab05f | ||
|
|
a03272aa88 | ||
|
|
dbcd677e69 | ||
|
|
6b676d8ded | ||
|
|
a27cc88d17 | ||
|
|
5106ba59f6 | ||
|
|
6f515ac5f4 | ||
|
|
4fc5a018e5 | ||
|
|
ebdf9c1b11 | ||
|
|
9c6b7bd280 | ||
|
|
a8c19818ed | ||
|
|
89dd688407 | ||
|
|
3308b152c9 | ||
|
|
2075e08f1d | ||
|
|
1296dcbba2 | ||
|
|
b5dccced6d | ||
|
|
6c4842a111 | ||
|
|
bb9bde1c19 | ||
|
|
055a476d2f | ||
|
|
4add1f7200 | ||
|
|
c80b28ade9 | ||
|
|
80707a37df | ||
|
|
813ef0e960 | ||
|
|
cb0918726e | ||
|
|
72187ca51e | ||
|
|
7f8d084fa4 | ||
|
|
323ab43889 | ||
|
|
8f407a36d4 | ||
|
|
e784107a0b | ||
|
|
ddfc2a54b8 | ||
|
|
92611af9c0 | ||
|
|
8e76fee162 | ||
|
|
bba539f846 | ||
|
|
799c0c1f11 | ||
|
|
4067e1ffd8 | ||
|
|
fb142f7699 | ||
|
|
2c22aee126 | ||
|
|
f04cebd7b5 | ||
|
|
9bce81d875 | ||
|
|
88c72e90fd | ||
|
|
dd73e4a164 | ||
|
|
202269ebeb | ||
|
|
d1db6fb3b3 | ||
|
|
694c6b528c | ||
|
|
7edd9f7c92 | ||
|
|
a0df0a0e0a | ||
|
|
6485e1af82 | ||
|
|
404f0dc195 | ||
|
|
20f932f935 | ||
|
|
e797b26c36 | ||
|
|
ee217404da | ||
|
|
254a2f5138 | ||
|
|
3f598f76d1 | ||
|
|
3a69f47347 | ||
|
|
df9a19a9b4 | ||
|
|
2e1d7fde1a | ||
|
|
de780a1fd8 | ||
|
|
6377dc86e0 | ||
|
|
4a86d25891 | ||
|
|
bae146205c | ||
|
|
23dfddefa1 | ||
|
|
a28ce2d3b8 | ||
|
|
4035c18f8e | ||
|
|
b9fd01d7b3 | ||
|
|
22586c802c | ||
|
|
c78e1e2970 | ||
|
|
353c57a568 | ||
|
|
bd34a720a2 | ||
|
|
93f7da132e | ||
|
|
e9a53820fd | ||
|
|
f201039772 | ||
|
|
a1f5292e57 | ||
|
|
aff2ddd04d | ||
|
|
9ee4b256fb | ||
|
|
2ae3484363 | ||
|
|
cf98e65a3f | ||
|
|
e0e33eb148 | ||
|
|
7e35de3760 | ||
|
|
764af3a5db | ||
|
|
d276a0fa62 | ||
|
|
9e3fe5de37 | ||
|
|
23c4d1d5fa | ||
|
|
ea2d040c22 | ||
|
|
b688fc1cc0 | ||
|
|
3ca847ece3 | ||
|
|
082ee187da | ||
|
|
7b23126379 | ||
|
|
514f934148 | ||
|
|
fd778adf99 | ||
|
|
84084a7c41 | ||
|
|
17feef93df | ||
|
|
4ebb463508 | ||
|
|
df2e3c12be | ||
|
|
33d47d1d6d | ||
|
|
cc1a8ca4e8 | ||
|
|
964a8f7031 | ||
|
|
4de47b61e4 | ||
|
|
dfad612235 | ||
|
|
cbfed97853 | ||
|
|
907eb598e3 | ||
|
|
005cf1d52b | ||
|
|
6ca0796c8a | ||
|
|
5447e334dc | ||
|
|
f5de744641 | ||
|
|
c0053a772b | ||
|
|
34b0bfc315 | ||
|
|
acd774e938 | ||
|
|
cb8a801d4a | ||
|
|
3b4ac976b6 | ||
|
|
36067417f5 | ||
|
|
f688402748 | ||
|
|
f3362c4e59 | ||
|
|
b58c9709e2 | ||
|
|
0018fdaebc | ||
|
|
0ec569f020 | ||
|
|
d2ca72e246 | ||
|
|
c397297dfb | ||
|
|
f881f3b1c6 | ||
|
|
2d47dd1780 | ||
|
|
334f582a4d | ||
|
|
b49df1fc0a | ||
|
|
717de53eb1 | ||
|
|
2525dcf983 | ||
|
|
abbaa8bf78 | ||
|
|
2db2b870ff | ||
|
|
918e08cb9b | ||
|
|
1471511c03 | ||
|
|
e092ae3231 | ||
|
|
b14f3c87f1 | ||
|
|
a31f14b016 | ||
|
|
692862c769 | ||
|
|
f88b98ea62 | ||
|
|
7b504b5fa7 | ||
|
|
70a8799036 | ||
|
|
5c3d641439 | ||
|
|
c0be817960 | ||
|
|
2f995be794 | ||
|
|
e5b1177644 | ||
|
|
e64d925086 | ||
|
|
1854710093 | ||
|
|
c4e6605ada | ||
|
|
3da4df6b8f | ||
|
|
2089a0064f | ||
|
|
5f5203a211 | ||
|
|
c75bab5979 | ||
|
|
37a1fd88e3 | ||
|
|
d64d278676 | ||
|
|
b006121b6a | ||
|
|
93c49ac566 | ||
|
|
ab56633eed | ||
|
|
42e989d0cc | ||
|
|
036aedd88d | ||
|
|
80e1965e46 | ||
|
|
8067793379 | ||
|
|
0f757bc101 | ||
|
|
d93d97882b | ||
|
|
0b3fe001d0 | ||
|
|
a565f7c5df | ||
|
|
18a6e7c7c1 | ||
|
|
c47c6f6034 | ||
|
|
c7ea2a14ad | ||
|
|
9fc2384649 | ||
|
|
2ff1fc024c | ||
|
|
a5d1746151 | ||
|
|
80d8eeb4cf | ||
|
|
e9b7d40456 | ||
|
|
e5809b8b13 | ||
|
|
443d7469de | ||
|
|
78784f3ab6 | ||
|
|
e1d1b572d1 | ||
|
|
544a16adca | ||
|
|
bc6cbfd5ee | ||
|
|
e4b5140361 | ||
|
|
314fb22638 | ||
|
|
c65afb201d | ||
|
|
8e73a02863 | ||
|
|
c33ce28805 | ||
|
|
9acbdf9825 | ||
|
|
9fc3d10d4b | ||
|
|
4dbfbbee00 | ||
|
|
269852ea3b | ||
|
|
4c642e66c7 | ||
|
|
7f8ef8f14d | ||
|
|
410c3b34a2 | ||
|
|
60e2d14e99 | ||
|
|
43155c4b87 | ||
|
|
93d26a0ebb | ||
|
|
0ab5ca080e | ||
|
|
c1dbb752d8 | ||
|
|
1383b19817 | ||
|
|
2a5d87ee54 | ||
|
|
2f16758794 | ||
|
|
6cf298c2bc | ||
|
|
ca89dab45f | ||
|
|
ad9b98389f | ||
|
|
c9723082fe | ||
|
|
b185857eb0 | ||
|
|
3aad88ebe7 | ||
|
|
0a60d93c71 | ||
|
|
43a9393dca | ||
|
|
26f460d2ae | ||
|
|
de15a56ed8 | ||
|
|
61d55604a4 | ||
|
|
c9c98501af | ||
|
|
ca38d2cbdc | ||
|
|
0df388280e | ||
|
|
142e695150 | ||
|
|
d76ece04bc | ||
|
|
0b3dbfc8f8 | ||
|
|
d9bf72a351 | ||
|
|
e001906443 | ||
|
|
e10647b5a2 | ||
|
|
5ea87b76c9 | ||
|
|
312ff91994 | ||
|
|
4b6c772adc | ||
|
|
201417efcf | ||
|
|
fd6be7d3af | ||
|
|
f53bda865c | ||
|
|
58adba306a | ||
|
|
4c57cdd99f | ||
|
|
5399c1941c | ||
|
|
e661beabdc | ||
|
|
63a09c95fa | ||
|
|
a54790ec64 | ||
|
|
2f5beb84fa | ||
|
|
f94cf9da93 | ||
|
|
642e3663f7 | ||
|
|
8960a4f5cb | ||
|
|
aa092baec4 | ||
|
|
90327a72ed | ||
|
|
631d7495c7 | ||
|
|
d11c041fc1 | ||
|
|
80cce34a85 | ||
|
|
f6f14aaba0 | ||
|
|
588b9c5e32 | ||
|
|
0f51cf8986 | ||
|
|
1ad430f463 | ||
|
|
ae50e07b15 | ||
|
|
befbdae5cf | ||
|
|
f7a13ab52e | ||
|
|
de3ae8e42e | ||
|
|
b7e6412437 | ||
|
|
4ee57a0b35 | ||
|
|
b7f3dcad76 | ||
|
|
8381720ae7 | ||
|
|
ed1ee8ac98 | ||
|
|
edbcbd9e37 | ||
|
|
d47e59a596 | ||
|
|
683132b8d1 | ||
|
|
9587812962 | ||
|
|
69d010435b | ||
|
|
9cfec1ce74 | ||
|
|
81ffd7ae79 | ||
|
|
b8e1990439 | ||
|
|
ca4dd9e246 | ||
|
|
99c1401164 | ||
|
|
ff5518e421 | ||
|
|
8b8e02ba93 | ||
|
|
60af367b18 | ||
|
|
f31369a16d | ||
|
|
e7e7d6dba4 | ||
|
|
0e2b1b98b8 | ||
|
|
8641a3ee1c | ||
|
|
8e7604ec33 | ||
|
|
7bef092013 | ||
|
|
115c456318 | ||
|
|
5e51016602 | ||
|
|
0c3a3ae47e | ||
|
|
cba2ccf1cb | ||
|
|
2fdc4376bf | ||
|
|
69cfcd81e9 | ||
|
|
9c9530c6f3 | ||
|
|
2ea66f9d8d | ||
|
|
bc19503419 | ||
|
|
2754c962a4 | ||
|
|
90f49d959a | ||
|
|
5869734a15 | ||
|
|
b3606d15f7 | ||
|
|
9b10b775cd | ||
|
|
fa7f74f979 | ||
|
|
e91c52999e | ||
|
|
860e5f097c | ||
|
|
03136cef19 | ||
|
|
84676f189d | ||
|
|
de5486a466 | ||
|
|
6575159da3 | ||
|
|
856cc41f39 | ||
|
|
2cba296db2 | ||
|
|
afc00b2e24 | ||
|
|
73eca7a16a | ||
|
|
68d31d7f47 | ||
|
|
e7d182f9cc | ||
|
|
c86ac6e587 | ||
|
|
c9de6031c9 | ||
|
|
a692cd2290 | ||
|
|
b39ff9ff7a | ||
|
|
19ab1cbd1f | ||
|
|
1881627a89 | ||
|
|
f2cb26f464 | ||
|
|
da7b331760 | ||
|
|
951d7bbb63 | ||
|
|
706c4afd04 | ||
|
|
86484eb13f | ||
|
|
94337820f3 | ||
|
|
b5d8eaf26d | ||
|
|
81344b9826 | ||
|
|
8077d2c210 | ||
|
|
cadcb53399 | ||
|
|
4131165d6a | ||
|
|
cec1e288f9 | ||
|
|
273441f379 | ||
|
|
27e44b0320 | ||
|
|
7feb123a45 | ||
|
|
5c6e2e96fb | ||
|
|
9389b61f02 | ||
|
|
3f8d447b2a | ||
|
|
fdcfd3b6fc | ||
|
|
47f600e797 | ||
|
|
19a94d3039 | ||
|
|
e5c4246e15 | ||
|
|
ad0d96328b | ||
|
|
6a38f944a6 | ||
|
|
d6f198afca | ||
|
|
38b26f0bfc | ||
|
|
2f1e126551 | ||
|
|
3b65208edb | ||
|
|
d6335464d3 | ||
|
|
f9325a816e | ||
|
|
4291c36c58 | ||
|
|
a8bbb95cc0 | ||
|
|
2763762ae6 | ||
|
|
8cee8cfff0 | ||
|
|
0a606d7483 | ||
|
|
66d929a294 | ||
|
|
0afbf29be5 | ||
|
|
f53bf6817c | ||
|
|
11c5e9a307 | ||
|
|
6158455850 | ||
|
|
505c9697df | ||
|
|
92be15ae04 | ||
|
|
12db7c519f | ||
|
|
3a2284a244 | ||
|
|
833bceeacc | ||
|
|
0039b94832 | ||
|
|
50d8bfbfce | ||
|
|
7e8a8dbdec | ||
|
|
984b5d5661 | ||
|
|
96f6f66ace | ||
|
|
d8cec3f626 |
@@ -1,14 +1,60 @@
|
||||
# Copy this file to .env to make modifications
|
||||
|
||||
# Base config
|
||||
MATOMO_URL=https://analytics.lbry.com/
|
||||
MATOMO_ID=4
|
||||
WEBPACK_WEB_PORT=9090
|
||||
WEBPACK_ELECTRON_PORT=9091
|
||||
WEB_SERVER_PORT=1337
|
||||
DOMAIN=lbry.tv
|
||||
URL=https://lbry.tv
|
||||
SITE_TITLE=lbry.tv
|
||||
LOGO_TITLE=LBRY
|
||||
LBRY_WEB_API=https://api.lbry.tv
|
||||
LBRY_WEB_STREAMING_API=https://cdn.lbryplayer.xyz
|
||||
LBRY_WEB_BUFFER_API=https://collector-service.api.lbry.tv/api/v1/events/video
|
||||
COMMENT_SERVER_API=https://comments.lbry.com/api/v2
|
||||
WELCOME_VERSION=1.0
|
||||
|
||||
# Custom Site info
|
||||
DOMAIN=lbry.tv
|
||||
URL=https://lbry.tv
|
||||
THUMBNAIL_CDN_URL=https://image-optimizer.vanwanet.com/?address=
|
||||
|
||||
# UI
|
||||
SITE_TITLE=lbry.tv
|
||||
SITE_NAME=lbry.tv
|
||||
SITE_DESCRIPTION=Meet LBRY, an open, free, and community-controlled content wonderland.
|
||||
SITE_HELP_EMAIL=help@lbry.com
|
||||
LOGO_TITLE=lbry.tv
|
||||
SIMPLE_SITE=false
|
||||
SHOW_ADS=true
|
||||
YRBL_HAPPY_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a
|
||||
YRBL_SAD_IMG_URL=https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd
|
||||
ENABLE_COMMENT_REACTIONS=true
|
||||
ENABLE_FILE_REACTIONS=false
|
||||
ENABLE_CREATOR_REACTIONS=false
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS=4
|
||||
|
||||
# OG
|
||||
OG_TITLE_SUFFIX=| lbry.tv
|
||||
OG_HOMEPAGE_TITLE=lbry.tv
|
||||
OG_IMAGE_URL=
|
||||
SITE_CANONICAL_URL=https://lbry.tv
|
||||
|
||||
# LOCALE
|
||||
DEFAULT_LANGUAGE=en
|
||||
MATOMO_URL=https://analytics.lbry.com/
|
||||
MATOMO_ID=6
|
||||
|
||||
# Custom Settings
|
||||
# Additional settings for below are found in ui/constants/settings and are for
|
||||
# preventing user settings from applying to custom sites without overwriting them.
|
||||
# UNSYNCED_SETTINGS='theme dark_mode_times automatic_dark_mode_enabled'
|
||||
KNOWN_APP_DOMAINS=lbry.tv,lbry.lat,odysee.com
|
||||
|
||||
# Custom Content
|
||||
# If the following is true, copy custom/homepage.example.js to custom/homepage.js and modify
|
||||
CUSTOM_HOMEPAGE=false
|
||||
# Add channels to auto-follow on first run
|
||||
AUTO_FOLLOW_CHANNELS=lbry://@lbry#3fda836a92faaceedfe398225fb9b2ee2ed1f01a
|
||||
# Add up to 2 sidebar links:
|
||||
# PINNED_URI_1=@Lbrylatam#2/Integracionesporseguridad#4
|
||||
# PINNED_LABEL_1=LBRY LATAM
|
||||
# PINNED_URI_2=$/discover?t=lbrytvpaidbeta&fee_amount=>0&claim_type=stream&channel_ids=5af39f818f668d8c00943c9326c5201c4fe3c423,cda9c4e92f19d6fe0764524a2012056e06ca2055,760da3ba3dd85830a843beaaed543a89b7a367e7,40c36948f0da072dcba3e4833e90f71e16de78be,e8f68563d242f6ac9784dcbc41dd86c28a9391d6,7236fc5d2783ea7314d9076ae6c8a250e3992d1a,cf7792c2a37d0d76aaaff84aff0b99a8c791429d,8316ac90764fedf3147799b7b81a6575a9cc398e,8627af93c1a1219150f06b698f4b33e6ed2f1c1e,8972a1bd06de5186e5e89292b05aac8aaa817791,c5b0b17838df2f6c31162f64d55f60f34ae8bfc6,f576d5dba905fc179de880c3fe3eb3281ea74f59,97dd77c93c9603cbb2583f3589f7f5a6c92baa43,f399d873e0c37cf24de9569b5f22bbb30a5c6709,dba870d0620d41b2b9a152c961e0c06cf875ccfc,ca1fd651c9d14bf2e5088bb2aa0146ee7aeb2ae0,50ad846a4b1543b847bf3fdafb7b45f6b2f5844c,e09ff5abe9fb44dd0dd0576894a6db60a6211603,7b6f7517f6b816827d076fa0eaad550aa315a4e7,2068452c41d8da3bd68961335da0072a99258a1a,5da63df97c8255ae94a88940695b8471657dd5a1,3645cf2f5d0bdac0523f945be1c3ff60758f7845,4da85b12244839d6368b9290f1619ff9514ab2a8,4ad942982e43326c7700b1b6443049b3cfd82161,55304f219244abf82f684f759cc0c7769242f3b4,8f42e5b592bb7f7a03f4a94a86a41b1236bb099f,e2a014d885a48f5be2dc6409610996337312facb,c18996ca488753f714d36d4654715927c1d7f9c2,ebc4214424cfa683a7046e1f794fea1e44788d84,06b6d6d6a893fb589ec2ded948f5122856921ed5,07e4546674268fc0222b2ca22d31d0549dc217ee,060940e41973d4f7f16d72a2733138e931c35f41,f8d6eccd887c9cebd36b1d42aa349279b7f5c3ed,68098b8426f967b8d04cc566348b5c128823219e,2bfe6cdb24a21bdc1b76fb7c416edd50e9e85945,1f9bb08bfa2259629f4aaa9ed40f97e9a41b6fa1,2f20148495612946675fe1c8ea99171e4d950b81,bc6938fa1e09e840056c2e831abf9664f397c472,2a6194792beac5130641e932b5ac6e5a99b5ca4f,185ba2bd547a5e4a77d29fe6c1484f47db5e058f,29cc7f6081268eaa5b3f2946e0cd0b952a94812c,49389450b1241f5d8f4c8c4271a3eb56bba33965,ffdc62ac2f7549398d3aca9d2119e83d80d588d5,d7a4d2808074b0c55d6b239f69d90e7a4930f943,d58aa4a0b2f6c2504c3abce8de3f1afb71800acc,77ae23dc7eb8a75609881d4548a79e4935a89d37,f79bce8a60fbece671f6265adc39f6469f3b9b8c,051995fdf0af634e4911704057a551e9392e62b1
|
||||
# PINNED_LABEL_2=Paid Beta
|
||||
|
||||
|
||||
4
.eslintignore
Normal file
4
.eslintignore
Normal file
@@ -0,0 +1,4 @@
|
||||
node_modules/*
|
||||
./node_modules/**
|
||||
**/node_modules/**
|
||||
web/dist/**
|
||||
@@ -14,6 +14,11 @@
|
||||
"IS_WEB": true,
|
||||
"WEBPACK_PORT": true
|
||||
},
|
||||
"settings": {
|
||||
"react": {
|
||||
"version": "detect"
|
||||
}
|
||||
},
|
||||
"rules": {
|
||||
"brace-style": 0,
|
||||
"camelcase": 0,
|
||||
@@ -1,5 +1,7 @@
|
||||
[ignore]
|
||||
.*\.typeface\.json
|
||||
.*/node_modules/findup/.*
|
||||
|
||||
|
||||
[include]
|
||||
|
||||
@@ -8,6 +10,10 @@
|
||||
node_modules/lbry-redux/flow-typed/
|
||||
node_modules/lbryinc/flow-typed/
|
||||
|
||||
[untyped]
|
||||
.*/node_modules/lbry-redux
|
||||
.*/node_modules/lbryinc
|
||||
|
||||
[lints]
|
||||
|
||||
[options]
|
||||
@@ -27,6 +33,7 @@ module.name_mapper='^analytics\(.*\)$' -> '<PROJECT_ROOT>/ui/analytics\1'
|
||||
module.name_mapper='^rewards\(.*\)$' -> '<PROJECT_ROOT>/ui/rewards\1'
|
||||
module.name_mapper='^i18n\(.*\)$' -> '<PROJECT_ROOT>/ui/i18n\1'
|
||||
module.name_mapper='^effects\(.*\)$' -> '<PROJECT_ROOT>/ui/effects\1'
|
||||
module.name_mapper='^comments\(.*\)$' -> '<PROJECT_ROOT>/ui/comments\1'
|
||||
module.name_mapper='^config\(.*\)$' -> '<PROJECT_ROOT>/config\1'
|
||||
module.name_mapper='^web\/component\(.*\)$' -> '<PROJECT_ROOT>/web/component\1'
|
||||
module.name_mapper='^web\/effects\(.*\)$' -> '<PROJECT_ROOT>/web/effects\1'
|
||||
|
||||
72
.github/ISSUE_TEMPLATE/--first-timers.md
vendored
72
.github/ISSUE_TEMPLATE/--first-timers.md
vendored
@@ -1,72 +0,0 @@
|
||||
---
|
||||
name: "🙋First Timers Only"
|
||||
about: "Welcome New Contributors!"
|
||||
title: ''
|
||||
labels: 'first-timers-only'
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!-- If you are an Open Source Contributor, your first ever PR must have been a difficult experience.-->
|
||||
<!-- You can use this template to open an issue that will make this experience easier for new contributors.-->
|
||||
<!-- Make sure not to open a very difficult issue that may be too much for a new contributor.-->
|
||||
|
||||
### First Timers Only
|
||||
This issue is reserved for people who haven't contributed to our codebase before, or never contributed to Open Source. [About First Timers Only](https://www.firsttimersonly.com/).
|
||||
|
||||
We know that the process of creating a pull request is the biggest barrier for new contributors. This issue is for you 💝
|
||||
|
||||
If you have contributed before, **consider leaving this one for someone new** and looking through our general [help wanted](https://github.com/lbryio/lbry-desktop/labels/help%20wanted) issues. Thanks!
|
||||
|
||||
### 🤔 What you will need to know.
|
||||
|
||||
Nothing. This issue is meant to welcome you to Open Source :) We are happy to walk you through the process.
|
||||
|
||||
### What is to be done?
|
||||
<!-- Describe the issue here. You can add screenshots/GIFs too.-->
|
||||
<!-- Suggesting a potential approach to fix can be a good idea in some cases.-->
|
||||
|
||||
#### :mag_right: Files To Look Into:
|
||||
<!-- Looking at large codebases can be overwhelming. Narrowing down the search can help a lot.-->
|
||||
|
||||
### 📋 Step by Step
|
||||
|
||||
- [ ] :scroll: **Read The CONTRIBUTING File**: We welcome contributions from everyone, the [CONTRIBUTING](https://github.com/lbryio/lbry-desktop/blob/master/CONTRIBUTING.md) will help you get started.
|
||||
|
||||
**NOTE**: Useful links:
|
||||
- - [Git Commands](https://www.siteground.com/tutorials/git/commands/)
|
||||
- - [Installation Instructions](https://github.com/lbryio/lbry-desktop#running-from-source)
|
||||
|
||||
- [ ] **Fork This Repository**: A [fork](https://help.github.com/articles/fork-a-repo/) is a copy of this repository that is stored under your github account. A fork can be used to test out changes separately and then request to add those to the main repository as well!
|
||||
|
||||
- [ ] :raising_hand: **Claim this issue**: Comment below. If someone else has claimed it, ask if they've opened a pull request already and if they're stuck -- maybe you can help them solve a problem or move it along!
|
||||
|
||||
- [ ] **Create A New Branch**: A [branch](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/about-branches) is used to test new changes before they are merged with the stable `master` branch. You can create a new branch in the terminal. Make sure to name it descriptively!
|
||||
|
||||
- [ ] :memo: **Make The Requested Changes**
|
||||
|
||||
- [ ] :white_check_mark: **Commit Your Changes**: A Git [commit](https://help.github.com/en/desktop/contributing-to-projects/committing-and-reviewing-changes-to-your-project#about-commits) is a change that is finalized and recorded in the branch.
|
||||
|
||||
- [ ] :twisted_rightwards_arrows: **Start a Pull Request(PR)**. There are two ways how you can start a pull request:
|
||||
|
||||
1. If you are familiar with the terminal or would like to learn it, [here is a great tutorial](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github) on how to send a pull request using the terminal.
|
||||
|
||||
2. You can also [open a PR from the browser](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork).
|
||||
|
||||
- [ ] 🏁 **Done** Ask in comments for a review :)
|
||||
|
||||
### Please keep us updated
|
||||
|
||||
:speech_balloon: :bell: - We encourage contributors to be respectful to the community and provide an update **within a week** of claiming a first-timers-only issue. We're happy to keep it assigned to you as long as you need it if you update us with a request for more time or help, but if we don't see any activity a week after you claim it we may reassign it to give someone else a chance. Thank you in advance!
|
||||
|
||||
If this happens to you, don't sweat it! Grab another open issue.
|
||||
|
||||
### Is someone else already working on this?
|
||||
|
||||
🔗- We encourage contributors to link to the original issue in their pull request so all users can easily see if someone's already started on it.
|
||||
|
||||
👥- **If someone seems stuck, offer them some help!** Otherwise, [take a look at some other issues you can help with](https://github.com/lbryio/lbry-desktop/labels/help%20wanted). Thanks!
|
||||
|
||||
### 🤔❓ Questions?
|
||||
|
||||
Leave a comment below!
|
||||
98
.github/workflows/deploy.yml
vendored
Normal file
98
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,98 @@
|
||||
name: Node.js CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [master]
|
||||
pull_request:
|
||||
branches: [master]
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: Borales/actions-yarn@v2.3.0
|
||||
- run: yarn lint
|
||||
|
||||
build:
|
||||
needs: ['lint']
|
||||
name: 'build'
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [14.x]
|
||||
os:
|
||||
- ubuntu-latest
|
||||
- macos-latest
|
||||
- windows-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2-beta
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
|
||||
- uses: maxim-lobanov/setup-xcode@v1
|
||||
if: startsWith(runner.os, 'mac')
|
||||
with:
|
||||
xcode-version: '10.3.0'
|
||||
|
||||
- name: Download blockchain headers
|
||||
run: |
|
||||
mkdir -p ./static/daemon
|
||||
curl -o ./static/daemon/headers https://headers.lbry.io/blockchain_headers_latest
|
||||
ls ./static/daemon
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
yarn global add cross-env
|
||||
yarn
|
||||
yarn build
|
||||
node ./build/afterSignHook.js
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||
NOTARIZATION_USERNAME: ${{ secrets.NOTARIZATION_USERNAME }}
|
||||
NOTARIZATION_PASSWORD: ${{ secrets.NOTARIZATION_PASSWORD }}
|
||||
WIN_CSC_KEY_PASSWORD: ${{ secrets.WIN_CSC_KEY_PASSWORD }}
|
||||
CSC_KEY_PASSWORD: ${{ secrets.CSC_KEY_PASSWORD }}
|
||||
WIN_CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/win-csc-2020-2021-08.p12
|
||||
CSC_LINK: https://s3.amazonaws.com/files.lbry.io/cert/osx-cert.p12
|
||||
|
||||
# UI
|
||||
MATOMO_URL: https://analytics.lbry.com/
|
||||
MATOMO_ID: 4
|
||||
WELCOME_VERSION: 1.0
|
||||
DOMAIN: lbry.tv
|
||||
URL: https://lbry.tv
|
||||
SHARE_DOMAIN_URL: https://open.lbry.com
|
||||
SITE_TITLE: lbry.tv
|
||||
SITE_NAME: lbry.tv
|
||||
SHOW_ADS: false
|
||||
YRBL_HAPPY_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-happy/7aa50a7e5adaf48691935d55e45d697547392929/839d9a
|
||||
YRBL_SAD_IMG_URL: https://cdn.lbryplayer.xyz/api/v3/streams/free/yrbl-sad/c2d9649633d974e5ffb503925e1f17d951f1bd0f/f262dd
|
||||
ENABLE_COMMENT_REACTIONS: true
|
||||
DEFAULT_LANGUAGE: en
|
||||
KNOWN_APP_DOMAINS: lbry.tv,lbry.lat,odysee.com
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: 0
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: |
|
||||
startsWith(runner.os, 'linux')
|
||||
with:
|
||||
name: Linux
|
||||
path: ./dist/electron/*.*
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: |
|
||||
startsWith(runner.os, 'mac')
|
||||
with:
|
||||
name: macOS
|
||||
path: ./dist/electron/*.*
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: |
|
||||
github.event.pull_request.head.repo.full_name == github.repository
|
||||
with:
|
||||
name: Windows
|
||||
path: ./dist/electron/*.*
|
||||
10
.gitignore
vendored
10
.gitignore
vendored
@@ -13,9 +13,19 @@ package-lock.json
|
||||
.transifexrc
|
||||
.idea/
|
||||
/build/daemon*
|
||||
/lbrytv/dist/
|
||||
/lbrytv/node_modules
|
||||
/static/lbry-first/
|
||||
/build/lbryFirst*
|
||||
/web/dist/*
|
||||
/web/node_modules/*
|
||||
/web/.env
|
||||
/web/.env.defaults
|
||||
/custom/*
|
||||
/custom/homepages/*
|
||||
!/custom/homepages/.gitkeep
|
||||
!/custom/homepages
|
||||
!/custom/homepage.example.js
|
||||
!/custom/robots.disallowall
|
||||
!/custom/robots.allowall
|
||||
.env
|
||||
|
||||
78
.travis.yml
78
.travis.yml
@@ -1,78 +0,0 @@
|
||||
matrix:
|
||||
include:
|
||||
- os: osx
|
||||
env: TARGET=mac
|
||||
osx_image: xcode10
|
||||
language: node_js
|
||||
node_js: '10'
|
||||
- os: linux
|
||||
env: TARGET=windows
|
||||
services: docker
|
||||
language: node_js
|
||||
node_js: '10'
|
||||
- os: linux
|
||||
env: TARGET=linux
|
||||
language: node_js
|
||||
node_js: '10'
|
||||
cache: false
|
||||
before_install:
|
||||
- |
|
||||
unset TRAVIS_COMMIT_MESSAGE;
|
||||
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
|
||||
mkdir -p /tmp/git-lfs && curl -L https://github.com/github/git-lfs/releases/download/v2.3.1/git-lfs-$([ "$TRAVIS_OS_NAME" == "linux" ] && echo "linux" || echo "darwin")-amd64-2.3.1.tar.gz | tar -xz -C /tmp/git-lfs --strip-components 1
|
||||
export PATH="/tmp/git-lfs:$PATH"
|
||||
else
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get install --no-install-recommends -y gcc-multilib g++-multilib wget
|
||||
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version 1.6.0
|
||||
export PATH="$HOME/.yarn/bin:$PATH"
|
||||
fi
|
||||
before_script:
|
||||
- git lfs pull
|
||||
- if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then unset WIN_CSC_LINK; unset CSC_LINK; fi
|
||||
- wget https://headers.lbry.io/blockchain_headers_latest -O $TRAVIS_BUILD_DIR/static/daemon/headers
|
||||
script:
|
||||
- travis_wait 30
|
||||
- |
|
||||
if [ "$TARGET" == "windows" ]; then
|
||||
# Remove any special characters before adding to our list of ENVs
|
||||
# https://github.com/electron-userland/electron-builder/issues/2450#issuecomment-421788155
|
||||
ENVS=`env | grep -iE '(DEBUG|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|_TOKEN|_KEY|AWS_|STRIP|BUILD_|TARGET)([A-Z]|_)*=' | sed -n '/^[^\t]/s/=.*//p' | sed '/^$/d' | sed 's/^/-e /g' | tr '\n' ' '`
|
||||
docker run $ENVS --rm \
|
||||
-v ${PWD}:/project \
|
||||
electronuserland/builder:wine \
|
||||
/bin/bash -c "env | grep -v '\r' | grep -iE 'DEBUG|TARGET|NODE_|ELECTRON_|YARN_|NPM_|CI|CIRCLE|TRAVIS|APPVEYOR_|CSC_|GH_|GITHUB_|BT_|AWS_|STRIP|BUILD_|WIN_' && yarn --link-duplicates --pure-lockfile && yarn build --win --publish onTag";
|
||||
fi
|
||||
- if [ "$TARGET" == "mac" ]; then yarn build --publish onTag; fi
|
||||
- if [ "$TARGET" == "linux" ]; then yarn --link-duplicates --pure-lockfile && yarn
|
||||
build --linux --publish onTag; fi
|
||||
addons:
|
||||
artifacts:
|
||||
working_dir: dist
|
||||
paths:
|
||||
- $(git ls-files -o dist/{*.dmg,*.exe,*.deb,*.AppImage} | tr "\n" ":")
|
||||
target_paths:
|
||||
- '/app/build-${TRAVIS_BUILD_NUMBER}_commit-${TRAVIS_COMMIT:0:7}$([ ! -z ${TRAVIS_TAG}
|
||||
] && echo _tag-${TRAVIS_TAG})'
|
||||
env:
|
||||
global:
|
||||
- ARTIFACTS_REGION=us-east-1
|
||||
- ARTIFACTS_BUCKET=build.lbry.io
|
||||
- DANGER_GITHUB_API_TOKEN=f8b612049cbda985c251e18ae36c7a2b9c6c92df
|
||||
- ARTIFACTS_DEBUG=1
|
||||
- WIN_CSC_LINK=https://s3.amazonaws.com/files.lbry.io/cert/win-csc-2019-2020-08.p12
|
||||
- CSC_LINK=https://s3.amazonaws.com/files.lbry.io/cert/osx-cert.p12
|
||||
#AWS_SECRET_ACCESS_KEY
|
||||
- secure: aF0dZ1ub0r6X5SaTH7YYRpV8cl2gkU2tA7y2tkvGZQL0+Vv2FvkhwaXREa9IM9djm7r3W7I8vEekk6Skn300kIBwQ04COxgu+Oeqjsc2a529wmF9AN5EwKExKkVQFIjMjpMBmd/fE05PD29C0vULdtIMX8uhDe5zFE+tGD1QmwKVZ+55oCxJmt7vsQwQr46s/BsPODrZhvSUPWTUG4HSsc5DJwe/XYY+35vWQsnpCkBVabAZg+lnOpqLioRNzTsBX1oSkqTX9uvOC6fN+NlpbJWetzXsBciFcMHQCx9UHxu+Ibn3W3V8FVYRuFLAinhIg+JoVQHU8mH60ggjizATpgx12riP9e/Uwho5x5bgIYmnIBf4AHqupPv40iC/THMvsS08hCQHicu+/WiAvvN8wNQ1sqpj0+RTreB+4/qdRdwTs70t4jNV83cP+nAuekMCC7uYQ08GLmFNaa+x8NgDZa3JQv7EmXU0ALWVPeJ9UEV+dhEs5iI+7bLEhTUOuvBBWo17F4pst3pfS1j7md1x4wKFRWyP7IFmjK+L1KiAH94c/LIz2Nlp5yCDfbcwU5W/wCHYAxu5c8qnAlkxeub0GpxtZ66j6oOehk1lsHYxaZcBxyn7XhM1A6Mjxgy9OG0WGyYun8iH3aa4WcY0BO21l7je75s7l0qNSRS80st8kUE=
|
||||
#AWS_ACCESS_KEY_ID
|
||||
- secure: HHlUGaEjk0qsW9qb/93jdFhJypiDuJ0e6Z4UClW3ciMfdZ22Ur4D0oL0mgVguigTjdkf1Yy4Z1kWtWvtvQ8DBI+mdOl5GTMpX5nMattcuK/4gFXmqz30S3c07IPkilGKkAT64JqRGT7AvQTaV/tXqNNN9BbWCTAJSnhfzYJFvZQjnSmAAQvbqzMWEEein53244fWbDio462T7vzfbEHJD1pVUSrAMrKDgFSrIKJf4GQHceUk+fqWBjAsWN8USboo88JSLXn5qhD3ZczsgtZ2gi2KTvdfrHfZ5SpOzwc2AGr8U1laQzzW8c8xsPJPmM/3dCri/clcXassa4t/+2INYTPhKbmaD9hvjFRRMpoNjMCmPRJOmojxit8tqzCrw4nSGdr3/Bt0JjpLq90mfyL83YYU4gJXF97KzTl0lCy/DFXjBiHA9riRJVaXn3CI6L0i1RLCJI+C/rT9ErFB767t0aQtXlIWSZQ+IqWaoUdp57t0e2EtbRcjK7IYIXLNgZSbR0bY/TS005D/xZkexCpAtcV9F6iqDYP3HbGyiQqC75se0MqpNrZAx1a7WsSnumOcmtuU6LRriwjM0GXEACfGLCp4w4LBzKPwrOOg4QOhewHKgxpUff8KMlfTZ+Z8B7NBNjKSPbxiMedmpsiWpPRy6VeyvwNz32PUpjdsF3tIYMk=
|
||||
#GH_TOKEN
|
||||
- secure: g0gSiOmCKFzxLFV//oogmex+MkumCcGJ8CtvLzojAw1qhI1P6dGRH06yuCgBNW4PQGbbrYR2tntGEeq66LZ1bU7BJ2bdkv5lBi15JPH4POpA3OSc88YebitKIyIBI2WHA3VNCkF1JEFvrfTUX+4PjP+9h6vZ9tdfzezNTpc70SrGkWMhaoe+F8u6jCL63VBpnncf0foz3WlqUFNoIdinQLYxI6S2QmHz1p1HToC+MOosBgWDufX2+6B/Efq7JDFZgx/zItFzR1OCafKx8rScUd4woAqK+8mt862IzzEbztTv6IPSdhx/hsbO7rHMcjDFk/MuDeC9TaaXqMvvKmLuvWKH+dy4BvIiJJ/WuDfzumrw+8BvTbcnXFXkEXTlkQnZD0otBZsmI4/OPH5vIGUmVIwBFXjPBcNq/Xwig8hRCxrdioEZPO4C17fMCdOn3gAx+GcMddfAIKnrlG/XK2jL8kCylL7++OEkedzYiHWA7p9eaJDjxYmIxKcfYTyF4VIMYS/wAC5W1zi1AjM5BiUhBGp/Vd+f3UUTOsqWOmS4A8cqhK/rbx4xgdwUuv2DoljeQtWd2xdZFr10L2ErmEIdfdtZBVyauaGOhhXUqpSAB5PAwSRNNWkZFCJXmqMHemih4jlfN/KS+rujh5dbyXz81BPjyxrDAziO4Q19rz7hmVI=
|
||||
#ARTIFACTS_KEY
|
||||
- secure: giJRkODdgvMpaLh58c3UKTy6j3IjUVQ2wVvLmECN8caVLuBnEp3U56rUT7sQPzeMoaF9goOLKXD1o+qKdGsLz2Dedi/3vFr3IXTgpYwO03eMkylYUDUwKXV1Fv14ME+wknw/Fshmty1XAc/RwlTaCks9usIRT9OE75HvV8ILVfLdSwwRR/TKFEdEDjAY/3ROVFsleDKBIe1AG/AHeN37Mwqfo39zpN5Zidm3HUegujsMsHtPQtUUCvCxiaiBtqIz79WQuiXjelLWrV53k+ulpptz4T6M8FO5jxBCL5HQMbYy4J8BhukAPHUcTVzarsDe1XEmP6xtClcAydMiHmzUBh9VbvRF8AKwGGO41g6OasgMaJ/eUlACGWTIS2AsqgkXCEgWRtswwI4edLgT/F74fKxGV82zRYLcmjWceGc9H6m2YfIIQZ2PNsDloFgTWa63oZ1sT20fWmNohD3IgVK21rjrCnMbp5/RfBdihR1+GsS8wMA15nhUW3SHfSHKV0009FZdDjxgmigjjmFt1/SM8YGZDijQc7DoUsrScR9n2JR+KVqEED3BYOviw0M0blb6b2dqK0A3+N5C1RGt8Uu8AAuAzdPDviL38m4n1UOdI1Tij1boSfr1USvfipPfQXrqSWHIY3RITMmjPREmcdj2dbhjoUEFaFfp/b3sJxUI3I4=
|
||||
#ARTIFACTS_SECRET
|
||||
- secure: RtPES82DBisaCkernDm10u8mzNc8K4EyyTJUCopcFFJHfFpleuJOoXNFZGXixjHXWTxqc5+IjLThBZFG6krTpD4ocftfkBNeVDXL91JsGRW6X4VBpKaJp1UJZZiYjpPZRJDwVuIb570WcX3xXmsvAwwdODkeXgBZoOw+LZIz4HV3OACi5iaWCx4+2WvQiaz/6mRkLlw9iY1m9gCGQXXUSWyY+bGWsOdGWpfp/VfzpX7mBJbcIYjvRYSnBtVUFkEzxHlaR/CFc7Jio45EUImhBKqKV8QGAiv9AowcWqQn8y2SuW8J66bkaZGbGpyEdsRQDJKUU5naRIFJ/002e4XjI2moBfSHHnFTMH/AawA4b+gCjein8jDiRugJw8AqC4KpG660SFJwC4A8IxfPcXWcykahrL6kJhs+NFbyxQEJIMUqP6UAAiPAuUr/Whq1F8x5b39pEibRZ3Vv0Bix/lUj4cWZYRBL1ckoUgSCeG7llkAdnxLuQKfDvTw+HFcWGq7yg/ye7H7CwpBJkSSOlnQ61nuucC82hVqBGoPGbFW3vjS0BqesLcaO7kwW/fdBnIxwLiWWHDWol0aLfQLEzjUzpS+tA1YYKvrG+yNMEeYtHEK9ZcltQD52uEtjK26DIY8tQU8PxMlXha6/XTOlt8MIcl8IPULmVWKT9k8LPTFQiXc=
|
||||
#CSC_KEY_PASSWORD
|
||||
- secure: TDKeF7/WGwR+di+JhNp29x7NPzVMO/q+72n58zB5goI1NUKaeKgjeWbfVYx9f+4G9a9/pdDVUfORt8i6OW8ZhhqYS4E8G5F56q+oX3nrjNqM8NqoK09ehZS/wdYGbenG9oTfXYenDdwusZV4Fq0BRRLjqAIXPQCKg3//MKseh/1fHDGVGXpYUimHRSCkwspbbfB/9Qw9KEBjweeXiAwB+5F+E7fPlVtqsIvtkkED1hKe0Z8HdECC6JTZ0ZHPDDFGV3aondXQDgUlfchnZ6HDdNDO5y/hPEj0laiZQ7BssenJ8Z7qjHc5O9AKXfG+6WFICHvtgjQ0+x6rk6gpvJcyI1x2+Kck/s0EcSkFY+Yz81BxdehIeKPn9U8LpGaFbtxsp01661yeaIpAqT/PqFsdj/kFXFT6gwZlGGPMBm2WgQR4A61qkOO1jokqz/z6CnY+MNeE8E1Fh4bFoZ0JwUJFJugoyDahHpVlLw5lZaSipJO6RZ1xjoZ3XGmxvtkM4dQ16xQ++Q8EgD878uCWn2jZ5YTQdKANfXYTKSiQfoEjLeX0T6I6GSdim4ZURjcolmGNMH/3jhISOXj+e2UkLc6jwO4Ek084o6ciJ2JjqEhXvXOCeRJ2I9cf2dEk7CvtbitiDly6XATo2FP4hqNdcNNWyj/jFvuTwFT6hzBqLk1BCBc=
|
||||
#WIN_CSC_KEY_PASSWORD
|
||||
- secure: S4kxB3fgQ5WtxsHopOtOJHd+yZg635r/XEf2qfoOvehhubhQVZ6qnlIuWGeGrZkV8SGOWi5buple2q7w9iw3Ac3InYG2P5ZUNJ9ANve0s1GgpBf9qAEb0IlqRbvZfM0X7KZJZGMHasEprjdCxaihlKkEudtaSvoF/8Og7OxtygQmLOu2amN/p0FYr6HY5KLFgpbGBMXloODsvsrGzcLWQyhszdRlaiHEDGmIklDjEVRW+Y5KVxdxpKu3t6R/enFpsBFF3mhrXx8yxSscjxbf4QsatMrD6ZMLU0J5xcEFroTU4JINHnz3kPEdFvs7jfCOZD6dDu5SKDBchvvfS1wllY65r8o3PySu/opCaZb7XS2j5IK9ZJSqjoW+d0519Awb/oyhmYW8GGl0XQZfCkdRrSoOR1Ww+/wZ8K8b+QHUSm99acex/ypCjJio7C7YrUfRGbCplhGHIFnhn4pJZFSQ8YVEovdSLDk3/NnriA5zJffMM+881rrXe5AjD9fya6Gm1Ha/g0HRcCtA+ocdBENkfy6wXugkE+IDyoO9NhnT+VfuqlToEt0JHD5eLgEp/YTIUD1N1CUMQD2Z/mOSdVDnMENPy+S9i8Sz4MK7wH0iTeyWJDLYbqRJBHkd66m77Tl7RnMIzL0so7JVm4AwA/VIQn2qxgPESJKktgRjI0vKZTo=
|
||||
202
CHANGELOG.md
202
CHANGELOG.md
@@ -8,15 +8,199 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
|
||||
### Added
|
||||
|
||||
- Add "tap to unmute" button for videos that start with audio muted _community pr!_ ([#4365](https://github.com/lbryio/lbry-desktop/pull/4365))
|
||||
- Allow upgrade bar to be dismissed per session _community pr!_ ([#4413](https://github.com/lbryio/lbry-desktop/pull/4413))
|
||||
- Pause the "autoplay next" timer when performing long operations such as Tipping, Supporting or commenting _community pr!_ ([4419](https://github.com/lbryio/lbry-desktop/pull/4419))
|
||||
- Email notification management page ([#4409](https://github.com/lbryio/lbry-desktop/pull/4409))
|
||||
- Publish Page improvements to prevent accidental overwrites of existing claims _community pr!_ ([#4416](https://github.com/lbryio/lbry-desktop/pull/4416))
|
||||
- Option to remove abandoned claims from Blocked Channels page _community pr!_ ([#4433](https://github.com/lbryio/lbry-desktop/pull/4433))
|
||||
- Wallet balance UI improvements ([#5276](https://github.com/lbryio/lbry-desktop/pull/5387))
|
||||
- Mass tip unlock ([#5409](https://github.com/lbryio/lbry-desktop/pull/5387))
|
||||
- Zoomable image viewer in Markdown (posts and comments) _community pr!_ ([#5387](https://github.com/lbryio/lbry-desktop/pull/5387))
|
||||
- Enable PDF Viewer in App _community pr!_ ([#2903](https://github.com/lbryio/lbry-desktop/issues/2903))
|
||||
- The search bar now handles both lbry.tv and Odysee links regardless of which site the user is in ([#5604](https://github.com/lbryio/lbry-desktop/issues/5604))
|
||||
- The video/audio player's control tooltip is now localized and includes hints for keyboard shortcuts ([#5584](https://github.com/lbryio/lbry-desktop/issues/5584))
|
||||
- Finnish and Norwegian language support ([#5532](https://github.com/lbryio/lbry-desktop/issues/5532))
|
||||
|
||||
### Changed
|
||||
|
||||
- Re-enable PDF Viewer in desktop app _community pr!_ ([#5420](https://github.com/lbryio/lbry-desktop/issues/5420))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Player doesn't stop playing when editing a comment that includes a video url _community pr!_ ([#5384](https://github.com/lbryio/lbry-desktop/pull/5384))
|
||||
- Main video/audio playback stopped every time a comment is edited or deleted ([#5606](https://github.com/lbryio/lbry-desktop/pull/5606))
|
||||
- Winning search result not working correctly with mature content enabled _community pr!_ ([#5388](https://github.com/lbryio/lbry-desktop/pull/5388))
|
||||
- Home/End key not working as expected in Search Bar ([#5642](https://github.com/lbryio/lbry-desktop/pull/5642))
|
||||
- Fixes to inline videos in comments _community pr!_ ([#5389](https://github.com/lbryio/lbry-desktop/pull/5389))
|
||||
- Search page crashing on some results ([#5428](https://github.com/lbryio/lbry-desktop/pull/5428))
|
||||
- Long channel names caused comments to extend underneath related content _community pr!_ ([#5431](https://github.com/lbryio/lbry-desktop/pull/5431))
|
||||
- Keep floating player always visible _community pr!_ ([#5448](https://github.com/lbryio/lbry-desktop/pull/5448))
|
||||
- LBRY Desktop incorrectly setting itself as the default HTML-file application in Linux ([#5617](https://github.com/lbryio/lbry-desktop/pull/5617))
|
||||
- All notifications being cleared when only 1 is clicked ([#5619](https://github.com/lbryio/lbry-desktop/pull/5619))
|
||||
- Markdown editor's "Create Link (Ctrl-K)" action now directly highlights the URL stub when the label is present ([#5585](https://github.com/lbryio/lbry-desktop/issues/5585))
|
||||
|
||||
## [0.49.4] - [2021-01-26]
|
||||
|
||||
### Added
|
||||
|
||||
- Theater mode ([#5255](https://github.com/lbryio/lbry-desktop/pull/5255))
|
||||
- Repost flow improvements ([#5293](https://github.com/lbryio/lbry-desktop/pull/5293))
|
||||
- Desktop: Enable 'Alt+Left/Right' for history navigation _community pr!_ ([#5203](https://github.com/lbryio/lbry-desktop/pull/5203))
|
||||
- Make playback rate setting persistent _community pr!_ ([#5310](https://github.com/lbryio/lbry-desktop/pull/5310))
|
||||
- Make UI zoom setting persistent _community pr!_ ([#5385](https://github.com/lbryio/lbry-desktop/pull/5385))
|
||||
|
||||
### Changed
|
||||
|
||||
- No longer supporting 32 bit windows
|
||||
- Updated lbry-sdk to [0.88.0](https://github.com/lbryio/lbry-sdk/releases/tag/v0.88.0)
|
||||
- Improve how spendable balance is displayed ([#5409](https://github.com/lbryio/lbry-desktop/pull/5276))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Lots of bug fixes
|
||||
- Fix bug where subscriptions could be lost ([#5302](https://github.com/lbryio/lbry-desktop/pull/5302))
|
||||
|
||||
## [0.49.3] - [2020-12-30]
|
||||
|
||||
### Added
|
||||
|
||||
- Turn timestamps in a video's description and comments into links _community pr!_ ([#5156](https://github.com/lbryio/lbry-desktop/pull/5156))
|
||||
- Mobile video player enhancements and the ability to tap on the left and right edges to seek _community pr!_ ([#5119](https://github.com/lbryio/lbry-desktop/pull/5119))
|
||||
- Added tile layout for tags page [a0ec5](https://github.com/lbryio/lbry-desktop/commit/a0ec5097d93496b92736e1682f9fb2d20dadf425).
|
||||
|
||||
### Changed
|
||||
|
||||
- Repost option now has a full page and can be triggered from search results (click "View competing uploads for ...").
|
||||
|
||||
### Fixed
|
||||
|
||||
- [Upgrade SDK to 0.87.0](https://github.com/lbryio/lbry-sdk/releases/tag/v0.87.0). Forces wallet resync which fixes balance issues for some users and improves memory usage.
|
||||
|
||||
## [0.49.1] - [2020-12-15]
|
||||
|
||||
### Fixed
|
||||
|
||||
- Sidenav unable to open when on the file page
|
||||
- Fix "open external" button to open files on your OS
|
||||
|
||||
## [0.49.0] - [2020-12-10]
|
||||
|
||||
### Added
|
||||
|
||||
- Better search suggestions ([#5124](https://github.com/lbryio/lbry-desktop/pull/5124))
|
||||
- Inline video player in comments/markdown posts ([#4894](https://github.com/lbryio/lbry-desktop/pull/4894))
|
||||
- Better handling of winning claim + top page improvements ([#4944](https://github.com/lbryio/lbry-desktop/pull/4944))
|
||||
- Comment pinning ([#4895](https://github.com/lbryio/lbry-desktop/pull/4895))
|
||||
- Comment reactions ([#4895](https://github.com/lbryio/lbry-desktop/pull/4895))
|
||||
- Language search ([#4907](https://github.com/lbryio/lbry-desktop/pull/4907))
|
||||
- Content notifications ([#4981](https://github.com/lbryio/lbry-desktop/pull/4981))
|
||||
- Customize scrollbar to fit the dark theme _community pr!_ ([#5056](https://github.com/lbryio/lbry-desktop/pull/5056))
|
||||
- Keyboard shortcut: adjust video playback-rate using ">" and "<" _community pr!_ ([#5075](https://github.com/lbryio/lbry-desktop/pull/5075))
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated lbry-sdk to [0.86.1](https://github.com/lbryio/lbry-sdk/releases/tag/v0.86.1)
|
||||
- Refactored file/lbc details UI ([#4937](https://github.com/lbryio/lbry-desktop/pull/4937))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Loss of subscriptions on startup ([#4882](https://github.com/lbryio/lbry-desktop/pull/4882))
|
||||
- Fix lost search results when a timeout occurs _community pr!_ ([#4996](https://github.com/lbryio/lbry-desktop/pull/4996))
|
||||
- Can't slide volume slider in pop-sout mode _community pr!_ ([#4913](https://github.com/lbryio/lbry-desktop/pull/4913))
|
||||
- Hide mouse cursor when video is playing _community pr!_ ([#5046](https://github.com/lbryio/lbry-desktop/pull/5046))
|
||||
|
||||
## [0.48.2] - [2020-10-16]
|
||||
|
||||
### Changed
|
||||
|
||||
- Disable snapshot thumbnail upload on desktop until Electron issue is fixed ([#4905](https://github.com/lbryio/lbry-desktop/pull/4905))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Files not opening externally properly ([#4908](https://github.com/lbryio/lbry-desktop/pull/4908))
|
||||
|
||||
## [0.48.1] - [2020-10-14]
|
||||
|
||||
### Added
|
||||
|
||||
- Add Publish Preview dialog _community pr!_ ([#4620](https://github.com/lbryio/lbry-desktop/pull/4620))
|
||||
- "ctrl/cmd+enter" can now be used to directly submit a comment ([#4809](https://github.com/lbryio/lbry-desktop/pull/4809))
|
||||
- Deeper comment thread depth ([#4868](https://github.com/lbryio/lbry-desktop/pull/4868))
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated lbry-sdk to [0.83.0](https://github.com/lbryio/lbry-sdk/releases/tag/v0.83.0)
|
||||
- Upgrade electron to v9 ([#4824](https://github.com/lbryio/lbry-desktop/pull/4824))
|
||||
- Fade out expandable areas (e.g. comments, file description) when collapsed _community pr!_ ([#4818](https://github.com/lbryio/lbry-desktop/pull/4818))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Videos started as muted on initial desktop session _community pr!_ ([#4864](https://github.com/lbryio/lbry-desktop/pull/4864))
|
||||
|
||||
## [0.48.0] - [2020-09-23]
|
||||
|
||||
### Added
|
||||
|
||||
- New File Page layout + make sidebar collapsable ([#4648](https://github.com/lbryio/lbry-desktop/pull/4648))
|
||||
- Block mature content when accessed directly from URL _community pr!_ ([#4560](https://github.com/lbryio/lbry-desktop/pull/4560))
|
||||
- You can now add LBRY as a search engine in your browser (via OpenSearch) _community pr!_ ([#4640](https://github.com/lbryio/lbry-desktop/pull/4640))
|
||||
- In-app text and markdown publishing and editing _community pr!_ ([#4591](https://github.com/lbryio/lbry-desktop/pull/4591))
|
||||
- New comment stats on creator analytics page _jiggytom certified_ ([#4715](https://github.com/lbryio/lbry-desktop/pull/4715))
|
||||
|
||||
### Changed
|
||||
|
||||
- Move file properties over thumbnails for more space-saving ([#4632](https://github.com/lbryio/lbry-desktop/pull/4632))
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix sluggish Back button when navigation back to channels with lots of comments _community pr!_ ([#4576](https://github.com/lbryio/lbry-desktop/pull/4576))
|
||||
- Fix 'Related' and 'Comments' section lazy-load not working in some scenarios _community pr!_ ([#4586](https://github.com/lbryio/lbry-desktop/pull/4586))
|
||||
- Fix comment-creation failure if you have recently deleted a channel _community pr!_ ([#4630](https://github.com/lbryio/lbry-desktop/pull/4630))
|
||||
- Tip Modal: Don't do final submit when the intention is to create New Channel _community pr!_ ([#4629](https://github.com/lbryio/lbry-desktop/pull/4629))
|
||||
- Fix related + search results loading slowly ([#4657](https://github.com/lbryio/lbry-desktop/pull/4657))
|
||||
- Fix partially untranslated text in the Upgrade Modal _community pr!_ ([#4722](https://github.com/lbryio/lbry-desktop/pull/4722))
|
||||
- Fix floating player being paused after dragging _community pr!_ ([#4710](https://github.com/lbryio/lbry-desktop/pull/4710))
|
||||
- Web: Fix 'Download' not triggering until second attempt _community pr!_ ([#4721](https://github.com/lbryio/lbry-desktop/pull/4721))
|
||||
- Floating player: Stay within screen when window is resized _community pr!_([#4750](https://github.com/lbryio/lbry-desktop/pull/4750))
|
||||
- App crash when including % sign in search _community pr!_([#4753](https://github.com/lbryio/lbry-desktop/pull/4753))
|
||||
- Fix markdown editor "preview" not working when `<iframe>`s are present _community pr!_([#4767](https://github.com/lbryio/lbry-desktop/pull/4767))
|
||||
- First comment on claim not showing up immeditately ([#4747](https://github.com/lbryio/lbry-desktop/pull/4747))
|
||||
- Fix "Password updated successfully" kept showing up _community pr!_([#4766](https://github.com/lbryio/lbry-desktop/pull/4766))
|
||||
- Fix "Price=free" giving 0 results in Following query _community pr!_ ([#4489](https://github.com/lbryio/lbry-desktop/pull/4489))
|
||||
|
||||
## [0.47.1] - [2020-07-23]
|
||||
|
||||
### Added
|
||||
|
||||
- Allow zooming on Desktop _community pr!_ ([#4513](https://github.com/lbryio/lbry-desktop/pull/4513))
|
||||
- Show "YT Creator" label in File Page as well _community pr!_ ([#4523](https://github.com/lbryio/lbry-desktop/pull/4523))
|
||||
- Add option to retry video stream on failure _community pr!_ ([#4541](https://github.com/lbryio/lbry-desktop/pull/4541))
|
||||
- Allow blocking channels from comments ([#4557](https://github.com/lbryio/lbry-desktop/pull/4557))
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated lbry-sdk to [0.79.1](https://github.com/lbryio/lbry-sdk/releases/tag/v0.79.1)
|
||||
|
||||
### Fixed
|
||||
|
||||
- Fix 'transcoding' checkbox state when switching file types _community pr!_ ([#4529](https://github.com/lbryio/lbry-desktop/pull/4529))
|
||||
- Fix channel file-search not available in mobile _community pr!_ ([#4527](https://github.com/lbryio/lbry-desktop/pull/4527))
|
||||
- New Channel: Fix incorrect GUI configuration at entry _community pr!_ ([#4545](https://github.com/lbryio/lbry-desktop/pull/4545))
|
||||
- Hide blocked channels in comments ([#4557](https://github.com/lbryio/lbry-desktop/pull/4557))
|
||||
|
||||
## [0.47.0] - [2020-07-13]
|
||||
|
||||
### Added
|
||||
|
||||
- Add ability to sign supports ([#4382](https://github.com/lbryio/lbry-desktop/pull/4382))
|
||||
- Add "tap to unmute" button for videos that start with audio muted _community pr!_ ([#4365](https://github.com/lbryio/lbry-desktop/pull/4365))
|
||||
- Allow upgrade bar to be dismissed per session _community pr!_ ([#4413](https://github.com/lbryio/lbry-desktop/pull/4413))
|
||||
- Pause the "autoplay next" timer when performing long operations such as Tipping, Supporting or commenting _community pr!_ ([4419](https://github.com/lbryio/lbry-desktop/pull/4419))
|
||||
- Email notification management page ([#4409](https://github.com/lbryio/lbry-desktop/pull/4409))
|
||||
- Publish Page improvements to prevent accidental overwrites of existing claims _community pr!_ ([#4416](https://github.com/lbryio/lbry-desktop/pull/4416))
|
||||
- Option to remove abandoned claims from Blocked channels page _community pr!_ ([#4433](https://github.com/lbryio/lbry-desktop/pull/4433))
|
||||
- New channel create/edit page ([#4445](https://github.com/lbryio/lbry-desktop/pull/4445))
|
||||
- Add dialog to copy various types of links for a claim _community pr!_ ([#4474](https://github.com/lbryio/lbry-desktop/pull/4474))
|
||||
- Add password reset link to settings page for logged in users _community pr!_ ([#4473](https://github.com/lbryio/lbry-desktop/pull/4473))
|
||||
|
||||
### Changed
|
||||
|
||||
- Updated lbry-sdk to [0.77.0](https://github.com/lbryio/lbry-sdk/releases/tag/v0.77.0)
|
||||
- Merged Tip and Support Buttons into one UI on file page ([#4382](https://github.com/lbryio/lbry-desktop/pull/4382))
|
||||
|
||||
### Fixed
|
||||
@@ -30,7 +214,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
||||
- Fix "Refresh" on Publish page not showing the loading indicator when pressed _community pr!_ ([#4451](https://github.com/lbryio/lbry-desktop/pull/4451))
|
||||
- Fix video duration not appearing on Mobile with enough width _community pr!_ ([#4452](https://github.com/lbryio/lbry-desktop/pull/4452))
|
||||
- Fix video transcode setting not reflected correctly (MP3 incorrectly transcoded to MP4) _community pr!_ ([#4458](https://github.com/lbryio/lbry-desktop/pull/4458))
|
||||
- Fix search results not appearing when scrolling due to long Tags or Following list in the navigation bar _community pr!_ ([#4465](https://github.com/lbryio/lbry-desktop/pull/4465))
|
||||
- Fix scrolling glitch when results are exactly the page size _community pr!_ ([#4521](https://github.com/lbryio/lbry-desktop/pull/4521))
|
||||
- Fix search results not appearing when scrolling due to long Tags or Following list in the navigation bar _community pr!_ ([#4465](https://github.com/lbryio/lbry-desktop/pull/4465))
|
||||
- Fix unmuted state lost or reverted when playing a new video _community pr!_ ([#4483](https://github.com/lbryio/lbry-desktop/pull/4483))
|
||||
|
||||
## [0.46.2] - [2020-06-10]
|
||||
|
||||
@@ -1333,7 +1519,7 @@ This release includes a breaking change that will reset many of your settings. T
|
||||
|
||||
### Removed
|
||||
|
||||
- Removed the label "Max Purchase Price" from settings page. It was redundant.
|
||||
- Removed the label "Max purchase price" from settings page. It was redundant.
|
||||
- Unused old files from previous commit(9c3d633)
|
||||
|
||||
### Fixed
|
||||
|
||||
13
Dockerfile
13
Dockerfile
@@ -1,13 +0,0 @@
|
||||
FROM node:10
|
||||
EXPOSE 1337
|
||||
|
||||
RUN yarn -v && npm -v
|
||||
RUN apt-get update -y && apt-get upgrade -y
|
||||
|
||||
WORKDIR /app
|
||||
ENV PATH="/app/node_modules/.bin:${PATH}"
|
||||
|
||||
COPY ./ ./
|
||||
|
||||
RUN rm -rf node_modules && APP_ENV=web yarn && SDK_API_URL='https://api.lbry.tv/api/proxy' NODE_ENV=production yarn compile:web --display errors-only
|
||||
CMD node ./dist/web/server.js
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2020 LBRY Inc.
|
||||
Copyright (c) 2017-2021 LBRY Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
17
README.md
17
README.md
@@ -29,7 +29,7 @@ This repo contains the UI code that powers the official LBRY desktop app, as wel
|
||||
</a>
|
||||
</h2>
|
||||
|
||||

|
||||

|
||||
|
||||
## Table of Contents
|
||||
|
||||
@@ -63,9 +63,9 @@ To install from source or make changes to the application, continue to the next
|
||||
**Community maintained** builds for Arch Linux and Flatpak are available, see below. These installs will need to be updated manually as the in-app update process only supports Debian installs at this time.
|
||||
_Note: If coming from a deb install, the directory structure is different and you'll need to [migrate data](https://lbry.com/faq/backup-data)._
|
||||
|
||||
| | Flatpak | Arch | Raspberry Pi |
|
||||
| | Flatpak | Arch | ARM/ARM64 |
|
||||
| -------------- | ----------------------------------------------------------------- | ----------------------------------------------------------------------------------------- | ------------------------------------------- |
|
||||
| Latest Release | [FlatHub Page](https://flathub.org/apps/details/io.lbry.lbry-app) | [AUR Package](https://aur.archlinux.org/packages/lbry-app-bin/) | [Pi Installer](https://lbrypi.com) |
|
||||
| Latest Release | [FlatHub Page](https://flathub.org/apps/details/io.lbry.lbry-app) | [AUR Package](https://aur.archlinux.org/packages/lbry-app-bin/) | [Build Guide](https://lbry.tv/@LBRYarm:5) |
|
||||
| Maintainers | [@kcSeb](https://keybase.io/kcseb) | [@kcSeb](https://keybase.io/kcseb)/[@TimurKiyivinski](https://github.com/TimurKiyivinski) | [@Madiator2011](https://github.com/kodxana) |
|
||||
|
||||
## Usage
|
||||
@@ -104,17 +104,21 @@ You can run the web version (lbry.tv), the electron app, or both at the same tim
|
||||
|
||||
#### Customize the web app
|
||||
|
||||
- Enter web directory, copy .env.defaults to .env and make changes
|
||||
- In root directory, duplicate the .env.default file and rename it to .env then copy the code below and paste it anywhere in the .env file.
|
||||
|
||||
```
|
||||
cd web
|
||||
cp .env.defaults .env
|
||||
nano .env
|
||||
```
|
||||
- To specify your own OG-IMAGE
|
||||
You can either place a png named v2-og.png in the /custom folder or specify the OG_IMAGE_URL in .env
|
||||
|
||||
- To specify your own channels to be followed on first run
|
||||
`AUTO_FOLLOW_URLS=lbry://@chan#123...a lbry://@chan2#456...a`
|
||||
|
||||
- If you want to customize the homepage content
|
||||
|
||||
1. add `CUSTOM_HOMEPAGE=true` to the 'web/.env' file
|
||||
1. add `CUSTOM_HOMEPAGE=true` to the '.env' file
|
||||
2. copy `/custom/homepage.example.js` to `/custom/homepage.js` and make desired changes to `homepage.js`
|
||||
|
||||
- If you want up to two custom sidebar links
|
||||
@@ -128,6 +132,7 @@ PINNED_LABEL_2=OtherLinkText
|
||||
```
|
||||
|
||||
- Finally `NODE_ENV=production yarn compile:web` to rebuild
|
||||
_Note: You don't need to edit the .env file in the /web folder - that is copied during compile._
|
||||
|
||||
#### Deploy the web app (_experimental_)
|
||||
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
- name: Danger JS Action
|
||||
uses: danger/danger-js@9.1.8
|
||||
@@ -4,17 +4,14 @@ const fs = require('fs');
|
||||
const path = require('path');
|
||||
var electron_notarize = require('electron-notarize');
|
||||
|
||||
module.exports = async function(params) {
|
||||
// Only notarize the app on Mac OS only.
|
||||
if (process.platform !== 'darwin') {
|
||||
module.exports = async function() {
|
||||
if (process.env.RUNNER_OS !== 'macOS') {
|
||||
return;
|
||||
}
|
||||
console.log('afterSign hook triggered', params);
|
||||
|
||||
// Same appId in electron-builder.
|
||||
let appId = 'io.lbry.LBRY';
|
||||
const appId = 'io.lbry.LBRY';
|
||||
const appPath = path.resolve(__dirname, '../dist/electron/mac/LBRY.app');
|
||||
|
||||
let appPath = path.join(params.appOutDir, `${params.packager.appInfo.productFilename}.app`);
|
||||
if (!fs.existsSync(appPath)) {
|
||||
throw new Error(`Cannot find application at: ${appPath}`);
|
||||
}
|
||||
@@ -25,8 +22,8 @@ module.exports = async function(params) {
|
||||
await electron_notarize.notarize({
|
||||
appBundleId: appId,
|
||||
appPath: appPath,
|
||||
appleId: process.env.appleId,
|
||||
appleIdPassword: process.env.appleIdPassword,
|
||||
appleId: process.env.NOTARIZATION_USERNAME,
|
||||
appleIdPassword: process.env.NOTARIZATION_PASSWORD,
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
|
||||
@@ -71,7 +71,7 @@ const downloadDaemon = targetPlatform =>
|
||||
})
|
||||
)
|
||||
.then(() => {
|
||||
console.log('\x1b[32msuccess\x1b[0m Daemon downloaded!');
|
||||
console.log(`\x1b[32msuccess\x1b[0m Daemon downloaded! - v${daemonVersion}`);
|
||||
if (hasDaemonVersion) {
|
||||
del(daemonVersionPath);
|
||||
}
|
||||
|
||||
91
build/downloadLBRYFirst.js
Normal file
91
build/downloadLBRYFirst.js
Normal file
@@ -0,0 +1,91 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const packageJSON = require('../package.json');
|
||||
const fetch = require('node-fetch');
|
||||
const decompress = require('decompress');
|
||||
const os = require('os');
|
||||
const del = require('del');
|
||||
|
||||
const downloadLBRYFirst = targetPlatform =>
|
||||
new Promise((resolve, reject) => {
|
||||
const lbryFirstURLTemplate = packageJSON.lbrySettings.LBRYFirstUrlTemplate;
|
||||
const lbryFirstVersion = packageJSON.lbrySettings.LBRYFirstVersion;
|
||||
const lbryFirstDir = path.join(__dirname, '..', packageJSON.lbrySettings.LBRYFirstDir);
|
||||
let lbryFirstFileName = packageJSON.lbrySettings.LBRYFirstFileName;
|
||||
|
||||
const currentPlatform = os.platform();
|
||||
|
||||
let lbryFirstPlatform = process.env.TARGET || targetPlatform || currentPlatform;
|
||||
if (lbryFirstPlatform === 'linux') lbryFirstPlatform = 'Linux';
|
||||
if (lbryFirstPlatform === 'mac' || lbryFirstPlatform === 'darwin') lbryFirstPlatform = 'Darwin';
|
||||
if (lbryFirstPlatform === 'win32' || lbryFirstPlatform === 'windows') {
|
||||
lbryFirstPlatform = 'Windows';
|
||||
lbryFirstFileName += '.exe';
|
||||
}
|
||||
const lbryFirstFilePath = path.join(lbryFirstDir, lbryFirstFileName);
|
||||
const lbryFirstVersionPath = path.join(__dirname, 'lbryFirst.ver');
|
||||
const tmpZipPath = path.join(__dirname, '..', 'dist', 'lbryFirst.zip');
|
||||
const lbryFirstURL = lbryFirstURLTemplate.replace(/LBRYFIRSTVER/g, lbryFirstVersion).replace(/OSNAME/g, lbryFirstPlatform);
|
||||
console.log('URL:', lbryFirstURL);
|
||||
|
||||
// If a lbryFirst and lbryFirst.ver exists, check to see if it matches the current lbryFirst version
|
||||
const hasLbryFirstDownloaded = fs.existsSync(lbryFirstFilePath);
|
||||
const hasLbryFirstVersion = fs.existsSync(lbryFirstVersionPath);
|
||||
let downloadedLbryFirstVersion;
|
||||
|
||||
if (hasLbryFirstVersion) {
|
||||
downloadedLbryFirstVersion = fs.readFileSync(lbryFirstVersionPath, 'utf8');
|
||||
}
|
||||
|
||||
if (hasLbryFirstDownloaded && hasLbryFirstVersion && downloadedLbryFirstVersion === lbryFirstVersion) {
|
||||
console.log('\x1b[34minfo\x1b[0m LbryFirst already downloaded');
|
||||
resolve('Done');
|
||||
} else {
|
||||
console.log('\x1b[34minfo\x1b[0m Downloading lbryFirst...');
|
||||
fetch(lbryFirstURL, {
|
||||
method: 'GET',
|
||||
headers: {
|
||||
'Content-Type': 'application/zip',
|
||||
},
|
||||
})
|
||||
.then(response => response.buffer())
|
||||
.then(
|
||||
result =>
|
||||
new Promise((newResolve, newReject) => {
|
||||
const distPath = path.join(__dirname, '..', 'dist');
|
||||
const hasDistFolder = fs.existsSync(distPath);
|
||||
|
||||
if (!hasDistFolder) {
|
||||
fs.mkdirSync(distPath);
|
||||
}
|
||||
|
||||
fs.writeFile(tmpZipPath, result, error => {
|
||||
if (error) return newReject(error);
|
||||
return newResolve();
|
||||
});
|
||||
})
|
||||
)
|
||||
.then(() => del(`${lbryFirstFilePath}*`))
|
||||
.then()
|
||||
.then(() =>
|
||||
decompress(tmpZipPath, lbryFirstDir, {
|
||||
filter: file => path.basename(file.path) === lbryFirstFileName,
|
||||
})
|
||||
)
|
||||
.then(() => {
|
||||
console.log('\x1b[32msuccess\x1b[0m LbryFirst downloaded!');
|
||||
if (hasLbryFirstVersion) {
|
||||
del(lbryFirstVersionPath);
|
||||
}
|
||||
|
||||
fs.writeFileSync(lbryFirstVersionPath, lbryFirstVersion, 'utf8');
|
||||
resolve('Done');
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(`\x1b[31merror\x1b[0m LbryFirst download failed due to: \x1b[35m${error}\x1b[0m`);
|
||||
reject(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
downloadLBRYFirst();
|
||||
@@ -51,7 +51,7 @@ function cleanUpAfterSigning() {
|
||||
}
|
||||
|
||||
function signFile() {
|
||||
console.log('Signing file with hashes using keybase...');
|
||||
console.log('Logging in file with hashes using keybase...');
|
||||
// All files are hashed and added to hashes.txt
|
||||
// Sign it with keybase
|
||||
const fileName = `LBRY_${versionToSign}_sigs.asc`;
|
||||
@@ -126,16 +126,17 @@ function downloadAssets() {
|
||||
.then(({ data }) => {
|
||||
const release_id = data.id;
|
||||
|
||||
return octokit.repos.listAssetsForRelease({
|
||||
return octokit.repos.listReleases({
|
||||
owner: 'lbryio',
|
||||
repo: 'lbry-desktop',
|
||||
release_id,
|
||||
});
|
||||
})
|
||||
.then(({ data }) => {
|
||||
fileCountToDownload = data.length;
|
||||
|
||||
data
|
||||
const releaseToDownload = data.filter(releaseData => releaseData.tag_name === versionToSign)[0];
|
||||
const assets = releaseToDownload.assets;
|
||||
fileCountToDownload = assets.length;
|
||||
assets
|
||||
.map(({ browser_download_url, name }) => ({ download_url: browser_download_url, name }))
|
||||
.forEach(({ name, download_url }) => {
|
||||
const fileName = path.resolve(__dirname, `../dist/releaseDownloads/${name}`);
|
||||
|
||||
38
config.js
38
config.js
@@ -1,24 +1,48 @@
|
||||
// On Web, this will find .env.defaults and optional .env in web/
|
||||
// On Desktop App, this will find .env.defaults and optional .env in root dir
|
||||
require('dotenv-defaults').config({silent: false});
|
||||
require('dotenv-defaults').config({ silent: false });
|
||||
|
||||
const config = {
|
||||
MATOMO_URL: process.env.MATOMO_URL,
|
||||
MATOMO_ID: process.env.MATOMO_ID,
|
||||
WEBPACK_WEB_PORT: process.env.WEBPACK_WEB_PORT,
|
||||
WEBPACK_ELECTRON_PORT: process.env.WEBPACK_ELECTRON_PORT,
|
||||
WEB_SERVER_PORT: process.env.WEB_SERVER_PORT,
|
||||
DOMAIN: process.env.DOMAIN,
|
||||
URL: process.env.URL, //lbry.tv',
|
||||
SITE_TITLE: process.env.SITE_TITLE,
|
||||
LBRY_WEB_API: process.env.LBRY_WEB_API, //api.lbry.tv',
|
||||
LBRY_API_URL: process.env.LBRY_API_URL, //api.lbry.com',
|
||||
LBRY_WEB_STREAMING_API: process.env.LBRY_WEB_STREAMING_API, //cdn.lbryplayer.xyz',
|
||||
LBRY_WEB_BUFFER_API: process.env.LBRY_WEB_BUFFER_API,
|
||||
COMMENT_SERVER_API: process.env.COMMENT_SERVER_API,
|
||||
WELCOME_VERSION: process.env.WELCOME_VERSION,
|
||||
DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE,
|
||||
MATOMO_URL: process.env.MATOMO_URL,
|
||||
MATOMO_ID: process.env.MATOMO_ID,
|
||||
DOMAIN: process.env.DOMAIN,
|
||||
SHARE_DOMAIN_URL: process.env.SHARE_DOMAIN_URL,
|
||||
URL: process.env.URL,
|
||||
THUMBNAIL_CDN_URL: process.env.THUMBNAIL_CDN_URL,
|
||||
SITE_TITLE: process.env.SITE_TITLE,
|
||||
SITE_NAME: process.env.SITE_NAME,
|
||||
SITE_DESCRIPTION: process.env.SITE_DESCRIPTION,
|
||||
SITE_HELP_EMAIL: process.env.SITE_HELP_EMAIL,
|
||||
LOGO_TITLE: process.env.LOGO_TITLE,
|
||||
OG_TITLE_SUFFIX: process.env.OG_TITLE_SUFFIX,
|
||||
OG_HOMEPAGE_TITLE: process.env.OG_HOMEPAGE_TITLE,
|
||||
OG_IMAGE_URL: process.env.OG_IMAGE_URL,
|
||||
YRBL_HAPPY_IMG_URL: process.env.YRBL_HAPPY_IMG_URL,
|
||||
YRBL_SAD_IMG_URL: process.env.YRBL_SAD_IMG_URL,
|
||||
SITE_CANONICAL_URL: process.env.SITE_CANONICAL_URL,
|
||||
DEFAULT_LANGUAGE: process.env.DEFAULT_LANGUAGE,
|
||||
AUTO_FOLLOW_CHANNELS: process.env.AUTO_FOLLOW_CHANNELS,
|
||||
UNSYNCED_SETTINGS: process.env.UNSYNCED_SETTINGS,
|
||||
ENABLE_COMMENT_REACTIONS: process.env.ENABLE_COMMENT_REACTIONS === 'true',
|
||||
ENABLE_FILE_REACTIONS: process.env.ENABLE_FILE_REACTIONS === 'true',
|
||||
ENABLE_CREATOR_REACTIONS: process.env.ENABLE_CREATOR_REACTIONS === 'true',
|
||||
CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS: process.env.CHANNEL_STAKED_LEVEL_VIDEO_COMMENTS,
|
||||
SIMPLE_SITE: process.env.SIMPLE_SITE === 'true',
|
||||
SHOW_ADS: process.env.SHOW_ADS === 'true',
|
||||
PINNED_URI_1: process.env.PINNED_URI_1,
|
||||
PINNED_LABEL_1: process.env.PINNED_LABEL_1,
|
||||
PINNED_URI_2: process.env.PINNED_URI_2,
|
||||
PINNED_LABEL_2: process.env.PINNED_LABEL_2,
|
||||
KNOWN_APP_DOMAINS: process.env.KNOWN_APP_DOMAINS ? process.env.KNOWN_APP_DOMAINS.split(',') : [],
|
||||
};
|
||||
|
||||
config.URL_LOCAL = `http://localhost:${config.WEB_SERVER_PORT}`;
|
||||
|
||||
@@ -63,14 +63,14 @@ import { toCapitalCase } from 'util/string';
|
||||
import React from 'react';
|
||||
import Icon from 'component/common/icon';
|
||||
|
||||
type RowDataItem = {
|
||||
export type RowDataItem = {
|
||||
title: string,
|
||||
link?: string,
|
||||
help?: any,
|
||||
options?: {},
|
||||
};
|
||||
|
||||
export default function getHomePageRowData(
|
||||
export default function GetHomePageRowData(
|
||||
authenticated: boolean,
|
||||
showPersonalizedChannels: boolean,
|
||||
showPersonalizedTags: boolean,
|
||||
|
||||
0
custom/homepages/.gitkeep
Normal file
0
custom/homepages/.gitkeep
Normal file
2
custom/robots.allowall
Normal file
2
custom/robots.allowall
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Allow: /
|
||||
2
custom/robots.disallowall
Normal file
2
custom/robots.disallowall
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
@@ -1,9 +0,0 @@
|
||||
import { danger, warn } from 'danger';
|
||||
|
||||
// Check for a CHANGELOG entry
|
||||
const hasChangelog = danger.git.modified_files.some(f => f === 'CHANGELOG.md');
|
||||
if (!hasChangelog) {
|
||||
const title = ':page_facing_up: Changelog Entry Missing';
|
||||
const idea = 'Please add a changelog entry for your changes.';
|
||||
warn(`${title} - <i>${idea}</i>`);
|
||||
}
|
||||
@@ -20,6 +20,11 @@
|
||||
"to": "static/daemon/",
|
||||
"filter": ["**/*"]
|
||||
},
|
||||
{
|
||||
"from": "./static/lbry-first/",
|
||||
"to": "static/lbry-first/",
|
||||
"filter": ["**/*"]
|
||||
},
|
||||
{
|
||||
"from": "./static/img",
|
||||
"to": "static/img",
|
||||
@@ -88,7 +93,7 @@
|
||||
"target": [
|
||||
{
|
||||
"target": "nsis",
|
||||
"arch": ["x64", "ia32"]
|
||||
"arch": ["x64"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
59
electron/LbryFirstInstance.js
Normal file
59
electron/LbryFirstInstance.js
Normal file
@@ -0,0 +1,59 @@
|
||||
import path from 'path';
|
||||
import { spawn, execSync } from 'child_process';
|
||||
|
||||
export default class LbryFirstInstance {
|
||||
static lbryFirstPath =
|
||||
process.env.LBRY_FIRST_DAEMON ||
|
||||
(process.env.NODE_ENV === 'production'
|
||||
? path.join(process.resourcesPath, 'static/lbry-first', 'lbry-first')
|
||||
: path.join(__static, 'lbry-first/lbry-first'));
|
||||
|
||||
static headersPath =
|
||||
process.env.LBRY_FIRST_DAEMON ||
|
||||
(process.env.NODE_ENV === 'production'
|
||||
? path.join(process.resourcesPath, 'static/lbry-first', 'headers')
|
||||
: path.join(__static, 'lbry-first/headers'));
|
||||
|
||||
subprocess;
|
||||
handlers;
|
||||
|
||||
constructor() {
|
||||
this.handlers = [];
|
||||
}
|
||||
|
||||
launch() {
|
||||
let flags = ['serve'];
|
||||
console.log(`LbryFirst: ${LbryFirstInstance.lbryFirstPath}`);
|
||||
this.subprocess = spawn(LbryFirstInstance.lbryFirstPath, flags);
|
||||
this.subprocess.stdout.on('data', data => console.log(`LbryFirst: ${data}`));
|
||||
this.subprocess.stderr.on('data', data => console.error(`LbryFirst: ${data}`));
|
||||
this.subprocess.on('exit', () => this.fire('exit'));
|
||||
this.subprocess.on('error', error => console.error(`LbryFirst error: ${error}`));
|
||||
}
|
||||
|
||||
quit() {
|
||||
if (process.platform === 'win32') {
|
||||
try {
|
||||
execSync(`taskkill /pid ${this.subprocess.pid} /t /f`);
|
||||
} catch (error) {
|
||||
console.error(error.message);
|
||||
}
|
||||
} else {
|
||||
this.subprocess.kill();
|
||||
}
|
||||
}
|
||||
|
||||
// Follows the publish/subscribe pattern
|
||||
|
||||
// Subscribe method
|
||||
on(event, handler, context = handler) {
|
||||
this.handlers.push({ event, handler: handler.bind(context) });
|
||||
}
|
||||
|
||||
// Publish method
|
||||
fire(event, args) {
|
||||
this.handlers.forEach(topic => {
|
||||
if (topic.event === event) topic.handler(args);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,26 @@ let tray;
|
||||
export default window => {
|
||||
let iconPath;
|
||||
|
||||
/*
|
||||
* A maximized window can't be properly
|
||||
* restored when minimized to the taskbar
|
||||
* (it will be restored/showed as unmaximized).
|
||||
*
|
||||
* window.isMaximized() will also return
|
||||
* false when minimizing a maximized window.
|
||||
*
|
||||
* The safest way to keep track of the
|
||||
* maximized state using maximize and
|
||||
* unmaximize events.
|
||||
*/
|
||||
let isWindowMaximized = false;
|
||||
window.on('maximize', () => {
|
||||
isWindowMaximized = true;
|
||||
});
|
||||
window.on('unmaximize', () => {
|
||||
isWindowMaximized = false;
|
||||
});
|
||||
|
||||
switch (process.platform) {
|
||||
case 'darwin': {
|
||||
iconPath = 'static/img/tray/mac/trayTemplate.png';
|
||||
@@ -22,18 +42,21 @@ export default window => {
|
||||
|
||||
tray = new Tray(process.env.NODE_ENV === 'development' ? iconPath : path.join(process.resourcesPath, iconPath));
|
||||
|
||||
tray.on('double-click', () => {
|
||||
const restoreFromTray = () => {
|
||||
if (isWindowMaximized) {
|
||||
window.maximize();
|
||||
}
|
||||
window.show();
|
||||
});
|
||||
};
|
||||
|
||||
tray.on('double-click', restoreFromTray);
|
||||
|
||||
tray.setToolTip('LBRY App');
|
||||
|
||||
const template = [
|
||||
{
|
||||
label: `Open ${app.getName()}`,
|
||||
click: () => {
|
||||
window.show();
|
||||
},
|
||||
label: `Open ${app.name}`,
|
||||
click: restoreFromTray,
|
||||
},
|
||||
{ role: 'quit' },
|
||||
];
|
||||
|
||||
@@ -1,12 +1,28 @@
|
||||
import { WEBPACK_ELECTRON_PORT } from 'config';
|
||||
import { app, BrowserWindow, dialog, shell, screen } from 'electron';
|
||||
import { app, BrowserWindow, dialog, shell, screen, nativeImage } from 'electron';
|
||||
import isDev from 'electron-is-dev';
|
||||
import windowStateKeeper from 'electron-window-state';
|
||||
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
|
||||
import { SUPPORTED_SUB_LANGUAGE_CODES, SUB_LANG_CODE_LEN } from 'constants/supported_sub_languages';
|
||||
import SUPPORTED_BROWSER_LANGUAGES from 'constants/supported_browser_languages';
|
||||
import { TO_TRAY_WHEN_CLOSED } from 'constants/settings';
|
||||
|
||||
import setupBarMenu from './menu/setupBarMenu';
|
||||
import * as PAGES from 'constants/pages';
|
||||
|
||||
function GetAppLangCode() {
|
||||
// https://www.electronjs.org/docs/api/locales
|
||||
// 1. Gets the user locale.
|
||||
// 2. Converts unsupported sub-languages to its primary (e.g. "en-GB" -> "en").
|
||||
// Note that the primary itself may or may not be a supported language
|
||||
// (up to clients to verify against SUPPORTED_LANGUAGES).
|
||||
const langCode = app.getLocale();
|
||||
if (langCode.length === SUB_LANG_CODE_LEN && !SUPPORTED_SUB_LANGUAGE_CODES.includes(langCode)) {
|
||||
return SUPPORTED_BROWSER_LANGUAGES[langCode.slice(0, 2)];
|
||||
}
|
||||
return SUPPORTED_BROWSER_LANGUAGES[langCode];
|
||||
}
|
||||
|
||||
export default appState => {
|
||||
// Get primary display dimensions from Electron.
|
||||
const { width, height } = screen.getPrimaryDisplay().workAreaSize;
|
||||
@@ -32,11 +48,12 @@ export default appState => {
|
||||
// If state is undefined, create window as maximized.
|
||||
width: windowState.width === undefined ? width : windowState.width,
|
||||
height: windowState.height === undefined ? height : windowState.height,
|
||||
icon: 'static/img/tray/default/tray.png',
|
||||
icon: nativeImage.createFromPath('static/img/tray/default/tray.png'),
|
||||
webPreferences: {
|
||||
// Disable renderer process's webSecurity on development to enable CORS.
|
||||
webSecurity: !isDev,
|
||||
plugins: true,
|
||||
nodeIntegration: true,
|
||||
},
|
||||
};
|
||||
const lbryProto = 'lbry://';
|
||||
@@ -93,7 +110,11 @@ export default appState => {
|
||||
window.loadURL(rendererURL + deepLinkingURI);
|
||||
|
||||
window.on('close', event => {
|
||||
if (!appState.isQuitting && !appState.autoUpdateAccepted) {
|
||||
if (appState.isQuitting) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!appState.autoUpdateAccepted) {
|
||||
event.preventDefault();
|
||||
if (window.isFullScreen()) {
|
||||
window.once('leave-full-screen', () => {
|
||||
@@ -104,6 +125,16 @@ export default appState => {
|
||||
window.hide();
|
||||
}
|
||||
}
|
||||
|
||||
const getToTrayWhenClosedSetting = window.webContents.executeJavaScript(`localStorage.getItem('${TO_TRAY_WHEN_CLOSED}')`);
|
||||
|
||||
getToTrayWhenClosedSetting.then(toTrayWhenClosedSetting => {
|
||||
const closeApp = toTrayWhenClosedSetting === 'false';
|
||||
|
||||
if (closeApp) {
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
window.on('focus', () => {
|
||||
@@ -144,15 +175,11 @@ export default appState => {
|
||||
const language =
|
||||
storedLanguage && storedLanguage !== 'undefined' && storedLanguage !== 'null'
|
||||
? storedLanguage
|
||||
: app.getLocale().slice(0, 2);
|
||||
: GetAppLangCode();
|
||||
if (language !== 'en' && SUPPORTED_LANGUAGES[language]) {
|
||||
window.webContents.send('language-set', language);
|
||||
}
|
||||
});
|
||||
|
||||
if (isDev) {
|
||||
window.webContents.openDevTools();
|
||||
}
|
||||
});
|
||||
|
||||
window.webContents.on('crashed', () => {
|
||||
@@ -185,7 +212,7 @@ export default appState => {
|
||||
|
||||
let dispUrl = url.replace(hoverUrlBase, lbryProto);
|
||||
// Non-claims don't need the lbry protocol:
|
||||
if (dispUrl === lbryProto) {
|
||||
if (dispUrl === lbryProto) {
|
||||
dispUrl = 'Home';
|
||||
} else if (dispUrl.startsWith(lbryProto + '$/')) {
|
||||
dispUrl = dispUrl.replace(lbryProto, '/');
|
||||
|
||||
@@ -7,6 +7,7 @@ import https from 'https';
|
||||
import { app, dialog, ipcMain, session, shell } from 'electron';
|
||||
import { autoUpdater } from 'electron-updater';
|
||||
import { Lbry } from 'lbry-redux';
|
||||
import LbryFirstInstance from './LbryFirstInstance';
|
||||
import Daemon from './Daemon';
|
||||
import isDev from 'electron-is-dev';
|
||||
import createTray from './createTray';
|
||||
@@ -41,13 +42,18 @@ let rendererWindow;
|
||||
|
||||
let tray; // eslint-disable-line
|
||||
let daemon;
|
||||
let lbryFirst;
|
||||
|
||||
const appState = {};
|
||||
|
||||
app.setAsDefaultProtocolClient('lbry');
|
||||
app.setName('LBRY');
|
||||
if (process.platform !== 'linux') {
|
||||
app.setAsDefaultProtocolClient('lbry');
|
||||
}
|
||||
|
||||
app.name = 'LBRY';
|
||||
app.setAppUserModelId('io.lbry.LBRY');
|
||||
app.commandLine.appendSwitch('force-color-profile', 'srgb');
|
||||
app.commandLine.appendSwitch('disable-features', 'OutOfBlinkCors');
|
||||
|
||||
if (isDev) {
|
||||
// Disable security warnings in dev mode:
|
||||
@@ -87,6 +93,52 @@ const startDaemon = async () => {
|
||||
}
|
||||
};
|
||||
|
||||
let isLbryFirstRunning = false;
|
||||
const startLbryFirst = async () => {
|
||||
if (isLbryFirstRunning) {
|
||||
console.log('LbryFirst already running');
|
||||
handleLbryFirstLaunched();
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('LbryFirst: Starting...');
|
||||
|
||||
try {
|
||||
lbryFirst = new LbryFirstInstance();
|
||||
lbryFirst.on('exit', e => {
|
||||
if (!isDev) {
|
||||
lbryFirst = null;
|
||||
isLbryFirstRunning = false;
|
||||
if (!appState.isQuitting) {
|
||||
dialog.showErrorBox(
|
||||
'LbryFirst has Exited',
|
||||
'The lbryFirst may have encountered an unexpected error, or another lbryFirst instance is already running. \n\n',
|
||||
e
|
||||
);
|
||||
}
|
||||
app.quit();
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
console.log('LbryFirst: Failed to create new instance\n\n', e);
|
||||
}
|
||||
|
||||
console.log('LbryFirst: Running...');
|
||||
|
||||
try {
|
||||
await lbryFirst.launch();
|
||||
handleLbryFirstLaunched();
|
||||
} catch (e) {
|
||||
isLbryFirstRunning = false;
|
||||
console.log('LbryFirst: Failed to start\n', e);
|
||||
}
|
||||
};
|
||||
|
||||
const handleLbryFirstLaunched = () => {
|
||||
isLbryFirstRunning = true;
|
||||
rendererWindow.webContents.send('lbry-first-launched');
|
||||
};
|
||||
|
||||
// When we are starting the app, ensure there are no other apps already running
|
||||
const gotSingleInstanceLock = app.requestSingleInstanceLock();
|
||||
|
||||
@@ -128,7 +180,6 @@ if (!gotSingleInstanceLock) {
|
||||
if (isDev) {
|
||||
await installDevtools();
|
||||
}
|
||||
|
||||
rendererWindow = createWindow(appState);
|
||||
tray = createTray(rendererWindow);
|
||||
|
||||
@@ -139,21 +190,6 @@ if (!gotSingleInstanceLock) {
|
||||
});
|
||||
}
|
||||
|
||||
// HACK: patch webrequest to fix devtools incompatibility with electron 2.x.
|
||||
// See https://github.com/electron/electron/issues/13008#issuecomment-400261941
|
||||
session.defaultSession.webRequest.onBeforeRequest({}, (details, callback) => {
|
||||
if (details.url.includes('7accc8730b0f99b5e7c0702ea89d1fa7c17bfe33')) {
|
||||
callback({
|
||||
redirectURL: details.url.replace(
|
||||
'7accc8730b0f99b5e7c0702ea89d1fa7c17bfe33',
|
||||
'57c9d07b416b5a2ea23d28247300e4af36329bdc'
|
||||
),
|
||||
});
|
||||
} else {
|
||||
callback({ cancel: false });
|
||||
}
|
||||
});
|
||||
|
||||
// If an "Origin" header is passed, the SDK will check that it is set to allow that origin in the daemon_settings.yml
|
||||
// By default, electron sends http://localhost:{port} as the origin for POST requests
|
||||
// https://github.com/electron/electron/issues/7931#issuecomment-361759277
|
||||
@@ -201,12 +237,18 @@ app.on('will-quit', event => {
|
||||
}
|
||||
|
||||
appState.isQuitting = true;
|
||||
|
||||
if (daemon) {
|
||||
daemon.quit();
|
||||
event.preventDefault();
|
||||
}
|
||||
if (lbryFirst) {
|
||||
lbryFirst.quit();
|
||||
event.preventDefault();
|
||||
}
|
||||
|
||||
if (rendererWindow) {
|
||||
tray.destroy();
|
||||
rendererWindow = null;
|
||||
}
|
||||
});
|
||||
@@ -234,7 +276,7 @@ ipcMain.on('upgrade', (event, installerPath) => {
|
||||
console.log('Launching upgrade installer at', installerPath);
|
||||
// This gets triggered called after *all* other quit-related events, so
|
||||
// we'll only get here if we're fully prepared and quitting for real.
|
||||
shell.openItem(installerPath);
|
||||
shell.openPath(installerPath);
|
||||
});
|
||||
// what to do if no shutdown in a long time?
|
||||
console.log('Update downloaded to', installerPath);
|
||||
@@ -328,6 +370,15 @@ ipcMain.on('version-info-requested', () => {
|
||||
requestLatestRelease();
|
||||
});
|
||||
|
||||
ipcMain.on('launch-lbry-first', async () => {
|
||||
try {
|
||||
await startLbryFirst();
|
||||
} catch (e) {
|
||||
console.log('Failed to start LbryFirst');
|
||||
console.log(e);
|
||||
}
|
||||
});
|
||||
|
||||
process.on('uncaughtException', error => {
|
||||
console.log(error);
|
||||
dialog.showErrorBox('Error Encountered', `Caught error: ${error}`);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { app, Menu, shell } from 'electron';
|
||||
import { ZOOM } from 'util/zoomWindow';
|
||||
|
||||
export default () => {
|
||||
const template = [
|
||||
@@ -22,6 +23,38 @@ export default () => {
|
||||
label: 'View',
|
||||
submenu: [
|
||||
{ role: 'reload' },
|
||||
{
|
||||
label: 'Zoom',
|
||||
submenu: [
|
||||
{
|
||||
label: 'Zoom In',
|
||||
accelerator: 'CmdOrCtrl+=',
|
||||
click: (menuItem, browserWindow) => {
|
||||
if (browserWindow) {
|
||||
browserWindow.webContents.send('zoom-window', ZOOM.INCREMENT);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Zoom Out',
|
||||
accelerator: 'CmdOrCtrl+-',
|
||||
click: (menuItem, browserWindow) => {
|
||||
if (browserWindow) {
|
||||
browserWindow.webContents.send('zoom-window', ZOOM.DECREMENT);
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Reset Zoom',
|
||||
accelerator: 'CmdOrCtrl+0',
|
||||
click: (menuItem, browserWindow) => {
|
||||
if (browserWindow) {
|
||||
browserWindow.webContents.send('zoom-window', ZOOM.RESET);
|
||||
}
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
label: 'Developer',
|
||||
submenu: [{ role: 'forcereload' }, { role: 'toggledevtools' }],
|
||||
@@ -72,7 +105,7 @@ export default () => {
|
||||
];
|
||||
|
||||
const darwinTemplateAddition = {
|
||||
label: app.getName(),
|
||||
label: app.name,
|
||||
submenu: [
|
||||
{ role: 'about' },
|
||||
{ type: 'separator' },
|
||||
|
||||
43
flow-typed/Comment.js
vendored
Normal file
43
flow-typed/Comment.js
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
declare type Comment = {
|
||||
comment: string, // comment body
|
||||
comment_id: string, // sha256 digest
|
||||
claim_id: string, // id linking to the claim this comment
|
||||
timestamp: number, // integer representing unix-time
|
||||
is_hidden: boolean, // claim owner may enable/disable this
|
||||
channel_id: string, // claimId of channel signing this comment
|
||||
channel_name?: string, // name of channel claim
|
||||
channel_url?: string, // full lbry url to signing channel
|
||||
signature?: string, // signature of comment by originating channel
|
||||
signing_ts?: string, // timestamp used when signing this comment
|
||||
is_channel_signature_valid?: boolean, // whether or not the signature could be validated
|
||||
parent_id?: number, // comment_id of comment this is in reply to
|
||||
is_pinned: boolean,
|
||||
};
|
||||
|
||||
// todo: relate individual comments to their commentId
|
||||
declare type CommentsState = {
|
||||
commentsByUri: { [string]: string },
|
||||
byId: { [string]: Array<string> },
|
||||
repliesByParentId: { [string]: Array<string> }, // ParentCommentID -> list of reply comments
|
||||
topLevelCommentsById: { [string]: Array<string> }, // ClaimID -> list of top level comments
|
||||
commentById: { [string]: Comment },
|
||||
isLoading: boolean,
|
||||
myComments: ?Set<string>,
|
||||
isFetchingReacts: boolean,
|
||||
myReactsByCommentId: any,
|
||||
othersReactsByCommentId: any,
|
||||
pendingCommentReactions: Array<string>,
|
||||
moderationBlockList: ?Array<string>,
|
||||
fetchingModerationBlockList: boolean,
|
||||
blockingByUri: {},
|
||||
unBlockingByUri: {},
|
||||
};
|
||||
|
||||
declare type CommentReactParams = {
|
||||
comment_ids: string,
|
||||
channel_name: string,
|
||||
channel_id: string,
|
||||
react_type: string,
|
||||
clear_types?: string,
|
||||
remove?: boolean,
|
||||
};
|
||||
16
flow-typed/comments.js
vendored
Normal file
16
flow-typed/comments.js
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
// @flow
|
||||
declare type CommentListParams = {
|
||||
page: number,
|
||||
page_size: number,
|
||||
claim_id: string,
|
||||
};
|
||||
|
||||
declare type CommentAbandonParams = {
|
||||
comment_id: string,
|
||||
creator_channel_id?: string,
|
||||
creator_channel_name?: string,
|
||||
channel_id?: string,
|
||||
hexdata?: string,
|
||||
};
|
||||
|
||||
declare type ModerationBlockParams = {};
|
||||
8
flow-typed/content.js
vendored
Normal file
8
flow-typed/content.js
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
// @flow
|
||||
|
||||
declare type PlayingUri = {
|
||||
uri: string,
|
||||
pathname: string,
|
||||
commentId?: string,
|
||||
source?: string,
|
||||
};
|
||||
26
flow-typed/homepage.js
vendored
Normal file
26
flow-typed/homepage.js
vendored
Normal file
@@ -0,0 +1,26 @@
|
||||
declare type HomepageObject = {
|
||||
icon: string,
|
||||
link: string,
|
||||
options: any,
|
||||
route: string,
|
||||
title: string,
|
||||
}
|
||||
|
||||
declare type HomepageData = {
|
||||
[string]: HomepageObject,
|
||||
default: any => any,
|
||||
}
|
||||
|
||||
declare type RowDataItem = {
|
||||
title: any,
|
||||
link?: string,
|
||||
help?: any,
|
||||
icon?: string,
|
||||
extra?: any,
|
||||
options?: {
|
||||
channelIds?: Array<string>,
|
||||
pageSize: number,
|
||||
},
|
||||
route?: string,
|
||||
hideForUnauth?: boolean,
|
||||
};
|
||||
38
flow-typed/notification.js
vendored
Normal file
38
flow-typed/notification.js
vendored
Normal file
@@ -0,0 +1,38 @@
|
||||
// @flow
|
||||
declare type WebNotification = {
|
||||
active_at: string,
|
||||
created_at: string,
|
||||
id: number,
|
||||
is_app_readable: boolean,
|
||||
is_device_notified: boolean,
|
||||
is_emailed: boolean,
|
||||
is_read: boolean,
|
||||
is_seen: boolean,
|
||||
notification_parameters: {
|
||||
device: {
|
||||
analytics_label: string,
|
||||
image_url: string,
|
||||
is_data_only: boolean,
|
||||
name: string,
|
||||
placeholders: ?string,
|
||||
target: string,
|
||||
text: string,
|
||||
title: string,
|
||||
type: string,
|
||||
},
|
||||
dynamic: {
|
||||
comment_author: string,
|
||||
reply_author: string,
|
||||
hash: string,
|
||||
claim_title: string,
|
||||
comment?: string,
|
||||
channel_url: string,
|
||||
},
|
||||
email: {},
|
||||
},
|
||||
notification_rule: string,
|
||||
type: string,
|
||||
updated_at: string,
|
||||
user_id: number,
|
||||
group_count?: number,
|
||||
};
|
||||
270
flow-typed/npm/node-sass_vx.x.x.js
vendored
270
flow-typed/npm/node-sass_vx.x.x.js
vendored
@@ -1,270 +0,0 @@
|
||||
// flow-typed signature: ffdd57cb6a0c6f4b1d0b68538d77fd53
|
||||
// flow-typed version: <<STUB>>/node-sass_v^4.11.0/flow_v0.94.0
|
||||
|
||||
/**
|
||||
* This is an autogenerated libdef stub for:
|
||||
*
|
||||
* 'node-sass'
|
||||
*
|
||||
* Fill this stub out by replacing all the `any` types.
|
||||
*
|
||||
* Once filled out, we encourage you to share your work with the
|
||||
* community by sending a pull request to:
|
||||
* https://github.com/flowtype/flow-typed
|
||||
*/
|
||||
|
||||
declare module 'node-sass' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* We include stubs for each file inside this npm package in case you need to
|
||||
* require those files directly. Feel free to delete any files that aren't
|
||||
* needed.
|
||||
*/
|
||||
declare module 'node-sass/lib/binding' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/lib/errors' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/lib/extensions' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/lib/index' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/lib/render' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/lib/watcher' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/scripts/build' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/scripts/coverage' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/scripts/install' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/scripts/prepublish' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/scripts/util/downloadoptions' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/scripts/util/proxy' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/scripts/util/useragent' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/api' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/binding' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/cli' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/downloadoptions' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/errors' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_arrays_of_importers' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_functions_setter' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_functions_string_conversion' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_data_cb' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_data' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_error' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_and_data_cb' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_and_data' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_cb' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/lowlevel' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/runtime' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/scripts/util/proxy' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/spec' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/types' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/useragent' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
declare module 'node-sass/test/watcher' {
|
||||
declare module.exports: any;
|
||||
}
|
||||
|
||||
// Filename aliases
|
||||
declare module 'node-sass/lib/binding.js' {
|
||||
declare module.exports: $Exports<'node-sass/lib/binding'>;
|
||||
}
|
||||
declare module 'node-sass/lib/errors.js' {
|
||||
declare module.exports: $Exports<'node-sass/lib/errors'>;
|
||||
}
|
||||
declare module 'node-sass/lib/extensions.js' {
|
||||
declare module.exports: $Exports<'node-sass/lib/extensions'>;
|
||||
}
|
||||
declare module 'node-sass/lib/index.js' {
|
||||
declare module.exports: $Exports<'node-sass/lib/index'>;
|
||||
}
|
||||
declare module 'node-sass/lib/render.js' {
|
||||
declare module.exports: $Exports<'node-sass/lib/render'>;
|
||||
}
|
||||
declare module 'node-sass/lib/watcher.js' {
|
||||
declare module.exports: $Exports<'node-sass/lib/watcher'>;
|
||||
}
|
||||
declare module 'node-sass/scripts/build.js' {
|
||||
declare module.exports: $Exports<'node-sass/scripts/build'>;
|
||||
}
|
||||
declare module 'node-sass/scripts/coverage.js' {
|
||||
declare module.exports: $Exports<'node-sass/scripts/coverage'>;
|
||||
}
|
||||
declare module 'node-sass/scripts/install.js' {
|
||||
declare module.exports: $Exports<'node-sass/scripts/install'>;
|
||||
}
|
||||
declare module 'node-sass/scripts/prepublish.js' {
|
||||
declare module.exports: $Exports<'node-sass/scripts/prepublish'>;
|
||||
}
|
||||
declare module 'node-sass/scripts/util/downloadoptions.js' {
|
||||
declare module.exports: $Exports<'node-sass/scripts/util/downloadoptions'>;
|
||||
}
|
||||
declare module 'node-sass/scripts/util/proxy.js' {
|
||||
declare module.exports: $Exports<'node-sass/scripts/util/proxy'>;
|
||||
}
|
||||
declare module 'node-sass/scripts/util/useragent.js' {
|
||||
declare module.exports: $Exports<'node-sass/scripts/util/useragent'>;
|
||||
}
|
||||
declare module 'node-sass/test/api.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/api'>;
|
||||
}
|
||||
declare module 'node-sass/test/binding.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/binding'>;
|
||||
}
|
||||
declare module 'node-sass/test/cli.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/cli'>;
|
||||
}
|
||||
declare module 'node-sass/test/downloadoptions.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/downloadoptions'>;
|
||||
}
|
||||
declare module 'node-sass/test/errors.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/errors'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_arrays_of_importers.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_arrays_of_importers'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_functions_setter.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_functions_setter'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_functions_string_conversion.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_functions_string_conversion'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_data_cb.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_data_cb'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_data.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_data'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_error.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_error'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_and_data_cb.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_file_and_data_cb'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_and_data.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_file_and_data'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file_cb.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_file_cb'>;
|
||||
}
|
||||
declare module 'node-sass/test/fixtures/extras/my_custom_importer_file.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/fixtures/extras/my_custom_importer_file'>;
|
||||
}
|
||||
declare module 'node-sass/test/lowlevel.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/lowlevel'>;
|
||||
}
|
||||
declare module 'node-sass/test/runtime.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/runtime'>;
|
||||
}
|
||||
declare module 'node-sass/test/scripts/util/proxy.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/scripts/util/proxy'>;
|
||||
}
|
||||
declare module 'node-sass/test/spec.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/spec'>;
|
||||
}
|
||||
declare module 'node-sass/test/types.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/types'>;
|
||||
}
|
||||
declare module 'node-sass/test/useragent.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/useragent'>;
|
||||
}
|
||||
declare module 'node-sass/test/watcher.js' {
|
||||
declare module.exports: $Exports<'node-sass/test/watcher'>;
|
||||
}
|
||||
1
flow-typed/publish.js
vendored
1
flow-typed/publish.js
vendored
@@ -24,6 +24,7 @@ declare type UpdatePublishFormData = {
|
||||
licenseType?: string,
|
||||
uri?: string,
|
||||
nsfw: boolean,
|
||||
isMarkdownPost: boolean,
|
||||
};
|
||||
|
||||
declare type PublishParams = {
|
||||
|
||||
3
flow-typed/redux.js
vendored
Normal file
3
flow-typed/redux.js
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
// @flow
|
||||
|
||||
declare type Dispatch = any;
|
||||
36
flow-typed/search.js
vendored
Normal file
36
flow-typed/search.js
vendored
Normal file
@@ -0,0 +1,36 @@
|
||||
// @flow
|
||||
import * as ACTIONS from 'constants/action_types';
|
||||
|
||||
declare type SearchOptions = {
|
||||
// :(
|
||||
// https://github.com/facebook/flow/issues/6492
|
||||
RESULT_COUNT: number,
|
||||
CLAIM_TYPE: string,
|
||||
INCLUDE_FILES: string,
|
||||
INCLUDE_CHANNELS: string,
|
||||
INCLUDE_FILES_AND_CHANNELS: string,
|
||||
MEDIA_AUDIO: string,
|
||||
MEDIA_VIDEO: string,
|
||||
MEDIA_TEXT: string,
|
||||
MEDIA_IMAGE: string,
|
||||
MEDIA_APPLICATION: string,
|
||||
};
|
||||
|
||||
declare type SearchState = {
|
||||
options: SearchOptions,
|
||||
urisByQuery: {},
|
||||
searching: boolean,
|
||||
};
|
||||
|
||||
declare type SearchSuccess = {
|
||||
type: ACTIONS.SEARCH_SUCCESS,
|
||||
data: {
|
||||
query: string,
|
||||
uris: Array<string>,
|
||||
},
|
||||
};
|
||||
|
||||
declare type UpdateSearchOptions = {
|
||||
type: ACTIONS.UPDATE_SEARCH_OPTIONS,
|
||||
data: SearchOptions,
|
||||
};
|
||||
92
flow-typed/subscription.js
vendored
92
flow-typed/subscription.js
vendored
@@ -14,99 +14,17 @@ import {
|
||||
declare type Subscription = {
|
||||
channelName: string, // @CryptoCandor,
|
||||
uri: string, // lbry://@CryptoCandor#9152f3b054f692076a6882d1b58a30e8781cc8e6
|
||||
latest?: string, // substratum#b0ab143243020e7831fd070d9f871e1fda948620
|
||||
notificationsDisabled?: boolean,
|
||||
};
|
||||
|
||||
// Tracking for new content
|
||||
// i.e. If a subscription has a DOWNLOADING type, we will trigger an OS notification
|
||||
// to tell users there is new content from their subscriptions
|
||||
declare type SubscriptionNotificationType = DOWNLOADED | DOWNLOADING | NOTIFY_ONLY;
|
||||
|
||||
declare type UnreadSubscription = {
|
||||
type: SubscriptionNotificationType,
|
||||
uris: Array<string>,
|
||||
};
|
||||
|
||||
declare type UnreadSubscriptions = {
|
||||
[string]: UnreadSubscription,
|
||||
};
|
||||
|
||||
declare type ViewMode = VIEW_LATEST_FIRST | VIEW_ALL;
|
||||
|
||||
declare type SuggestedType = SUGGESTED_TOP_BID | SUGGESTED_TOP_SUBSCRIBED | SUGGESTED_FEATURED;
|
||||
|
||||
declare type SuggestedSubscriptions = {
|
||||
[SuggestedType]: string,
|
||||
declare type Following = {
|
||||
uri: string, // lbry://@CryptoCandor#9152f3b054f692076a6882d1b58a30e8781cc8e6
|
||||
notificationsDisabled: boolean,
|
||||
};
|
||||
|
||||
declare type SubscriptionState = {
|
||||
subscriptions: Array<Subscription>,
|
||||
unread: UnreadSubscriptions,
|
||||
following: Array<Following>,
|
||||
loading: boolean,
|
||||
viewMode: ViewMode,
|
||||
suggested: SuggestedSubscriptions,
|
||||
loadingSuggested: boolean,
|
||||
firstRunCompleted: boolean,
|
||||
showSuggestedSubs: boolean,
|
||||
};
|
||||
|
||||
//
|
||||
// Action types
|
||||
//
|
||||
declare type DoChannelSubscribe = {
|
||||
type: ACTIONS.CHANNEL_SUBSCRIBE,
|
||||
data: Subscription,
|
||||
};
|
||||
|
||||
declare type DoChannelUnsubscribe = {
|
||||
type: ACTIONS.CHANNEL_UNSUBSCRIBE,
|
||||
data: Subscription,
|
||||
};
|
||||
|
||||
declare type DoUpdateSubscriptionUnreads = {
|
||||
type: ACTIONS.UPDATE_SUBSCRIPTION_UNREADS,
|
||||
data: {
|
||||
channel: string,
|
||||
uris: Array<string>,
|
||||
type?: SubscriptionNotificationType,
|
||||
},
|
||||
};
|
||||
|
||||
declare type DoRemoveSubscriptionUnreads = {
|
||||
type: ACTIONS.REMOVE_SUBSCRIPTION_UNREADS,
|
||||
data: {
|
||||
channel: string,
|
||||
uris: Array<string>,
|
||||
},
|
||||
};
|
||||
|
||||
declare type SetSubscriptionLatest = {
|
||||
type: ACTIONS.SET_SUBSCRIPTION_LATEST,
|
||||
data: {
|
||||
subscription: Subscription,
|
||||
uri: string,
|
||||
},
|
||||
};
|
||||
|
||||
declare type CheckSubscriptionStarted = {
|
||||
type: ACTIONS.CHECK_SUBSCRIPTION_STARTED,
|
||||
};
|
||||
|
||||
declare type CheckSubscriptionCompleted = {
|
||||
type: ACTIONS.CHECK_SUBSCRIPTION_COMPLETED,
|
||||
};
|
||||
|
||||
declare type FetchedSubscriptionsSucess = {
|
||||
type: ACTIONS.FETCH_SUBSCRIPTIONS_SUCCESS,
|
||||
data: Array<Subscription>,
|
||||
};
|
||||
|
||||
declare type SetViewMode = {
|
||||
type: ACTIONS.SET_VIEW_MODE,
|
||||
data: ViewMode,
|
||||
};
|
||||
|
||||
declare type GetSuggestedSubscriptionsSuccess = {
|
||||
type: ACTIONS.GET_SUGGESTED_SUBSCRIPTIONS_START,
|
||||
data: SuggestedSubscriptions,
|
||||
};
|
||||
|
||||
2
flow-typed/user.js
vendored
2
flow-typed/user.js
vendored
@@ -26,4 +26,6 @@ declare type User = {
|
||||
updated_at: string,
|
||||
youtube_channels: ?Array<string>,
|
||||
device_types: Array<DeviceType>,
|
||||
lbry_first_approved: boolean,
|
||||
experimental_ui: boolean,
|
||||
};
|
||||
|
||||
9
flow-typed/web-file.js
vendored
9
flow-typed/web-file.js
vendored
@@ -1,7 +1,6 @@
|
||||
declare type WebFile = {
|
||||
name: string,
|
||||
// @flow
|
||||
|
||||
declare type WebFile = File & {
|
||||
path?: string,
|
||||
title?: string,
|
||||
path: string,
|
||||
size: string,
|
||||
type: string,
|
||||
}
|
||||
|
||||
@@ -1,25 +1,35 @@
|
||||
// @flow
|
||||
import * as PAGES from 'constants/pages';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import moment from 'moment';
|
||||
import { toCapitalCase } from 'util/string';
|
||||
import { useIsLargeScreen } from 'effects/use-screensize';
|
||||
|
||||
type RowDataItem = {
|
||||
export type RowDataItem = {
|
||||
title: string,
|
||||
link?: string,
|
||||
help?: any,
|
||||
options?: {},
|
||||
icon?: string,
|
||||
};
|
||||
|
||||
export default function getHomePageRowData(
|
||||
export default function GetHomePageRowData(
|
||||
authenticated: boolean,
|
||||
showPersonalizedChannels: boolean,
|
||||
showPersonalizedTags: boolean,
|
||||
subscribedChannels: Array<Subscription>,
|
||||
followedTags: Array<Tag>,
|
||||
showIndividualTags: boolean
|
||||
showIndividualTags: boolean,
|
||||
showNsfw: boolean
|
||||
) {
|
||||
const isLargeScreen = useIsLargeScreen();
|
||||
|
||||
function getPageSize(originalSize) {
|
||||
return isLargeScreen ? originalSize * (3 / 2) : originalSize;
|
||||
}
|
||||
|
||||
let rowData: Array<RowDataItem> = [];
|
||||
const individualTagDataItems: Array<RowDataItem> = [];
|
||||
const YOUTUBER_CHANNEL_IDS = [
|
||||
@@ -114,21 +124,18 @@ export default function getHomePageRowData(
|
||||
options: {
|
||||
claimType: ['stream'],
|
||||
orderBy: ['release_time'],
|
||||
pageSize: 12,
|
||||
pageSize: getPageSize(12),
|
||||
channelIds: YOUTUBER_CHANNEL_IDS,
|
||||
releaseTime: `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, 'months')
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`,
|
||||
limitClaimsPerChannel: 1,
|
||||
releaseTime: `>${Math.floor(moment().subtract(1, 'months').startOf('week').unix())}`,
|
||||
},
|
||||
};
|
||||
|
||||
if (followedTags.length) {
|
||||
followedTags.forEach((tag: Tag) => {
|
||||
const tagName = `#${toCapitalCase(tag.name)}`;
|
||||
individualTagDataItems.push({
|
||||
title: __(`Trending for `) + `#${toCapitalCase(tag.name)}`,
|
||||
title: __('Trending for %tagName%', { tagName: tagName }),
|
||||
link: `/$/${PAGES.DISCOVER}?t=${tag.name}`,
|
||||
options: {
|
||||
pageSize: 4,
|
||||
@@ -142,23 +149,14 @@ export default function getHomePageRowData(
|
||||
const RECENT_FROM_FOLLOWING = {
|
||||
title: __('Recent From Following'),
|
||||
link: `/$/${PAGES.CHANNELS_FOLLOWING}`,
|
||||
icon: ICONS.SUBSCRIBE,
|
||||
options: {
|
||||
orderBy: ['release_time'],
|
||||
releaseTime:
|
||||
subscribedChannels.length > 20
|
||||
? `>${Math.floor(
|
||||
moment()
|
||||
.subtract(6, 'months')
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`
|
||||
: `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, 'year')
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`,
|
||||
pageSize: subscribedChannels.length > 3 ? (subscribedChannels.length > 6 ? 16 : 8) : 4,
|
||||
? `>${Math.floor(moment().subtract(6, 'months').startOf('week').unix())}`
|
||||
: `>${Math.floor(moment().subtract(1, 'year').startOf('week').unix())}`,
|
||||
pageSize: getPageSize(subscribedChannels.length > 3 ? (subscribedChannels.length > 6 ? 16 : 8) : 4),
|
||||
channelIds: subscribedChannels.map((subscription: Subscription) => {
|
||||
const { channelClaimId } = parseURI(subscription.uri);
|
||||
return channelClaimId;
|
||||
@@ -170,25 +168,11 @@ export default function getHomePageRowData(
|
||||
title: __('Top Content from Today'),
|
||||
link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TOP}&${CS.FRESH_KEY}=${CS.FRESH_DAY}`,
|
||||
options: {
|
||||
pageSize: showPersonalizedChannels || showPersonalizedTags ? 4 : 8,
|
||||
pageSize: getPageSize(showPersonalizedChannels || showPersonalizedTags ? 4 : 8),
|
||||
orderBy: ['effective_amount'],
|
||||
claimType: ['stream'],
|
||||
releaseTime: `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, 'day')
|
||||
.startOf('day')
|
||||
.unix()
|
||||
)}`,
|
||||
},
|
||||
};
|
||||
|
||||
const PROTESTS_2020 = {
|
||||
title: '#2020protests',
|
||||
link: `/$/${PAGES.DISCOVER}?${CS.TAGS_KEY}=2020protests&${CS.CLAIM_TYPE}=${CS.CLAIM_STREAM}`,
|
||||
options: {
|
||||
claimType: ['stream'],
|
||||
tags: ['2020protests'],
|
||||
pageSize: 4,
|
||||
limitClaimsPerChannel: 2,
|
||||
releaseTime: `>${Math.floor(moment().subtract(1, 'day').startOf('day').unix())}`,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -201,20 +185,21 @@ export default function getHomePageRowData(
|
||||
},
|
||||
};
|
||||
|
||||
const TRENDING_CLASSICS = {
|
||||
title: __('Trending Classics'),
|
||||
link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TRENDING}&${CS.FRESH_KEY}=${CS.FRESH_WEEK}`,
|
||||
options: {
|
||||
pageSize: 4,
|
||||
claimType: ['stream'],
|
||||
releaseTime: `<${Math.floor(
|
||||
moment()
|
||||
.subtract(6, 'month')
|
||||
.startOf('day')
|
||||
.unix()
|
||||
)}`,
|
||||
},
|
||||
};
|
||||
// const TRENDING_CLASSICS = {
|
||||
// title: __('Trending Classics'),
|
||||
// link: `/$/${PAGES.DISCOVER}?${CS.ORDER_BY_KEY}=${CS.ORDER_BY_TRENDING}&${CS.FRESH_KEY}=${CS.FRESH_WEEK}`,
|
||||
// options: {
|
||||
// pageSize: getPageSize(4),
|
||||
// claimType: ['stream'],
|
||||
// limitClaimsPerChannel: 1,
|
||||
// releaseTime: `<${Math.floor(
|
||||
// moment()
|
||||
// .subtract(6, 'month')
|
||||
// .startOf('day')
|
||||
// .unix()
|
||||
// )}`,
|
||||
// },
|
||||
// };
|
||||
|
||||
// const TRENDING_ON_LBRY = {
|
||||
// title: __('Trending On LBRY'),
|
||||
@@ -227,9 +212,13 @@ export default function getHomePageRowData(
|
||||
const TRENDING_FOR_TAGS = {
|
||||
title: __('Trending For Your Tags'),
|
||||
link: `/$/${PAGES.TAGS_FOLLOWING}`,
|
||||
icon: ICONS.TAG,
|
||||
|
||||
options: {
|
||||
tags: followedTags.map(tag => tag.name),
|
||||
pageSize: getPageSize(4),
|
||||
tags: followedTags.map((tag) => tag.name),
|
||||
claimType: ['stream'],
|
||||
limitClaimsPerChannel: 2,
|
||||
},
|
||||
};
|
||||
|
||||
@@ -238,7 +227,7 @@ export default function getHomePageRowData(
|
||||
link: `/@lbry:3f`,
|
||||
options: {
|
||||
orderBy: ['release_time'],
|
||||
pageSize: 4,
|
||||
pageSize: getPageSize(4),
|
||||
channelIds: ['3fda836a92faaceedfe398225fb9b2ee2ed1f01a'],
|
||||
},
|
||||
};
|
||||
@@ -248,7 +237,7 @@ export default function getHomePageRowData(
|
||||
link: `/@lbrycast:4`,
|
||||
options: {
|
||||
orderBy: ['release_time'],
|
||||
pageSize: 4,
|
||||
pageSize: getPageSize(4),
|
||||
channelIds: ['4c29f8b013adea4d5cca1861fb2161d5089613ea'],
|
||||
},
|
||||
};
|
||||
@@ -265,9 +254,7 @@ export default function getHomePageRowData(
|
||||
rowData.push(YOUTUBE_CREATOR_ROW);
|
||||
}
|
||||
|
||||
rowData.push(TRENDING_CLASSICS);
|
||||
rowData.push(TOP_CONTENT_TODAY);
|
||||
rowData.push(PROTESTS_2020);
|
||||
|
||||
// rowData.push(TRENDING_ON_LBRY);
|
||||
|
||||
5
homepages/index.js
Normal file
5
homepages/index.js
Normal file
@@ -0,0 +1,5 @@
|
||||
import * as lbrytv from './homepage';
|
||||
// import all homepages
|
||||
// export object of homepages
|
||||
export default {'en': lbrytv};
|
||||
export const NO_ADS_CHANNEL_IDS = [];
|
||||
98
package.json
98
package.json
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "lbry",
|
||||
"version": "0.46.3",
|
||||
"version": "0.49.4",
|
||||
"description": "A browser for the LBRY network, a digital marketplace controlled by its users.",
|
||||
"keywords": [
|
||||
"lbry"
|
||||
@@ -21,11 +21,12 @@
|
||||
"main": "./dist/electron/main.js",
|
||||
"scripts": {
|
||||
"compile:electron": "node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --config webpack.electron.config.js",
|
||||
"compile:web": "cd web && node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --config webpack.config.js",
|
||||
"compile:web": "yarn copyenv && cd web && node --max_old_space_size=4096 ./node_modules/webpack/bin/webpack.js --config webpack.config.js",
|
||||
"compile": "cross-env NODE_ENV=production yarn compile:electron && cross-env NODE_ENV=production yarn compile:web",
|
||||
"copyenv": "cp ./.env* web/",
|
||||
"dev": "yarn dev:electron",
|
||||
"dev:electron": "cross-env NODE_ENV=development node ./electron/devServer.js",
|
||||
"dev:web": "cd web && yarn dev",
|
||||
"dev:web": "yarn copyenv && cd web && yarn dev",
|
||||
"dev:web-server": "cross-env NODE_ENV=development yarn compile:web && concurrently \"cross-env NODE_ENV=development yarn compile:web --watch\" \"cd web && yarn dev:server\"",
|
||||
"dev:internal-apis": "LBRY_API_URL='http://localhost:8080' yarn dev:electron",
|
||||
"dev:iatv": "LBRY_API_URL='http://localhost:15400' SDK_API_URL='http://localhost:15100' yarn dev:web",
|
||||
@@ -34,25 +35,27 @@
|
||||
"dist": "electron-builder",
|
||||
"build": "cross-env NODE_ENV=production yarn compile:electron && electron-builder build",
|
||||
"build:dir": "yarn build -- --dir -c.compression=store -c.mac.identity=null",
|
||||
"lint": "eslint 'src/**/*.{js,jsx}' --fix && flow",
|
||||
"crossenv": "./node_modules/cross-env/dist/bin/cross-env",
|
||||
"lint": "eslint 'ui/**/*.{js,jsx}' && eslint 'web/**/*.{js,jsx}' && eslint 'electron/**/*.js' && flow",
|
||||
"format": "prettier 'src/**/*.{js,jsx,scss,json}' --write",
|
||||
"flow-defs": "flow-typed install",
|
||||
"precommit": "lint-staged",
|
||||
"preinstall": "yarn cache clean lbry-redux && yarn cache clean lbryinc",
|
||||
"postinstall": "cd web && yarn && cd .. && if-env NODE_ENV=production && yarn postinstall:warning || if-env APP_ENV=web && echo 'Done installing deps' || yarn postinstall:electron",
|
||||
"postinstall:electron": "electron-builder install-app-deps && node ./build/downloadDaemon.js",
|
||||
"postinstall:electron": "electron-builder install-app-deps && node ./build/downloadDaemon.js && node ./build/downloadLBRYFirst.js",
|
||||
"postinstall:warning": "echo '\n\nWARNING\n\nNot all node modules were installed because NODE_ENV is set to \"production\".\nThis should only be set after installing dependencies with \"yarn\". The app will not work.\n\n'"
|
||||
},
|
||||
"dependencies": {
|
||||
"auto-launch": "^5.0.5",
|
||||
"electron-dl": "^1.11.0",
|
||||
"electron-log": "^2.2.12",
|
||||
"electron-notarize": "^0.1.1",
|
||||
"electron-notarize": "^1.0.0",
|
||||
"electron-updater": "^4.2.4",
|
||||
"express": "^4.17.1",
|
||||
"if-env": "^1.0.4",
|
||||
"remark-breaks": "^1.0.5",
|
||||
"videojs-logo": "^2.0.0"
|
||||
"remove-markdown": "^0.3.0",
|
||||
"tempy": "^0.6.0",
|
||||
"videojs-logo": "^2.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.0.0",
|
||||
@@ -63,54 +66,58 @@
|
||||
"@babel/plugin-transform-flow-strip-types": "^7.2.3",
|
||||
"@babel/plugin-transform-runtime": "^7.4.3",
|
||||
"@babel/polyfill": "^7.2.5",
|
||||
"@babel/preset-env": "^7.7.1",
|
||||
"@babel/preset-flow": "^7.0.0",
|
||||
"@babel/preset-env": "^7.12.11",
|
||||
"@babel/preset-flow": "^7.12.1",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"@babel/register": "^7.0.0",
|
||||
"@datapunt/matomo-tracker-js": "^0.1.4",
|
||||
"@exponent/electron-cookies": "^2.0.0",
|
||||
"@hot-loader/react-dom": "^16.8",
|
||||
"@lbry/components": "^4.2.5",
|
||||
"@hot-loader/react-dom": "^16.13",
|
||||
"@reach/auto-id": "^0.13.0",
|
||||
"@reach/combobox": "^0.12.1",
|
||||
"@reach/menu-button": "0.7.4",
|
||||
"@reach/rect": "^0.2.1",
|
||||
"@reach/rect": "^0.13.0",
|
||||
"@reach/tabs": "^0.1.5",
|
||||
"@reach/tooltip": "^0.12.1",
|
||||
"@reach/utils": "^0.12.1",
|
||||
"@sentry/browser": "^5.12.1",
|
||||
"@sentry/webpack-plugin": "^1.10.0",
|
||||
"@types/three": "^0.93.1",
|
||||
"@types/three": "^0.103.2",
|
||||
"adm-zip": "^0.4.13",
|
||||
"async-exit-hook": "^2.0.1",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"babel-loader": "^8.0.5",
|
||||
"babel-plugin-add-module-exports": "^1.0.0",
|
||||
"babel-plugin-add-module-exports": "^1.0.4",
|
||||
"babel-plugin-import-glob": "^2.0.0",
|
||||
"babel-plugin-transform-imports": "^1.5.1",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.26.0",
|
||||
"bluebird": "^3.5.1",
|
||||
"chalk": "^2.4.2",
|
||||
"chalk": "^4.1.0",
|
||||
"classnames": "^2.2.5",
|
||||
"codemirror": "^5.39.2",
|
||||
"concurrently": "^4.1.2",
|
||||
"connected-react-router": "^6.4.0",
|
||||
"copy-webpack-plugin": "^4.6.0",
|
||||
"connected-react-router": "^6.8.0",
|
||||
"copy-webpack-plugin": "^5.1.2",
|
||||
"country-data": "^0.0.31",
|
||||
"cross-env": "^5.2.0",
|
||||
"cross-env": "^7.0.3",
|
||||
"crypto-js": "^4.0.0",
|
||||
"css-doodle": "^0.7.1",
|
||||
"css-loader": "^2.1.0",
|
||||
"cssnano": "^4.1.10",
|
||||
"dat.gui": "^0.7.2",
|
||||
"decompress": "^4.2.0",
|
||||
"decompress": "^4.2.1",
|
||||
"del": "^3.0.0",
|
||||
"devtron": "^1.4.0",
|
||||
"dom-scroll-into-view": "^1.2.1",
|
||||
"dotenv-defaults": "^1.1.1",
|
||||
"dotenv-defaults": "^2.0.1",
|
||||
"dotenv-webpack": "^1.8.0",
|
||||
"electron": "4.1.0",
|
||||
"electron-builder": "^22.4.0",
|
||||
"electron-devtools-installer": "^2.2.4",
|
||||
"electron": "9.4.0",
|
||||
"electron-builder": "^22.9.1",
|
||||
"electron-devtools-installer": "^3.1.1",
|
||||
"electron-is-dev": "^0.3.0",
|
||||
"electron-webpack": "^2.7.4",
|
||||
"electron-webpack": "^2.8.2",
|
||||
"electron-window-state": "^4.1.1",
|
||||
"emoji-dictionary": "^1.0.11",
|
||||
"eslint": "^5.15.2",
|
||||
"eslint-config-prettier": "^2.9.0",
|
||||
"eslint-config-standard": "^12.0.0",
|
||||
@@ -129,34 +136,35 @@
|
||||
"flow-bin": "^0.97.0",
|
||||
"flow-typed": "^2.3.0",
|
||||
"formik": "^0.10.4",
|
||||
"hast-util-sanitize": "^1.1.2",
|
||||
"hast-util-sanitize": "^3.0.2",
|
||||
"history": "^4.9.0",
|
||||
"husky": "^3.1.0",
|
||||
"imagesloaded": "^4.1.4",
|
||||
"json-loader": "^0.5.4",
|
||||
"lbry-format": "https://github.com/lbryio/lbry-format.git",
|
||||
"lbry-redux": "lbryio/lbry-redux#906199d866a187015668a27363f010828c15979a",
|
||||
"lbryinc": "lbryio/lbryinc#72eee35f5181940eb4a468a27ddb2a2a4e362fb0",
|
||||
"lbry-redux": "lbryio/lbry-redux#bf728f8716385749370de9a1edee50b267d61fa4",
|
||||
"lbryinc": "lbryio/lbryinc#7faea40d87b78ec91b901c62f501499dc4737025",
|
||||
"lint-staged": "^7.0.2",
|
||||
"localforage": "^1.7.1",
|
||||
"lodash-es": "^4.17.14",
|
||||
"mammoth": "^1.4.6",
|
||||
"mammoth": "^1.4.16",
|
||||
"moment": "^2.22.0",
|
||||
"node-abi": "^2.5.1",
|
||||
"node-fetch": "^2.3.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"node-libs-browser": "^2.1.0",
|
||||
"node-loader": "^0.6.0",
|
||||
"node-sass": "^4.11.0",
|
||||
"nodemon": "^1.19.1",
|
||||
"postcss-import": "^12.0.1",
|
||||
"postcss-loader": "^3.0.0",
|
||||
"postcss-rtl": "^1.7.3",
|
||||
"preprocess-loader": "^0.3.0",
|
||||
"prettier": "^1.11.1",
|
||||
"prettier": "^2.2.1",
|
||||
"prop-types": "^15.6.2",
|
||||
"qrcode.react": "^0.8.0",
|
||||
"raw-loader": "^2.0.0",
|
||||
"rc-progress": "^2.0.6",
|
||||
"react": "^16.8.2",
|
||||
"react-awesome-lightbox": "^1.7.3",
|
||||
"react-confetti": "^4.0.1",
|
||||
"react-dom": "^16.8.2",
|
||||
"react-draggable": "^3.3.0",
|
||||
@@ -167,9 +175,8 @@
|
||||
"react-redux": "^6.0.1",
|
||||
"react-router": "^5.1.0",
|
||||
"react-router-dom": "^5.1.0",
|
||||
"react-simplemde-editor": "^4.0.0",
|
||||
"react-simplemde-editor": "^4.1.3",
|
||||
"react-spring": "^8.0.20",
|
||||
"react-sticky-box": "^0.8.0",
|
||||
"reakit": "^1.0.0-beta.13",
|
||||
"redux": "^3.6.0",
|
||||
"redux-persist": "^5.10.0",
|
||||
@@ -178,21 +185,26 @@
|
||||
"redux-thunk": "^2.2.0",
|
||||
"remark": "^9.0.0",
|
||||
"remark-attr": "^0.8.3",
|
||||
"remark-breaks": "^1.0.5",
|
||||
"remark-emoji": "^2.0.1",
|
||||
"remark-react": "^4.0.3",
|
||||
"reselect": "^3.0.0",
|
||||
"remark-frontmatter": "^2.0.0",
|
||||
"remark-react": "^8.0.0",
|
||||
"reselect": "^4.0.0",
|
||||
"sass": "^1.29.0",
|
||||
"sass-loader": "^7.1.0",
|
||||
"semver": "^5.3.0",
|
||||
"stream-to-blob-url": "^2.1.1",
|
||||
"strip-markdown": "^3.0.3",
|
||||
"style-loader": "^0.23.1",
|
||||
"terser-webpack-plugin": "^1.2.3",
|
||||
"three": "^0.93.0",
|
||||
"three": "^0.125.0",
|
||||
"three-full": "^17.1.0",
|
||||
"tiny-relative-date": "^1.3.0",
|
||||
"tree-kill": "^1.1.0",
|
||||
"unist-util-visit": "^1.4.1",
|
||||
"video.js": "7.6.6",
|
||||
"unist-util-visit": "^2.0.3",
|
||||
"uuid": "^8.3.2",
|
||||
"video.js": "^7.10.1",
|
||||
"videojs-contrib-quality-levels": "^2.0.9",
|
||||
"videojs-event-tracking": "^1.0.1",
|
||||
"villain-react": "^1.0.9",
|
||||
"wavesurfer.js": "^2.2.1",
|
||||
@@ -213,9 +225,13 @@
|
||||
"yarn": "^1.3"
|
||||
},
|
||||
"lbrySettings": {
|
||||
"lbrynetDaemonVersion": "0.76.0",
|
||||
"lbrynetDaemonVersion": "0.88.0",
|
||||
"lbrynetDaemonUrlTemplate": "https://github.com/lbryio/lbry/releases/download/vDAEMONVER/lbrynet-OSNAME.zip",
|
||||
"lbrynetDaemonDir": "static/daemon",
|
||||
"lbrynetDaemonFileName": "lbrynet"
|
||||
"lbrynetDaemonFileName": "lbrynet",
|
||||
"LBRYFirstVersion": "0.0.20",
|
||||
"LBRYFirstUrlTemplate": "https://github.com/lbryio/lbry-first/releases/download/vLBRYFIRSTVER/lbry-first_OSNAME_amd64.zip",
|
||||
"LBRYFirstDir": "static/lbry-first",
|
||||
"LBRYFirstFileName": "lbry-first"
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,5 +1,5 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html dir="ltr">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<script src="/public/ui.js" async></script>
|
||||
<link rel="icon" type="image/png" href="/public/favicon.png" />
|
||||
|
||||
<link rel="preload" href="/public/font/v1/300.woff" as="font" type="font/woff" />
|
||||
@@ -64,13 +63,6 @@
|
||||
</style>
|
||||
|
||||
<!-- VARIABLE_HEAD_BEGIN -->
|
||||
<title>lbry.tv</title>
|
||||
<meta property="og:url" content="https://lbry.tv" />
|
||||
<meta property="og:title" content="lbry.tv" />
|
||||
<meta property="og:site_name" content="lbry.tv" />
|
||||
<meta property="og:description" content="Meet LBRY, a content platform owned by everyone (and no one)." />
|
||||
<meta property="og:image" content="https://lbry.tv/public/v2-og.png" />
|
||||
<meta property="fb:app_id" content="1673146449633983" />
|
||||
<!-- VARIABLE_HEAD_END -->
|
||||
</head>
|
||||
|
||||
|
||||
4
static/opensearch.xml
Normal file
4
static/opensearch.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<OpenSearchDescription xmlns="http://a9.com/-/spec/opensearch/1.1/" xmlns:moz="http://www.mozilla.org/2006/browser/search/">
|
||||
<!-- VARIABLE_XML_BEGIN -->
|
||||
<!-- VARIABLE_XML_END -->
|
||||
</OpenSearchDescription>
|
||||
2
static/robots.txt
Normal file
2
static/robots.txt
Normal file
@@ -0,0 +1,2 @@
|
||||
User-agent: *
|
||||
Disallow: /
|
||||
@@ -9,7 +9,7 @@ import Native from 'native';
|
||||
import ElectronCookies from '@exponent/electron-cookies';
|
||||
import { generateInitialUrl } from 'util/url';
|
||||
// @endif
|
||||
import { MATOMO_ID, MATOMO_URL } from 'config';
|
||||
import { MATOMO_ID, MATOMO_URL, LBRY_WEB_BUFFER_API } from 'config';
|
||||
|
||||
const isProduction = process.env.NODE_ENV === 'production';
|
||||
const devInternalApis = process.env.LBRY_API_URL;
|
||||
@@ -28,15 +28,29 @@ if (isProduction) {
|
||||
type Analytics = {
|
||||
error: string => Promise<any>,
|
||||
sentryError: ({} | string, {}) => Promise<any>,
|
||||
pageView: string => void,
|
||||
pageView: (string, ?string) => void,
|
||||
setUser: Object => void,
|
||||
toggleInternal: (boolean, ?boolean) => void,
|
||||
apiLogView: (string, string, string, ?number, ?() => void) => Promise<any>,
|
||||
apiLogPublish: (ChannelClaim | StreamClaim) => void,
|
||||
apiSyncTags: ({}) => void,
|
||||
tagFollowEvent: (string, boolean, ?string) => void,
|
||||
playerLoadedEvent: (?boolean) => void,
|
||||
playerStartedEvent: (?boolean) => void,
|
||||
videoFetchDuration: (string, number) => void,
|
||||
videoStartEvent: (string, number) => void,
|
||||
videoBufferEvent: (string, number) => void,
|
||||
videoBufferEvent: (
|
||||
StreamClaim,
|
||||
{
|
||||
timeAtBuffer: number,
|
||||
bufferDuration: number,
|
||||
bitRate: number,
|
||||
duration: number,
|
||||
userId: string,
|
||||
playerPoweredBy: string,
|
||||
readyState: number,
|
||||
}
|
||||
) => void,
|
||||
emailProvidedEvent: () => void,
|
||||
emailVerifiedEvent: () => void,
|
||||
rewardEligibleEvent: () => void,
|
||||
@@ -85,16 +99,24 @@ const analytics: Analytics = {
|
||||
}
|
||||
});
|
||||
},
|
||||
pageView: path => {
|
||||
pageView: (path, search) => {
|
||||
if (internalAnalyticsEnabled) {
|
||||
MatomoInstance.trackPageView({
|
||||
href: `${path}`,
|
||||
});
|
||||
const params: { href: string, customDimensions?: Array<{ id: number, value: ?string }> } = { href: `${path}` };
|
||||
const dimensions = [];
|
||||
const searchParams = search && new URLSearchParams(search);
|
||||
|
||||
if (searchParams && searchParams.get('src')) {
|
||||
dimensions.push({ id: 1, value: searchParams.get('src') });
|
||||
}
|
||||
if (dimensions.length) {
|
||||
params['customDimensions'] = dimensions;
|
||||
}
|
||||
MatomoInstance.trackPageView(params);
|
||||
}
|
||||
},
|
||||
setUser: userId => {
|
||||
// SEND USERID TO MATOMO?
|
||||
if (internalAnalyticsEnabled && userId) {
|
||||
window._paq.push(['setUserId', String(userId)]);
|
||||
// @if TARGET='app'
|
||||
Native.getAppVersionInfo().then(({ localVersion }) => {
|
||||
sendMatomoEvent('Version', 'Desktop-Version', localVersion);
|
||||
@@ -149,7 +171,8 @@ const analytics: Analytics = {
|
||||
}
|
||||
},
|
||||
apiLogPublish: (claimResult: ChannelClaim | StreamClaim) => {
|
||||
if (internalAnalyticsEnabled && isProduction) {
|
||||
// Don't check if this is production so channels created on localhost are still linked to user
|
||||
if (internalAnalyticsEnabled) {
|
||||
const { permanent_url: uri, claim_id: claimId, txid, nout, signing_channel: signingChannel } = claimResult;
|
||||
let channelClaimId;
|
||||
if (signingChannel) {
|
||||
@@ -177,13 +200,49 @@ const analytics: Analytics = {
|
||||
Lbryio.call('feedback', 'search', { query, vote });
|
||||
}
|
||||
},
|
||||
|
||||
videoFetchDuration: (source, duration) => {
|
||||
sendPromMetric('time_to_fetch', duration);
|
||||
sendMatomoEvent('Media', 'TimeToFetch', source, duration);
|
||||
},
|
||||
|
||||
videoStartEvent: (claimId, duration) => {
|
||||
sendPromMetric('time_to_start', duration);
|
||||
sendMatomoEvent('Media', 'TimeToStart', claimId, duration);
|
||||
},
|
||||
videoBufferEvent: (claimId, currentTime) => {
|
||||
sendPromMetric('buffer');
|
||||
sendMatomoEvent('Media', 'BufferTimestamp', claimId, currentTime * 1000);
|
||||
|
||||
videoBufferEvent: (claim, data) => {
|
||||
sendMatomoEvent('Media', 'BufferTimestamp', claim.claim_id, data.timeAtBuffer);
|
||||
|
||||
if (LBRY_WEB_BUFFER_API) {
|
||||
fetch(LBRY_WEB_BUFFER_API, {
|
||||
method: 'post',
|
||||
headers: {
|
||||
Accept: 'application/json',
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
device: 'web',
|
||||
type: 'buffering',
|
||||
client: data.userId,
|
||||
data: {
|
||||
url: claim.canonical_url,
|
||||
position: data.timeAtBuffer,
|
||||
duration: data.bufferDuration,
|
||||
player: data.playerPoweredBy,
|
||||
readyState: data.readyState,
|
||||
stream_duration: data.duration,
|
||||
stream_bitrate: data.bitRate,
|
||||
},
|
||||
}),
|
||||
});
|
||||
}
|
||||
},
|
||||
playerLoadedEvent: embedded => {
|
||||
sendMatomoEvent('Player', 'Loaded', embedded ? 'embedded' : 'onsite');
|
||||
},
|
||||
playerStartedEvent: embedded => {
|
||||
sendMatomoEvent('Player', 'Started', embedded ? 'embedded' : 'onsite');
|
||||
},
|
||||
tagFollowEvent: (tag, following) => {
|
||||
sendMatomoEvent('Tag', following ? 'Tag-Follow' : 'Tag-Unfollow', tag);
|
||||
@@ -246,7 +305,7 @@ const MatomoInstance = new MatomoTracker({
|
||||
// Manually call the first page view
|
||||
// React Router doesn't include this on `history.listen`
|
||||
// @if TARGET='web'
|
||||
analytics.pageView(window.location.pathname + window.location.search);
|
||||
analytics.pageView(window.location.pathname + window.location.search, window.location.search);
|
||||
// @endif
|
||||
|
||||
// @if TARGET='app'
|
||||
@@ -261,7 +320,7 @@ history.listen(location => {
|
||||
const { pathname, search } = location;
|
||||
|
||||
const page = `${pathname}${search}`;
|
||||
analytics.pageView(page);
|
||||
analytics.pageView(page, search);
|
||||
});
|
||||
|
||||
export default analytics;
|
||||
|
||||
39
ui/comments.js
Normal file
39
ui/comments.js
Normal file
@@ -0,0 +1,39 @@
|
||||
// @flow
|
||||
import { COMMENT_SERVER_API } from 'config';
|
||||
|
||||
const Comments = {
|
||||
url: COMMENT_SERVER_API,
|
||||
enabled: Boolean(COMMENT_SERVER_API),
|
||||
|
||||
moderation_block: (params: ModerationBlockParams) => fetchCommentsApi('moderation.Block', params),
|
||||
moderation_unblock: (params: ModerationBlockParams) => fetchCommentsApi('moderation.UnBlock', params),
|
||||
moderation_block_list: (params: ModerationBlockParams) => fetchCommentsApi('moderation.BlockedList', params),
|
||||
comment_list: (params: CommentListParams) => fetchCommentsApi('comment.List', params),
|
||||
comment_abandon: (params: CommentAbandonParams) => fetchCommentsApi('comment.Abandon', params),
|
||||
};
|
||||
|
||||
function fetchCommentsApi(method: string, params: {}) {
|
||||
if (!Comments.enabled) {
|
||||
return Promise.reject('Comments are not currently enabled'); // eslint-disable-line
|
||||
}
|
||||
|
||||
const url = `${Comments.url}?m=${method}`;
|
||||
const options = {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
},
|
||||
body: JSON.stringify({
|
||||
jsonrpc: '2.0',
|
||||
id: 1,
|
||||
method,
|
||||
params,
|
||||
}),
|
||||
};
|
||||
|
||||
return fetch(url, options)
|
||||
.then((res) => res.json())
|
||||
.then((res) => res.result);
|
||||
}
|
||||
|
||||
export default Comments;
|
||||
@@ -1,14 +1,6 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectBlockedChannels } from 'lbry-redux';
|
||||
import { doChannelUnsubscribe } from 'redux/actions/subscriptions';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
import AbandonedChannelPreview from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
blockedChannelUris: selectBlockedChannels(state),
|
||||
});
|
||||
const select = (state, props) => ({});
|
||||
|
||||
export default connect(select, {
|
||||
doChannelUnsubscribe,
|
||||
doOpenModal,
|
||||
})(AbandonedChannelPreview);
|
||||
export default connect(select)(AbandonedChannelPreview);
|
||||
|
||||
@@ -2,28 +2,18 @@
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import Button from 'component/button';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import * as ICONS from '../../constants/icons';
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
|
||||
type SubscriptionArgs = {
|
||||
channelName: string,
|
||||
uri: string,
|
||||
};
|
||||
import ChannelBlockButton from 'component/channelBlockButton';
|
||||
import ChannelMuteButton from 'component/channelMuteButton';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
doChannelUnsubscribe: SubscriptionArgs => void,
|
||||
type: string,
|
||||
blockedChannelUris: Array<string>,
|
||||
doOpenModal: (string, {}) => void,
|
||||
};
|
||||
|
||||
function AbandonedChannelPreview(props: Props) {
|
||||
const { uri, doChannelUnsubscribe, type, blockedChannelUris, doOpenModal } = props;
|
||||
const { uri, type } = props;
|
||||
const { channelName } = parseURI(uri);
|
||||
const isBlockedChannel = blockedChannelUris.includes(uri);
|
||||
|
||||
return (
|
||||
<li className={classnames('claim-preview__wrapper', 'claim-preview__wrapper--notice')}>
|
||||
@@ -37,31 +27,10 @@ function AbandonedChannelPreview(props: Props) {
|
||||
<div className="media__subtitle">{__(`This channel may have been unpublished.`)}</div>
|
||||
</div>
|
||||
<div className="claim-preview__actions">
|
||||
{isBlockedChannel && (
|
||||
<Button
|
||||
iconColor="red"
|
||||
icon={ICONS.UNBLOCK}
|
||||
button={'alt'}
|
||||
label={__('Unblock')}
|
||||
onClick={() => doOpenModal(MODALS.REMOVE_BLOCKED, { blockedUri: uri })}
|
||||
/>
|
||||
)}
|
||||
{/* SubscribeButton uses resolved permanentUri; modifying it didn't seem worth it. */}
|
||||
{!isBlockedChannel && (
|
||||
<Button
|
||||
iconColor="red"
|
||||
icon={ICONS.UNSUBSCRIBE}
|
||||
button={'alt'}
|
||||
label={__('Unfollow')}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
doChannelUnsubscribe({
|
||||
channelName: `@${channelName}`,
|
||||
uri,
|
||||
});
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
<div className="section__actions">
|
||||
<ChannelBlockButton uri={uri} />
|
||||
<ChannelMuteButton uri={uri} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,48 +1,67 @@
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import { hot } from 'react-hot-loader/root';
|
||||
import { connect } from 'react-redux';
|
||||
import { selectGetSyncErrorMessage, selectUploadCount } from 'lbryinc';
|
||||
import { selectUploadCount } from 'lbryinc';
|
||||
import { selectGetSyncErrorMessage, selectSyncFatalError } from 'redux/selectors/sync';
|
||||
import { doFetchAccessToken, doUserSetReferrer } from 'redux/actions/user';
|
||||
import { selectUser, selectAccessToken, selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { selectUnclaimedRewards } from 'redux/selectors/rewards';
|
||||
import { doFetchChannelListMine } from 'lbry-redux';
|
||||
import { makeSelectClientSetting, selectLoadedLanguages, selectThemePath } from 'redux/selectors/settings';
|
||||
import { selectIsUpgradeAvailable, selectAutoUpdateDownloaded } from 'redux/selectors/app';
|
||||
import { doSetLanguage } from 'redux/actions/settings';
|
||||
import { doFetchChannelListMine, selectMyChannelUrls, SETTINGS } from 'lbry-redux';
|
||||
import {
|
||||
makeSelectClientSetting,
|
||||
selectLanguage,
|
||||
selectLoadedLanguages,
|
||||
selectThemePath,
|
||||
} from 'redux/selectors/settings';
|
||||
import {
|
||||
selectIsUpgradeAvailable,
|
||||
selectAutoUpdateDownloaded,
|
||||
selectModal,
|
||||
selectActiveChannelClaim,
|
||||
} from 'redux/selectors/app';
|
||||
import { doGetWalletSyncPreference, doSetLanguage } from 'redux/actions/settings';
|
||||
import { doSyncLoop } from 'redux/actions/sync';
|
||||
import {
|
||||
doDownloadUpgradeRequested,
|
||||
doSignIn,
|
||||
doSyncWithPreferences,
|
||||
doGetAndPopulatePreferences,
|
||||
doAnalyticsTagSync,
|
||||
doSetActiveChannel,
|
||||
doSetIncognito,
|
||||
} from 'redux/actions/app';
|
||||
import { doFetchModBlockedList } from 'redux/actions/comments';
|
||||
import App from './view';
|
||||
|
||||
const select = state => ({
|
||||
const select = (state) => ({
|
||||
user: selectUser(state),
|
||||
accessToken: selectAccessToken(state),
|
||||
theme: selectThemePath(state),
|
||||
language: makeSelectClientSetting(SETTINGS.LANGUAGE)(state),
|
||||
language: selectLanguage(state),
|
||||
syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state),
|
||||
languages: selectLoadedLanguages(state),
|
||||
autoUpdateDownloaded: selectAutoUpdateDownloaded(state),
|
||||
isUpgradeAvailable: selectIsUpgradeAvailable(state),
|
||||
syncEnabled: makeSelectClientSetting(SETTINGS.ENABLE_SYNC)(state),
|
||||
syncError: selectGetSyncErrorMessage(state),
|
||||
uploadCount: selectUploadCount(state),
|
||||
rewards: selectUnclaimedRewards(state),
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
currentModal: selectModal(state),
|
||||
syncFatalError: selectSyncFatalError(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
myChannelUrls: selectMyChannelUrls(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
analyticsTagSync: () => dispatch(doAnalyticsTagSync()),
|
||||
const perform = (dispatch) => ({
|
||||
fetchAccessToken: () => dispatch(doFetchAccessToken()),
|
||||
fetchChannelListMine: () => dispatch(doFetchChannelListMine()),
|
||||
setLanguage: language => dispatch(doSetLanguage(language)),
|
||||
setLanguage: (language) => dispatch(doSetLanguage(language)),
|
||||
signIn: () => dispatch(doSignIn()),
|
||||
requestDownloadUpgrade: () => dispatch(doDownloadUpgradeRequested()),
|
||||
checkSync: () => dispatch(doSyncWithPreferences()),
|
||||
updatePreferences: () => dispatch(doGetAndPopulatePreferences()),
|
||||
getWalletSyncPref: () => dispatch(doGetWalletSyncPreference()),
|
||||
syncLoop: (noInterval) => dispatch(doSyncLoop(noInterval)),
|
||||
setReferrer: (referrer, doClaim) => dispatch(doUserSetReferrer(referrer, doClaim)),
|
||||
setActiveChannelIfNotSet: () => dispatch(doSetActiveChannel()),
|
||||
setIncognito: () => dispatch(doSetIncognito()),
|
||||
fetchModBlockedList: () => dispatch(doFetchModBlockedList()),
|
||||
});
|
||||
|
||||
export default hot(connect(select, perform)(App));
|
||||
|
||||
@@ -17,12 +17,18 @@ import Nag from 'component/common/nag';
|
||||
import REWARDS from 'rewards';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import FileDrop from 'component/fileDrop';
|
||||
import NagContinueFirstRun from 'component/nagContinueFirstRun';
|
||||
import Spinner from 'component/spinner';
|
||||
import SyncFatalError from 'component/syncFatalError';
|
||||
// @if TARGET='app'
|
||||
import useZoom from 'effects/use-zoom';
|
||||
import useHistoryNav from 'effects/use-history-nav';
|
||||
// @endif
|
||||
// @if TARGET='web'
|
||||
import OpenInAppLink from 'web/component/openInAppLink';
|
||||
import YoutubeWelcome from 'web/component/youtubeReferralWelcome';
|
||||
import NagDegradedPerformance from 'web/component/nag-degraded-performance';
|
||||
import NagDataCollection from 'web/component/nag-data-collection';
|
||||
|
||||
import {
|
||||
useDegradedPerformance,
|
||||
STATUS_OK,
|
||||
@@ -31,19 +37,15 @@ import {
|
||||
STATUS_DOWN,
|
||||
} from 'web/effects/use-degraded-performance';
|
||||
// @endif
|
||||
import LANGUAGE_MIGRATIONS from 'constants/language-migrations';
|
||||
export const MAIN_WRAPPER_CLASS = 'main-wrapper';
|
||||
// @if TARGET='app'
|
||||
export const IS_MAC = process.platform === 'darwin';
|
||||
// @endif
|
||||
const SYNC_INTERVAL = 1000 * 60 * 5; // 5 minutes
|
||||
export const IS_MAC = navigator.userAgent.indexOf('Mac OS X') !== -1;
|
||||
|
||||
// button numbers pulled from https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent/button
|
||||
const MOUSE_BACK_BTN = 3;
|
||||
const MOUSE_FORWARD_BTN = 4;
|
||||
|
||||
type Props = {
|
||||
alertError: (string | {}) => void,
|
||||
pageTitle: ?string,
|
||||
language: string,
|
||||
languages: Array<string>,
|
||||
theme: string,
|
||||
@@ -54,26 +56,35 @@ type Props = {
|
||||
goForward: () => void,
|
||||
index: number,
|
||||
length: number,
|
||||
push: string => void,
|
||||
push: (string) => void,
|
||||
},
|
||||
fetchAccessToken: () => void,
|
||||
fetchChannelListMine: () => void,
|
||||
signIn: () => void,
|
||||
requestDownloadUpgrade: () => void,
|
||||
onSignedIn: () => void,
|
||||
setLanguage: string => void,
|
||||
setLanguage: (string) => void,
|
||||
isUpgradeAvailable: boolean,
|
||||
autoUpdateDownloaded: boolean,
|
||||
checkSync: () => void,
|
||||
updatePreferences: () => void,
|
||||
syncEnabled: boolean,
|
||||
updatePreferences: () => Promise<any>,
|
||||
getWalletSyncPref: () => Promise<any>,
|
||||
uploadCount: number,
|
||||
balance: ?number,
|
||||
syncError: ?string,
|
||||
syncEnabled: boolean,
|
||||
rewards: Array<Reward>,
|
||||
setReferrer: (string, boolean) => void,
|
||||
analyticsTagSync: () => void,
|
||||
isAuthenticated: boolean,
|
||||
socketConnect: () => void,
|
||||
syncLoop: (?boolean) => void,
|
||||
syncEnabled: boolean,
|
||||
currentModal: any,
|
||||
syncFatalError: boolean,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
myChannelUrls: ?Array<string>,
|
||||
setActiveChannelIfNotSet: () => void,
|
||||
setIncognito: (boolean) => void,
|
||||
fetchModBlockedList: () => void,
|
||||
};
|
||||
|
||||
function App(props: Props) {
|
||||
@@ -86,8 +97,6 @@ function App(props: Props) {
|
||||
autoUpdateDownloaded,
|
||||
isUpgradeAvailable,
|
||||
requestDownloadUpgrade,
|
||||
syncEnabled,
|
||||
checkSync,
|
||||
uploadCount,
|
||||
history,
|
||||
syncError,
|
||||
@@ -95,19 +104,27 @@ function App(props: Props) {
|
||||
languages,
|
||||
setLanguage,
|
||||
updatePreferences,
|
||||
getWalletSyncPref,
|
||||
rewards,
|
||||
setReferrer,
|
||||
analyticsTagSync,
|
||||
isAuthenticated,
|
||||
syncLoop,
|
||||
currentModal,
|
||||
syncFatalError,
|
||||
myChannelUrls,
|
||||
activeChannelClaim,
|
||||
setActiveChannelIfNotSet,
|
||||
setIncognito,
|
||||
fetchModBlockedList,
|
||||
} = props;
|
||||
|
||||
const appRef = useRef();
|
||||
const isEnhancedLayout = useKonamiListener();
|
||||
const [hasSignedIn, setHasSignedIn] = useState(false);
|
||||
const userId = user && user.id;
|
||||
const hasVerifiedEmail = user && user.has_verified_email;
|
||||
const [readyForSync, setReadyForSync] = useState(false);
|
||||
const [readyForPrefs, setReadyForPrefs] = useState(false);
|
||||
const hasVerifiedEmail = user && Boolean(user.has_verified_email);
|
||||
const isRewardApproved = user && user.is_reward_approved;
|
||||
const previousUserId = usePrevious(userId);
|
||||
const previousHasVerifiedEmail = usePrevious(hasVerifiedEmail);
|
||||
const previousRewardApproved = usePrevious(isRewardApproved);
|
||||
// @if TARGET='web'
|
||||
@@ -119,11 +136,17 @@ function App(props: Props) {
|
||||
const showUpgradeButton =
|
||||
(autoUpdateDownloaded || (process.platform === 'linux' && isUpgradeAvailable)) && !upgradeNagClosed;
|
||||
// referral claiming
|
||||
const referredRewardAvailable = rewards && rewards.some(reward => reward.reward_type === REWARDS.TYPE_REFEREE);
|
||||
const referredRewardAvailable = rewards && rewards.some((reward) => reward.reward_type === REWARDS.TYPE_REFEREE);
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const rawReferrerParam = urlParams.get('r');
|
||||
const sanitizedReferrerParam = rawReferrerParam && rawReferrerParam.replace(':', '#');
|
||||
const shouldHideNag = pathname.startsWith(`/$/${PAGES.EMBED}`) || pathname.startsWith(`/$/${PAGES.AUTH_VERIFY}`);
|
||||
const userId = user && user.id;
|
||||
const useCustomScrollbar = !IS_MAC;
|
||||
const hasMyChannels = myChannelUrls && myChannelUrls.length > 0;
|
||||
const hasNoChannels = myChannelUrls && myChannelUrls.length === 0;
|
||||
const shouldMigrateLanguage = LANGUAGE_MIGRATIONS[language];
|
||||
const hasActiveChannelClaim = activeChannelClaim !== undefined;
|
||||
|
||||
let uri;
|
||||
try {
|
||||
@@ -135,11 +158,17 @@ function App(props: Props) {
|
||||
function handleAnalyticsDismiss() {
|
||||
setShowAnalyticsNag(false);
|
||||
}
|
||||
|
||||
// @endif
|
||||
useEffect(() => {
|
||||
if (userId) {
|
||||
analytics.setUser(userId);
|
||||
}
|
||||
}, [userId]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!uploadCount) return;
|
||||
const handleBeforeUnload = event => {
|
||||
const handleBeforeUnload = (event) => {
|
||||
event.preventDefault();
|
||||
event.returnValue = 'magic'; // without setting this to something it doesn't work
|
||||
};
|
||||
@@ -149,7 +178,7 @@ function App(props: Props) {
|
||||
|
||||
// allows user to navigate history using the forward and backward buttons on a mouse
|
||||
useEffect(() => {
|
||||
const handleForwardAndBackButtons = e => {
|
||||
const handleForwardAndBackButtons = (e) => {
|
||||
switch (e.button) {
|
||||
case MOUSE_BACK_BTN:
|
||||
history.index > 0 && history.goBack();
|
||||
@@ -165,7 +194,7 @@ function App(props: Props) {
|
||||
|
||||
// allows user to pause miniplayer using the spacebar without the page scrolling down
|
||||
useEffect(() => {
|
||||
const handleKeyPress = e => {
|
||||
const handleKeyPress = (e) => {
|
||||
if (e.key === ' ' && e.target === document.body) {
|
||||
e.preventDefault();
|
||||
}
|
||||
@@ -174,6 +203,16 @@ function App(props: Props) {
|
||||
return () => window.removeEventListener('keydown', handleKeyPress);
|
||||
}, []);
|
||||
|
||||
// Enable ctrl +/- zooming on Desktop.
|
||||
// @if TARGET='app'
|
||||
useZoom();
|
||||
// @endif
|
||||
|
||||
// Enable 'Alt + Left/Right' for history navigation on Desktop.
|
||||
// @if TARGET='app'
|
||||
useHistoryNav(history);
|
||||
// @endif
|
||||
|
||||
useEffect(() => {
|
||||
if (referredRewardAvailable && sanitizedReferrerParam && isRewardApproved) {
|
||||
setReferrer(sanitizedReferrerParam, true);
|
||||
@@ -188,10 +227,11 @@ function App(props: Props) {
|
||||
if (wrapperElement) {
|
||||
ReactModal.setAppElement(wrapperElement);
|
||||
}
|
||||
|
||||
fetchAccessToken();
|
||||
|
||||
// @if TARGET='app'
|
||||
fetchChannelListMine(); // This needs to be done for web too...
|
||||
fetchChannelListMine(); // This is fetched after a user is signed in on web
|
||||
// @endif
|
||||
}, [appRef, fetchAccessToken, fetchChannelListMine]);
|
||||
|
||||
@@ -200,6 +240,18 @@ function App(props: Props) {
|
||||
document.documentElement.setAttribute('theme', theme);
|
||||
}, [theme]);
|
||||
|
||||
useEffect(() => {
|
||||
if (hasMyChannels && !hasActiveChannelClaim) {
|
||||
setActiveChannelIfNotSet();
|
||||
} else if (hasNoChannels) {
|
||||
setIncognito(true);
|
||||
}
|
||||
|
||||
if (hasMyChannels) {
|
||||
fetchModBlockedList();
|
||||
}
|
||||
}, [hasMyChannels, hasNoChannels, hasActiveChannelClaim, setActiveChannelIfNotSet, setIncognito]);
|
||||
|
||||
useEffect(() => {
|
||||
if (!languages.includes(language)) {
|
||||
setLanguage(language);
|
||||
@@ -208,10 +260,10 @@ function App(props: Props) {
|
||||
}, [language, languages]);
|
||||
|
||||
useEffect(() => {
|
||||
if (previousUserId === undefined && userId) {
|
||||
analytics.setUser(userId);
|
||||
if (shouldMigrateLanguage) {
|
||||
setLanguage(shouldMigrateLanguage);
|
||||
}
|
||||
}, [previousUserId, userId]);
|
||||
}, [shouldMigrateLanguage, setLanguage]);
|
||||
|
||||
useEffect(() => {
|
||||
// Check that previousHasVerifiedEmail was not undefined instead of just not truthy
|
||||
@@ -227,45 +279,63 @@ function App(props: Props) {
|
||||
}
|
||||
}, [previousRewardApproved, isRewardApproved]);
|
||||
|
||||
// @if TARGET='app'
|
||||
useEffect(() => {
|
||||
if (updatePreferences && getWalletSyncPref && readyForPrefs) {
|
||||
getWalletSyncPref()
|
||||
.then(() => updatePreferences())
|
||||
.then(() => {
|
||||
setReadyForSync(true);
|
||||
});
|
||||
}
|
||||
}, [updatePreferences, getWalletSyncPref, setReadyForSync, readyForPrefs, hasVerifiedEmail]);
|
||||
// @endif
|
||||
|
||||
// ready for sync syncs, however after signin when hasVerifiedEmail, that syncs too.
|
||||
useEffect(() => {
|
||||
// signInSyncPref is cleared after sharedState loop.
|
||||
const syncLoopWithoutInterval = () => syncLoop(true);
|
||||
if (readyForSync && hasVerifiedEmail) {
|
||||
// In case we are syncing.
|
||||
syncLoop();
|
||||
// @if TARGET='web'
|
||||
window.addEventListener('focus', syncLoopWithoutInterval);
|
||||
// @endif
|
||||
}
|
||||
// @if TARGET='web'
|
||||
return () => {
|
||||
window.removeEventListener('focus', syncLoopWithoutInterval);
|
||||
};
|
||||
// @endif
|
||||
}, [readyForSync, hasVerifiedEmail, syncLoop]);
|
||||
|
||||
// We know someone is logging in or not when we get their user object
|
||||
// We'll use this to determine when it's time to pull preferences
|
||||
// This will no longer work if desktop users no longer get a user object from lbryinc
|
||||
useEffect(() => {
|
||||
if (user) {
|
||||
setReadyForPrefs(true);
|
||||
}
|
||||
}, [user, setReadyForPrefs]);
|
||||
|
||||
useEffect(() => {
|
||||
if (syncError && isAuthenticated && !pathname.includes(PAGES.AUTH_WALLET_PASSWORD) && !currentModal) {
|
||||
history.push(`/$/${PAGES.AUTH_WALLET_PASSWORD}?redirect=${pathname}`);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [syncError, pathname, isAuthenticated]);
|
||||
|
||||
// Keep this at the end to ensure initial setup effects are run first
|
||||
useEffect(() => {
|
||||
if (!hasSignedIn && hasVerifiedEmail) {
|
||||
signIn();
|
||||
setHasSignedIn(true);
|
||||
if (IS_WEB) setReadyForSync(true);
|
||||
}
|
||||
}, [hasVerifiedEmail, signIn, hasSignedIn]);
|
||||
|
||||
// @if TARGET='app'
|
||||
useEffect(() => {
|
||||
updatePreferences();
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
// @endif
|
||||
|
||||
useEffect(() => {
|
||||
if (hasVerifiedEmail && syncEnabled) {
|
||||
checkSync();
|
||||
analyticsTagSync();
|
||||
let syncInterval = setInterval(() => {
|
||||
checkSync();
|
||||
}, SYNC_INTERVAL);
|
||||
|
||||
return () => {
|
||||
clearInterval(syncInterval);
|
||||
};
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [hasVerifiedEmail, syncEnabled, checkSync]);
|
||||
|
||||
useEffect(() => {
|
||||
if (syncError && isAuthenticated) {
|
||||
history.push(`/$/${PAGES.AUTH}?redirect=${pathname}`);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [syncError, pathname, isAuthenticated]);
|
||||
|
||||
// @if TARGET='web'
|
||||
useDegradedPerformance(setLbryTvApiStatus);
|
||||
useDegradedPerformance(setLbryTvApiStatus, user);
|
||||
// @endif
|
||||
|
||||
// @if TARGET='web'
|
||||
@@ -273,19 +343,28 @@ function App(props: Props) {
|
||||
// This also prevents the site from loading in the un-authed state while we wait for internal-apis to return for the first time
|
||||
// It's not needed on desktop since there is no un-authed state
|
||||
if (!user) {
|
||||
return null;
|
||||
return (
|
||||
<div className="main--empty">
|
||||
<Spinner delayed />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
// @endif
|
||||
|
||||
if (syncFatalError) {
|
||||
return <SyncFatalError lbryTvApiStatus={lbryTvApiStatus} />;
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={classnames(MAIN_WRAPPER_CLASS, {
|
||||
// @if TARGET='app'
|
||||
[`${MAIN_WRAPPER_CLASS}--mac`]: IS_MAC,
|
||||
// @endif
|
||||
[`${MAIN_WRAPPER_CLASS}--scrollbar`]: useCustomScrollbar,
|
||||
})}
|
||||
ref={appRef}
|
||||
onContextMenu={IS_WEB ? undefined : e => openContextMenu(e)}
|
||||
onContextMenu={IS_WEB ? undefined : (e) => openContextMenu(e)}
|
||||
>
|
||||
{IS_WEB && lbryTvApiStatus === STATUS_DOWN ? (
|
||||
<Yrbl
|
||||
@@ -315,6 +394,7 @@ function App(props: Props) {
|
||||
{/* @if TARGET='web' */}
|
||||
<YoutubeWelcome />
|
||||
{!shouldHideNag && <OpenInAppLink uri={uri} />}
|
||||
{!shouldHideNag && <NagContinueFirstRun />}
|
||||
{(lbryTvApiStatus === STATUS_DEGRADED || lbryTvApiStatus === STATUS_FAILING) && !shouldHideNag && (
|
||||
<NagDegradedPerformance onClose={() => setLbryTvApiStatus(STATUS_OK)} />
|
||||
)}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
import { makeSelectClaimForUri, SETTINGS } from 'lbry-redux';
|
||||
import { withRouter } from 'react-router';
|
||||
import { makeSelectIsPlayerFloating, makeSelectNextUnplayedRecommended } from 'redux/selectors/content';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
|
||||
@@ -15,7 +15,7 @@ type Props = {
|
||||
nextRecommendedClaim: ?StreamClaim,
|
||||
nextRecommendedUri: string,
|
||||
isFloating: boolean,
|
||||
doSetPlayingUri: (string | null) => void,
|
||||
doSetPlayingUri: ({ uri: ?string }) => void,
|
||||
doPlayUri: string => void,
|
||||
modal: { id: string, modalProps: {} },
|
||||
};
|
||||
@@ -50,29 +50,36 @@ function AutoplayCountdown(props: Props) {
|
||||
if (!isFloating) {
|
||||
if (navigateUrl) {
|
||||
push(navigateUrl);
|
||||
doSetPlayingUri(nextRecommendedUri);
|
||||
doSetPlayingUri({ uri: nextRecommendedUri });
|
||||
doPlayUri(nextRecommendedUri);
|
||||
}
|
||||
} else {
|
||||
if (nextRecommendedUri) {
|
||||
doSetPlayingUri(nextRecommendedUri);
|
||||
doSetPlayingUri({ uri: nextRecommendedUri });
|
||||
doPlayUri(nextRecommendedUri);
|
||||
}
|
||||
}
|
||||
}, [navigateUrl, nextRecommendedUri, isFloating, doSetPlayingUri, doPlayUri]);
|
||||
}, [navigateUrl, nextRecommendedUri, isFloating, doSetPlayingUri, doPlayUri, push]);
|
||||
|
||||
function shouldPauseAutoplay() {
|
||||
const elm = document.querySelector(`.${CLASSNAME_AUTOPLAY_COUNTDOWN}`);
|
||||
return elm && elm.getBoundingClientRect().top < 0;
|
||||
}
|
||||
|
||||
// Update 'setTimerPaused'.
|
||||
React.useEffect(() => {
|
||||
// Ensure correct 'setTimerPaused' on initial render.
|
||||
setTimerPaused(shouldPauseAutoplay());
|
||||
|
||||
const handleScroll = debounce(e => {
|
||||
const elm = document.querySelector(`.${CLASSNAME_AUTOPLAY_COUNTDOWN}`);
|
||||
if (elm) {
|
||||
setTimerPaused(elm.getBoundingClientRect().top < 0);
|
||||
}
|
||||
setTimerPaused(shouldPauseAutoplay());
|
||||
}, DEBOUNCE_SCROLL_HANDLER_MS);
|
||||
|
||||
window.addEventListener('scroll', handleScroll);
|
||||
return () => window.removeEventListener('scroll', handleScroll);
|
||||
}, []);
|
||||
|
||||
// Update countdown timer.
|
||||
React.useEffect(() => {
|
||||
let interval;
|
||||
if (!timerCanceled && nextRecommendedUri) {
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
selectChannelIsBlocked,
|
||||
doToggleBlockChannel,
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectShortUrlForUri,
|
||||
makeSelectPermanentUrlForUri,
|
||||
} from 'lbry-redux';
|
||||
import { doToast } from 'redux/actions/notifications';
|
||||
import BlockButton from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
shortUrl: makeSelectShortUrlForUri(props.uri)(state),
|
||||
permanentUrl: makeSelectPermanentUrlForUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
toggleBlockChannel: doToggleBlockChannel,
|
||||
doToast,
|
||||
})(BlockButton);
|
||||
@@ -1,45 +0,0 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import React, { useRef } from 'react';
|
||||
import Button from 'component/button';
|
||||
import useHover from 'effects/use-hover';
|
||||
|
||||
type Props = {
|
||||
permanentUrl: ?string,
|
||||
shortUrl: string,
|
||||
isSubscribed: boolean,
|
||||
toggleBlockChannel: (uri: string) => void,
|
||||
channelIsBlocked: boolean,
|
||||
claimIsMine: boolean,
|
||||
doToast: ({ message: string, linkText: string, linkTarget: string }) => void,
|
||||
};
|
||||
|
||||
export default function BlockButton(props: Props) {
|
||||
const { permanentUrl, shortUrl, toggleBlockChannel, channelIsBlocked, claimIsMine, doToast } = props;
|
||||
|
||||
const blockRef = useRef();
|
||||
const isHovering = useHover(blockRef);
|
||||
const blockLabel = channelIsBlocked ? __('Blocked') : __('Block');
|
||||
const blockTitlePrefix = channelIsBlocked ? __('Unblock this channel') : __('Block this channel');
|
||||
const blockedOverride = channelIsBlocked && isHovering && __('Unblock');
|
||||
|
||||
return permanentUrl && !claimIsMine ? (
|
||||
<Button
|
||||
ref={blockRef}
|
||||
icon={ICONS.BLOCK}
|
||||
button={'alt'}
|
||||
label={blockedOverride || blockLabel}
|
||||
title={blockTitlePrefix}
|
||||
requiresAuth={IS_WEB}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
if (!channelIsBlocked) {
|
||||
doToast({ message: `Blocked ${shortUrl}`, linkText: 'Manage', linkTarget: `/${PAGES.BLOCKED}` });
|
||||
}
|
||||
|
||||
toggleBlockChannel(permanentUrl);
|
||||
}}
|
||||
/>
|
||||
) : null;
|
||||
}
|
||||
@@ -27,6 +27,7 @@ type Props = {
|
||||
iconColor?: string,
|
||||
activeClass?: string,
|
||||
innerRef: ?any,
|
||||
authSrc?: string,
|
||||
// Events
|
||||
onClick: ?(any) => any,
|
||||
onMouseEnter: ?(any) => any,
|
||||
@@ -50,6 +51,7 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
label,
|
||||
largestLabel,
|
||||
icon,
|
||||
|
||||
// This should rarely be used. Regular buttons should just use `icon`
|
||||
// `iconRight` is used for the header (home) button with the LBRY icon and external links that are displayed inline
|
||||
iconRight,
|
||||
@@ -67,6 +69,7 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
myref,
|
||||
dispatch, // <button> doesn't know what to do with dispatch
|
||||
pathname,
|
||||
authSrc,
|
||||
...otherProps
|
||||
} = props;
|
||||
|
||||
@@ -94,11 +97,15 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
<span className="button__content">
|
||||
{icon && <Icon icon={icon} iconColor={iconColor} size={iconSize} />}
|
||||
|
||||
{!largestLabel && label && <span className="button__label">{label}</span>}
|
||||
{!largestLabel && label && (
|
||||
<span dir="auto" className="button__label">
|
||||
{label}
|
||||
</span>
|
||||
)}
|
||||
|
||||
{/* largestLabel is used when a single button has two different labels based on hover state */}
|
||||
{largestLabel && (
|
||||
<div className="button__label" style={{ position: 'relative' }}>
|
||||
<div dir="auto" className="button__label" style={{ position: 'relative' }}>
|
||||
<div
|
||||
style={{
|
||||
position: 'relative',
|
||||
@@ -129,10 +136,17 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
</span>
|
||||
);
|
||||
|
||||
// TODO: replace the below with an outbound link tracker for matomo
|
||||
if (href) {
|
||||
if (href || (navigate && navigate.startsWith('http'))) {
|
||||
// TODO: replace the below with an outbound link tracker for matomo
|
||||
return (
|
||||
<a target="_blank" rel="noopener noreferrer" href={href} className={combinedClassName} onClick={onClick}>
|
||||
<a
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
href={href || navigate}
|
||||
className={combinedClassName}
|
||||
title={title}
|
||||
onClick={onClick}
|
||||
>
|
||||
{content}
|
||||
</a>
|
||||
);
|
||||
@@ -161,13 +175,19 @@ const Button = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
}
|
||||
|
||||
if (requiresAuth && !emailVerified) {
|
||||
let redirectUrl = `/$/${PAGES.AUTH}?redirect=${pathname}`;
|
||||
|
||||
if (authSrc) {
|
||||
redirectUrl += `&src=${authSrc}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<NavLink
|
||||
exact
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
to={`/$/${PAGES.AUTH}?redirect=${pathname}`}
|
||||
to={redirectUrl}
|
||||
title={title || defaultTooltip}
|
||||
disabled={disabled}
|
||||
className={combinedClassName}
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectMetadataItemForUri, makeSelectClaimForUri } from 'lbry-redux';
|
||||
import { makeSelectMetadataItemForUri, makeSelectClaimForUri, makeSelectStakedLevelForChannelUri } from 'lbry-redux';
|
||||
import ChannelAbout from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
stakedLevel: makeSelectStakedLevelForChannelUri(props.uri)(state),
|
||||
description: makeSelectMetadataItemForUri(props.uri, 'description')(state),
|
||||
website: makeSelectMetadataItemForUri(props.uri, 'website_url')(state),
|
||||
email: makeSelectMetadataItemForUri(props.uri, 'email')(state),
|
||||
languages: makeSelectMetadataItemForUri(props.uri, 'languages')(state),
|
||||
});
|
||||
|
||||
export default connect(select, null)(ChannelAbout);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import React, { Fragment } from 'react';
|
||||
import MarkdownPreview from 'component/common/markdown-preview';
|
||||
import ClaimTags from 'component/claimTags';
|
||||
@@ -6,6 +7,8 @@ import CreditAmount from 'component/common/credit-amount';
|
||||
import Button from 'component/button';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import DateTime from 'component/dateTime';
|
||||
import YoutubeBadge from 'component/youtubeBadge';
|
||||
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
|
||||
|
||||
type Props = {
|
||||
claim: ChannelClaim,
|
||||
@@ -13,6 +16,8 @@ type Props = {
|
||||
description: ?string,
|
||||
email: ?string,
|
||||
website: ?string,
|
||||
languages: Array<string>,
|
||||
stakedLevel?: number,
|
||||
};
|
||||
|
||||
const formatEmail = (email: string) => {
|
||||
@@ -25,7 +30,8 @@ const formatEmail = (email: string) => {
|
||||
};
|
||||
|
||||
function ChannelAbout(props: Props) {
|
||||
const { claim, uri, description, email, website } = props;
|
||||
const { claim, uri, description, email, website, languages, stakedLevel } = props;
|
||||
const claimId = claim && claim.claim_id;
|
||||
|
||||
return (
|
||||
<div className="card">
|
||||
@@ -35,7 +41,7 @@ function ChannelAbout(props: Props) {
|
||||
<>
|
||||
<label>{__('Description')}</label>
|
||||
<div className="media__info-text media__info-text--constrained">
|
||||
<MarkdownPreview content={description} />
|
||||
<MarkdownPreview content={description} stakedLevel={stakedLevel} />
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
@@ -43,7 +49,7 @@ function ChannelAbout(props: Props) {
|
||||
<Fragment>
|
||||
<label>{__('Contact')}</label>
|
||||
<div className="media__info-text">
|
||||
<MarkdownPreview content={formatEmail(email)} />
|
||||
<MarkdownPreview content={formatEmail(email)} simpleLinks />
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
@@ -51,7 +57,7 @@ function ChannelAbout(props: Props) {
|
||||
<Fragment>
|
||||
<label>{__('Site')}</label>
|
||||
<div className="media__info-text">
|
||||
<MarkdownPreview content={website} />
|
||||
<MarkdownPreview content={website} simpleLinks />
|
||||
</div>
|
||||
</Fragment>
|
||||
)}
|
||||
@@ -61,7 +67,17 @@ function ChannelAbout(props: Props) {
|
||||
<ClaimTags uri={uri} type="large" />
|
||||
</div>
|
||||
|
||||
<label>{__('Total Publishes')}</label>
|
||||
<label>{__('Languages')}</label>
|
||||
<div className="media__info-text">
|
||||
{/* this could use some nice 'tags' styling */}
|
||||
{languages && languages.length
|
||||
? languages.reduce((acc, lang, i) => {
|
||||
return acc + `${SUPPORTED_LANGUAGES[lang]}` + ' ';
|
||||
}, '')
|
||||
: null}
|
||||
</div>
|
||||
|
||||
<label>{__('Total Uploads')}</label>
|
||||
<div className="media__info-text">{claim.meta.claims_in_channel}</div>
|
||||
|
||||
<label>{__('Last Updated')}</label>
|
||||
@@ -69,28 +85,35 @@ function ChannelAbout(props: Props) {
|
||||
<DateTime timeAgo uri={uri} />
|
||||
</div>
|
||||
|
||||
<label>{__('URL')}</label>
|
||||
<div className="media__info-text">
|
||||
<div className="media__info-text media__info-text--constrained">{claim.canonical_url}</div>
|
||||
</div>
|
||||
|
||||
<label>{__('Claim ID')}</label>
|
||||
<div className="media__info-text">
|
||||
<div className="media__info-text media__info-text--constrained">{claim.claim_id}</div>
|
||||
</div>
|
||||
|
||||
<label>{__('Staked LBC')}</label>
|
||||
<label>{__('Staked LBRY Credits')}</label>
|
||||
<div className="media__info-text">
|
||||
<CreditAmount
|
||||
badge={false}
|
||||
amount={parseFloat(claim.amount) + parseFloat(claim.meta.support_amount)}
|
||||
precision={8}
|
||||
/>{' '}
|
||||
(
|
||||
<Button
|
||||
button="link"
|
||||
label={__('view other claims at lbry://%name%', {
|
||||
name: claim.name,
|
||||
})}
|
||||
navigate={`/$/${PAGES.TOP}?name=${claim.name}`}
|
||||
/>
|
||||
)
|
||||
{SIMPLE_SITE && (
|
||||
<Button
|
||||
button="link"
|
||||
label={__('view other claims at lbry://%name%', {
|
||||
name: claim.name,
|
||||
})}
|
||||
navigate={`/$/${PAGES.TOP}?name=${claim.name}`}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<YoutubeBadge channelClaimId={claimId} />
|
||||
</Fragment>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
14
ui/component/channelBlockButton/index.js
Normal file
14
ui/component/channelBlockButton/index.js
Normal file
@@ -0,0 +1,14 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doCommentModUnBlock, doCommentModBlock } from 'redux/actions/comments';
|
||||
import { makeSelectChannelIsBlocked, makeSelectUriIsBlockingOrUnBlocking } from 'redux/selectors/comments';
|
||||
import ChannelBlockButton from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
isBlocked: makeSelectChannelIsBlocked(props.uri)(state),
|
||||
isBlockingOrUnBlocking: makeSelectUriIsBlockingOrUnBlocking(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
doCommentModUnBlock,
|
||||
doCommentModBlock,
|
||||
})(ChannelBlockButton);
|
||||
41
ui/component/channelBlockButton/view.jsx
Normal file
41
ui/component/channelBlockButton/view.jsx
Normal file
@@ -0,0 +1,41 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
isBlocked: boolean,
|
||||
isBlockingOrUnBlocking: boolean,
|
||||
doCommentModUnBlock: (string) => void,
|
||||
doCommentModBlock: (string) => void,
|
||||
};
|
||||
|
||||
function ChannelBlockButton(props: Props) {
|
||||
const { uri, doCommentModUnBlock, doCommentModBlock, isBlocked, isBlockingOrUnBlocking } = props;
|
||||
|
||||
function handleClick() {
|
||||
if (isBlocked) {
|
||||
doCommentModUnBlock(uri);
|
||||
} else {
|
||||
doCommentModBlock(uri);
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<Button
|
||||
button={isBlocked ? 'alt' : 'secondary'}
|
||||
label={
|
||||
isBlocked
|
||||
? isBlockingOrUnBlocking
|
||||
? __('Unblocking...')
|
||||
: __('Unblock')
|
||||
: isBlockingOrUnBlocking
|
||||
? __('Blocking...')
|
||||
: __('Block')
|
||||
}
|
||||
onClick={handleClick}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelBlockButton;
|
||||
@@ -1,4 +1,3 @@
|
||||
import * as SETTINGS from 'constants/settings';
|
||||
import { connect } from 'react-redux';
|
||||
import { PAGE_SIZE } from 'constants/claim';
|
||||
import {
|
||||
@@ -6,9 +5,11 @@ import {
|
||||
makeSelectFetchingChannelClaims,
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectTotalPagesInChannelSearch,
|
||||
selectChannelIsBlocked,
|
||||
makeSelectClaimForUri,
|
||||
doResolveUris,
|
||||
SETTINGS,
|
||||
} from 'lbry-redux';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { withRouter } from 'react-router';
|
||||
import { selectUserVerifiedEmail } from 'redux/selectors/user';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
@@ -24,11 +25,16 @@ const select = (state, props) => {
|
||||
fetching: makeSelectFetchingChannelClaims(props.uri)(state),
|
||||
totalPages: makeSelectTotalPagesInChannelSearch(props.uri, PAGE_SIZE)(state),
|
||||
channelIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
channelIsBlocked: selectChannelIsBlocked(props.uri)(state),
|
||||
channelIsBlocked: makeSelectChannelIsMuted(props.uri)(state),
|
||||
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
|
||||
isAuthenticated: selectUserVerifiedEmail(state),
|
||||
showMature: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
tileLayout: makeSelectClientSetting(SETTINGS.TILE_LAYOUT)(state),
|
||||
};
|
||||
};
|
||||
|
||||
export default withRouter(connect(select)(ChannelPage));
|
||||
const perform = (dispatch) => ({
|
||||
doResolveUris: (uris, returnCachedUris) => dispatch(doResolveUris(uris, returnCachedUris)),
|
||||
});
|
||||
|
||||
export default withRouter(connect(select, perform)(ChannelPage));
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
// @flow
|
||||
import { SHOW_ADS } from 'config';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React, { Fragment } from 'react';
|
||||
@@ -10,8 +11,7 @@ import Ads from 'web/component/ads';
|
||||
import Icon from 'component/common/icon';
|
||||
import { Form, FormField } from 'component/common/form';
|
||||
import { DEBOUNCE_WAIT_DURATION_MS } from 'constants/search';
|
||||
|
||||
const LIGHTHOUSE_URL = 'https://lighthouse.lbry.com/search';
|
||||
import { lighthouse } from 'redux/actions/search';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -28,6 +28,9 @@ type Props = {
|
||||
claim: ?Claim,
|
||||
isAuthenticated: boolean,
|
||||
showMature: boolean,
|
||||
tileLayout: boolean,
|
||||
viewHiddenChannels: boolean,
|
||||
doResolveUris: (Array<string>, boolean) => void,
|
||||
};
|
||||
|
||||
function ChannelContent(props: Props) {
|
||||
@@ -42,6 +45,9 @@ function ChannelContent(props: Props) {
|
||||
defaultPageSize = CS.PAGE_SIZE,
|
||||
defaultInfiniteScroll = true,
|
||||
showMature,
|
||||
tileLayout,
|
||||
viewHiddenChannels,
|
||||
doResolveUris,
|
||||
} = props;
|
||||
const claimsInChannel = (claim && claim.meta.claims_in_channel) || 0;
|
||||
const [searchQuery, setSearchQuery] = React.useState('');
|
||||
@@ -57,31 +63,33 @@ function ChannelContent(props: Props) {
|
||||
setSearchQuery(value);
|
||||
}
|
||||
|
||||
function getResults(fetchUrl) {
|
||||
fetch(fetchUrl)
|
||||
.then(res => res.json())
|
||||
.then(results => {
|
||||
const urls = results.map(({ name, claimId }) => {
|
||||
return `lbry://${name}#${claimId}`;
|
||||
});
|
||||
setSearchResults(urls);
|
||||
})
|
||||
.catch(() => {
|
||||
setSearchResults(null);
|
||||
});
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
const timer = setTimeout(() => {
|
||||
if (searchQuery === '' || !claimId) {
|
||||
// In order to display original search results, search results must be set to null. A query of '' should display original results.
|
||||
return setSearchResults(null);
|
||||
} else {
|
||||
getResults(
|
||||
`${LIGHTHOUSE_URL}?s=${encodeURIComponent(searchQuery)}&channel_id=${encodeURIComponent(claimId)}${
|
||||
!showMature ? '&nsfw=false' : ''
|
||||
}`
|
||||
);
|
||||
lighthouse
|
||||
.search(
|
||||
`s=${encodeURIComponent(searchQuery)}&channel_id=${encodeURIComponent(claimId)}${
|
||||
!showMature ? '&nsfw=false&size=25&from=0' : ''
|
||||
}`
|
||||
)
|
||||
.then((results) => {
|
||||
const urls = results.map(({ name, claimId }) => {
|
||||
return `lbry://${name}#${claimId}`;
|
||||
});
|
||||
|
||||
// Batch-resolve the urls before calling 'setSearchResults', as the
|
||||
// latter will immediately cause the tiles to resolve, ending up
|
||||
// calling doResolveUri one by one before the batched one.
|
||||
doResolveUris(urls, true);
|
||||
|
||||
setSearchResults(urls);
|
||||
})
|
||||
.catch(() => {
|
||||
setSearchResults(null);
|
||||
});
|
||||
}
|
||||
}, DEBOUNCE_WAIT_DURATION_MS);
|
||||
return () => clearTimeout(timer);
|
||||
@@ -121,17 +129,21 @@ function ChannelContent(props: Props) {
|
||||
|
||||
{claim && claimsInChannel > 0 ? (
|
||||
<ClaimListDiscover
|
||||
showHiddenByUser={viewHiddenChannels}
|
||||
forceShowReposts
|
||||
tileLayout={tileLayout}
|
||||
uris={searchResults}
|
||||
channelIds={[claim.claim_id]}
|
||||
feeAmount={CS.FEE_AMOUNT_ANY}
|
||||
defaultOrderBy={CS.ORDER_BY_NEW}
|
||||
pageSize={defaultPageSize}
|
||||
infiniteScroll={defaultInfiniteScroll}
|
||||
injectedItem={!isAuthenticated && IS_WEB && <Ads type="video" />}
|
||||
injectedItem={SHOW_ADS && !isAuthenticated && IS_WEB && <Ads type="video" />}
|
||||
meta={
|
||||
<Form onSubmit={() => {}} className="wunderbar--inline">
|
||||
<Icon icon={ICONS.SEARCH} />
|
||||
<FormField
|
||||
className="wunderbar__input"
|
||||
className="wunderbar__input--inline"
|
||||
value={searchQuery}
|
||||
onChange={handleInputChange}
|
||||
type="text"
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ChannelCreate from './view';
|
||||
import { selectBalance, doCreateChannel, selectCreatingChannel, selectCreateChannelError } from 'lbry-redux';
|
||||
|
||||
const select = state => ({
|
||||
balance: selectBalance(state),
|
||||
creatingChannel: selectCreatingChannel(state),
|
||||
createChannelError: selectCreateChannelError(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
createChannel: (name, amount) => dispatch(doCreateChannel(name, amount)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ChannelCreate);
|
||||
@@ -1,141 +0,0 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import { isNameValid } from 'lbry-redux';
|
||||
import { Form, FormField } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import analytics from 'analytics';
|
||||
|
||||
import { MINIMUM_PUBLISH_BID, INVALID_NAME_ERROR } from 'constants/claim';
|
||||
|
||||
type Props = {
|
||||
balance: number,
|
||||
createChannel: (string, number) => Promise<any>,
|
||||
onSuccess?: ({}) => void,
|
||||
creatingChannel: boolean,
|
||||
createChannelError: ?string,
|
||||
};
|
||||
|
||||
type State = {
|
||||
newChannelName: string,
|
||||
newChannelBid: number,
|
||||
newChannelNameError: string,
|
||||
newChannelBidError: string,
|
||||
};
|
||||
|
||||
class ChannelCreate extends React.PureComponent<Props, State> {
|
||||
constructor(props: Props) {
|
||||
super(props);
|
||||
|
||||
this.state = {
|
||||
newChannelName: '',
|
||||
newChannelBid: 0.001,
|
||||
newChannelNameError: '',
|
||||
newChannelBidError: '',
|
||||
};
|
||||
|
||||
(this: any).handleNewChannelNameChange = this.handleNewChannelNameChange.bind(this);
|
||||
(this: any).handleNewChannelBidChange = this.handleNewChannelBidChange.bind(this);
|
||||
(this: any).handleCreateChannel = this.handleCreateChannel.bind(this);
|
||||
}
|
||||
|
||||
handleNewChannelNameChange(event: SyntheticInputEvent<*>) {
|
||||
let newChannelName = event.target.value;
|
||||
|
||||
if (newChannelName.startsWith('@')) {
|
||||
newChannelName = newChannelName.slice(1);
|
||||
}
|
||||
|
||||
let newChannelNameError;
|
||||
if (newChannelName.length > 0 && !isNameValid(newChannelName, false)) {
|
||||
newChannelNameError = INVALID_NAME_ERROR;
|
||||
}
|
||||
|
||||
this.setState({
|
||||
newChannelNameError,
|
||||
newChannelName,
|
||||
});
|
||||
}
|
||||
|
||||
handleNewChannelBidChange(newChannelBid: number) {
|
||||
const { balance } = this.props;
|
||||
let newChannelBidError;
|
||||
if (newChannelBid === 0) {
|
||||
newChannelBidError = __('Your deposit cannot be 0');
|
||||
} else if (newChannelBid === balance) {
|
||||
newChannelBidError = __('Please decrease your deposit to account for transaction fees');
|
||||
} else if (newChannelBid > balance) {
|
||||
newChannelBidError = __('Deposit cannot be higher than your balance');
|
||||
} else if (newChannelBid < MINIMUM_PUBLISH_BID) {
|
||||
newChannelBidError = __('Your deposit must be higher');
|
||||
}
|
||||
|
||||
this.setState({
|
||||
newChannelBid,
|
||||
newChannelBidError,
|
||||
});
|
||||
}
|
||||
|
||||
handleCreateChannel() {
|
||||
const { createChannel, onSuccess } = this.props;
|
||||
const { newChannelBid, newChannelName } = this.state;
|
||||
|
||||
const channelName = `@${newChannelName.trim()}`;
|
||||
|
||||
const success = channelClaim => {
|
||||
analytics.apiLogPublish(channelClaim);
|
||||
|
||||
if (onSuccess !== undefined) {
|
||||
onSuccess({ ...this.props, ...this.state });
|
||||
}
|
||||
};
|
||||
|
||||
createChannel(channelName, newChannelBid).then(success);
|
||||
}
|
||||
|
||||
render() {
|
||||
const { newChannelName, newChannelNameError, newChannelBid, newChannelBidError } = this.state;
|
||||
const { creatingChannel, createChannelError } = this.props;
|
||||
|
||||
return (
|
||||
<Form onSubmit={this.handleCreateChannel}>
|
||||
{createChannelError && <div className="error__text">{createChannelError}</div>}
|
||||
<div>
|
||||
<FormField
|
||||
label={__('Name')}
|
||||
name="channel-input"
|
||||
type="text"
|
||||
placeholder={__('ChannelName')}
|
||||
error={newChannelNameError}
|
||||
value={newChannelName}
|
||||
onChange={this.handleNewChannelNameChange}
|
||||
/>
|
||||
<FormField
|
||||
className="form-field--price-amount"
|
||||
name="channel-deposit"
|
||||
label={__('Deposit (LBC)')}
|
||||
step="any"
|
||||
min="0"
|
||||
type="number"
|
||||
helper={__('This LBC remains yours. It is a deposit to reserve the name and can be undone at any time.')}
|
||||
error={newChannelBidError}
|
||||
value={newChannelBid}
|
||||
onChange={event => this.handleNewChannelBidChange(parseFloat(event.target.value))}
|
||||
onWheel={e => e.stopPropagation()}
|
||||
/>
|
||||
<div className="section__actions">
|
||||
<Button
|
||||
type="submit"
|
||||
button="primary"
|
||||
label={!creatingChannel ? __('Create channel') : __('Creating channel...')}
|
||||
disabled={
|
||||
!newChannelName || !newChannelBid || creatingChannel || newChannelNameError || newChannelBidError
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</Form>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
export default ChannelCreate;
|
||||
@@ -1,7 +1,19 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { withRouter } from 'react-router';
|
||||
import { makeSelectCommentForCommentId } from 'redux/selectors/comments';
|
||||
import { DISABLE_COMMENTS_TAG } from 'constants/tags';
|
||||
import ChannelDiscussion from './view';
|
||||
import { makeSelectTagInClaimOrChannelForUri } from 'lbry-redux';
|
||||
|
||||
export default connect(
|
||||
null,
|
||||
null
|
||||
)(ChannelDiscussion);
|
||||
const select = (state, props) => {
|
||||
const { search } = props.location;
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const linkedCommentId = urlParams.get('lc');
|
||||
|
||||
return {
|
||||
linkedComment: makeSelectCommentForCommentId(linkedCommentId)(state),
|
||||
commentsDisabled: makeSelectTagInClaimOrChannelForUri(props.uri, DISABLE_COMMENTS_TAG)(state),
|
||||
};
|
||||
};
|
||||
|
||||
export default withRouter(connect(select)(ChannelDiscussion));
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import CommentsList from 'component/commentsList';
|
||||
import CommentCreate from 'component/commentCreate';
|
||||
import Empty from 'component/common/empty';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
linkedComment: ?any,
|
||||
commentsDisabled: boolean,
|
||||
};
|
||||
|
||||
function ChannelDiscussion(props: Props) {
|
||||
const uri = props.uri;
|
||||
const { uri, linkedComment, commentsDisabled } = props;
|
||||
|
||||
if (commentsDisabled) {
|
||||
return <Empty text={__('This channel has disabled comments on their page.')} />;
|
||||
}
|
||||
return (
|
||||
<div>
|
||||
<section className="section">
|
||||
<CommentCreate uri={uri} />
|
||||
</section>
|
||||
<section className="section">
|
||||
<CommentsList uri={uri} />
|
||||
</section>
|
||||
</div>
|
||||
<section className="section">
|
||||
<CommentsList uri={uri} linkedComment={linkedComment} />
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
doClearChannelErrors,
|
||||
} from 'lbry-redux';
|
||||
import { doOpenModal } from 'redux/actions/app';
|
||||
|
||||
import { doUpdateBlockListForPublishedChannel } from 'redux/actions/comments';
|
||||
import ChannelPage from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
@@ -38,12 +38,16 @@ const select = (state, props) => ({
|
||||
balance: selectBalance(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
const perform = (dispatch) => ({
|
||||
openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
|
||||
updateChannel: params => dispatch(doUpdateChannel(params)),
|
||||
createChannel: params => {
|
||||
updateChannel: (params) => dispatch(doUpdateChannel(params)),
|
||||
createChannel: (params) => {
|
||||
const { name, amount, ...optionalParams } = params;
|
||||
return dispatch(doCreateChannel('@' + name, amount, optionalParams));
|
||||
return dispatch(
|
||||
doCreateChannel('@' + name, amount, optionalParams, (channelClaim) => {
|
||||
dispatch(doUpdateBlockListForPublishedChannel(channelClaim));
|
||||
})
|
||||
);
|
||||
},
|
||||
clearChannelErrors: () => dispatch(doClearChannelErrors()),
|
||||
});
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import * as MODALS from 'constants/modal_types';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { FormField } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import TagsSearch from 'component/tagsSearch';
|
||||
@@ -16,6 +17,12 @@ import { Tabs, TabList, Tab, TabPanels, TabPanel } from 'component/common/tabs';
|
||||
import Card from 'component/common/card';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import analytics from 'analytics';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import SUPPORTED_LANGUAGES from 'constants/supported_languages';
|
||||
import WalletSpendableBalanceHelp from 'component/walletSpendableBalanceHelp';
|
||||
|
||||
const LANG_NONE = 'none';
|
||||
|
||||
const MAX_TAG_SELECT = 5;
|
||||
|
||||
type Props = {
|
||||
@@ -32,19 +39,20 @@ type Props = {
|
||||
tags: Array<string>,
|
||||
locations: Array<string>,
|
||||
languages: Array<string>,
|
||||
updateChannel: any => Promise<any>,
|
||||
updateChannel: (any) => Promise<any>,
|
||||
updatingChannel: boolean,
|
||||
updateError: string,
|
||||
createChannel: any => Promise<any>,
|
||||
createChannel: (any) => Promise<any>,
|
||||
createError: string,
|
||||
creatingChannel: boolean,
|
||||
clearChannelErrors: () => void,
|
||||
onDone: () => void,
|
||||
openModal: (
|
||||
id: string,
|
||||
{ onUpdate: string => void, assetName: string, helpText: string, currentValue: string, title: string }
|
||||
{ onUpdate: (string) => void, assetName: string, helpText: string, currentValue: string, title: string }
|
||||
) => void,
|
||||
uri: string,
|
||||
disabled: boolean,
|
||||
};
|
||||
|
||||
function ChannelForm(props: Props) {
|
||||
@@ -60,7 +68,7 @@ function ChannelForm(props: Props) {
|
||||
coverUrl,
|
||||
tags,
|
||||
locations,
|
||||
languages,
|
||||
languages = [],
|
||||
onDone,
|
||||
updateChannel,
|
||||
updateError,
|
||||
@@ -70,15 +78,20 @@ function ChannelForm(props: Props) {
|
||||
createError,
|
||||
clearChannelErrors,
|
||||
openModal,
|
||||
disabled,
|
||||
} = props;
|
||||
const [nameError, setNameError] = React.useState(undefined);
|
||||
const [bidError, setBidError] = React.useState('');
|
||||
const [coverError, setCoverError] = React.useState(false);
|
||||
const { claim_id: claimId } = claim || {};
|
||||
const [params, setParams]: [any, (any) => void] = React.useState(getChannelParams());
|
||||
const { channelName } = parseURI(uri);
|
||||
const name = params.name;
|
||||
const isNewChannel = !uri;
|
||||
const { replace } = useHistory();
|
||||
const languageParam = params.languages;
|
||||
const primaryLanguage = Array.isArray(languageParam) && languageParam.length && languageParam[0];
|
||||
const secondaryLanguage = Array.isArray(languageParam) && languageParam.length >= 2 && languageParam[1];
|
||||
|
||||
function getChannelParams() {
|
||||
// fill this in with sdk data
|
||||
@@ -105,7 +118,7 @@ function ChannelForm(props: Props) {
|
||||
languages: languages || [],
|
||||
locations: locations || [],
|
||||
tags: tags
|
||||
? tags.map(tag => {
|
||||
? tags.map((tag) => {
|
||||
return { name: tag };
|
||||
})
|
||||
: [],
|
||||
@@ -127,7 +140,9 @@ function ChannelForm(props: Props) {
|
||||
if (bid <= 0.0 || isNaN(bid)) {
|
||||
setBidError(__('Deposit cannot be 0'));
|
||||
} else if (totalAvailableBidAmount < bid) {
|
||||
setBidError(__('Deposit cannot be higher than your balance'));
|
||||
setBidError(
|
||||
__('Deposit cannot be higher than your available balance: %balance%', { balance: totalAvailableBidAmount })
|
||||
);
|
||||
} else if (totalAvailableBidAmount - bid < ESTIMATED_FEE) {
|
||||
setBidError(__('Please decrease your deposit to account for transaction fees'));
|
||||
} else if (bid < MINIMUM_PUBLISH_BID) {
|
||||
@@ -137,6 +152,25 @@ function ChannelForm(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
function handleLanguageChange(index, code) {
|
||||
let langs = [...languageParam];
|
||||
if (index === 0) {
|
||||
if (code === LANG_NONE) {
|
||||
// clear all
|
||||
langs = [];
|
||||
} else {
|
||||
langs[0] = code;
|
||||
}
|
||||
} else {
|
||||
if (code === LANG_NONE || code === langs[0]) {
|
||||
langs.splice(1, 1);
|
||||
} else {
|
||||
langs[index] = code;
|
||||
}
|
||||
}
|
||||
setParams({ ...params, languages: langs });
|
||||
}
|
||||
|
||||
function handleThumbnailChange(thumbnailUrl: string) {
|
||||
setParams({ ...params, thumbnailUrl });
|
||||
}
|
||||
@@ -147,13 +181,13 @@ function ChannelForm(props: Props) {
|
||||
|
||||
function handleSubmit() {
|
||||
if (uri) {
|
||||
updateChannel(params).then(success => {
|
||||
updateChannel(params).then((success) => {
|
||||
if (success) {
|
||||
onDone();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
createChannel(params).then(success => {
|
||||
createChannel(params).then((success) => {
|
||||
if (success) {
|
||||
analytics.apiLogPublish(success);
|
||||
onDone();
|
||||
@@ -162,6 +196,12 @@ function ChannelForm(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
const LIMIT_ERR_PARTIAL_MSG = 'bad-txns-claimscriptsize-toolarge (code 16)';
|
||||
let errorMsg = updateError || createError;
|
||||
if (errorMsg && errorMsg.includes(LIMIT_ERR_PARTIAL_MSG)) {
|
||||
errorMsg = __('Transaction limit reached. Try reducing the Description length.');
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
let nameError;
|
||||
if (!name && name !== undefined) {
|
||||
@@ -180,7 +220,7 @@ function ChannelForm(props: Props) {
|
||||
// TODO clear and bail after submit
|
||||
return (
|
||||
<>
|
||||
<div className="main--contained">
|
||||
<div className={classnames('main--contained', { 'card--disabled': disabled })}>
|
||||
<header className="channel-cover">
|
||||
<div className="channel__quick-actions">
|
||||
<Button
|
||||
@@ -188,7 +228,7 @@ function ChannelForm(props: Props) {
|
||||
title={__('Cover')}
|
||||
onClick={() =>
|
||||
openModal(MODALS.IMAGE_UPLOAD, {
|
||||
onUpdate: coverUrl => handleCoverChange(coverUrl),
|
||||
onUpdate: (coverUrl) => handleCoverChange(coverUrl),
|
||||
title: __('Edit Cover Image'),
|
||||
helpText: __('(6.25:1)'),
|
||||
assetName: __('Cover Image'),
|
||||
@@ -199,7 +239,12 @@ function ChannelForm(props: Props) {
|
||||
iconSize={18}
|
||||
/>
|
||||
</div>
|
||||
{params.coverUrl && <img className="channel-cover__custom" src={params.coverUrl} />}
|
||||
{params.coverUrl &&
|
||||
(coverError ? (
|
||||
<div className="channel-cover__custom--waiting">{__('This will be visible in a few minutes.')}</div>
|
||||
) : (
|
||||
<img className="channel-cover__custom" src={params.coverUrl} onError={() => setCoverError(true)} />
|
||||
))}
|
||||
<div className="channel__primary-info">
|
||||
<div className="channel__edit-thumb">
|
||||
<Button
|
||||
@@ -207,7 +252,7 @@ function ChannelForm(props: Props) {
|
||||
title={__('Edit')}
|
||||
onClick={() =>
|
||||
openModal(MODALS.IMAGE_UPLOAD, {
|
||||
onUpdate: v => handleThumbnailChange(v),
|
||||
onUpdate: (v) => handleThumbnailChange(v),
|
||||
title: __('Edit Thumbnail Image'),
|
||||
helpText: __('(1:1)'),
|
||||
assetName: __('Thumbnail'),
|
||||
@@ -223,6 +268,7 @@ function ChannelForm(props: Props) {
|
||||
uri={uri}
|
||||
thumbnailPreview={params.thumbnailUrl}
|
||||
allowGifs
|
||||
showDelayedMessage
|
||||
/>
|
||||
<h1 className="channel__title">
|
||||
{params.title || (channelName && '@' + channelName) || (params.name && '@' + params.name)}
|
||||
@@ -234,7 +280,7 @@ function ChannelForm(props: Props) {
|
||||
<Tabs>
|
||||
<TabList className="tabs__list--channel-page">
|
||||
<Tab>{__('General')}</Tab>
|
||||
<Tab>{__('LBC Details')}</Tab>
|
||||
<Tab>{__('Credit Details')}</Tab>
|
||||
<Tab>{__('Tags')}</Tab>
|
||||
<Tab>{__('Other')}</Tab>
|
||||
</TabList>
|
||||
@@ -257,7 +303,7 @@ function ChannelForm(props: Props) {
|
||||
value={params.name || channelName}
|
||||
error={nameError}
|
||||
disabled={!isNewChannel}
|
||||
onChange={e => setParams({ ...params, name: e.target.value })}
|
||||
onChange={(e) => setParams({ ...params, name: e.target.value })}
|
||||
/>
|
||||
</fieldset-group>
|
||||
{!isNewChannel && <span className="form-field__help">{__('This field cannot be changed.')}</span>}
|
||||
@@ -268,7 +314,7 @@ function ChannelForm(props: Props) {
|
||||
label={__('Title')}
|
||||
placeholder={__('My Awesome Channel')}
|
||||
value={params.title}
|
||||
onChange={e => setParams({ ...params, title: e.target.value })}
|
||||
onChange={(e) => setParams({ ...params, title: e.target.value })}
|
||||
/>
|
||||
<FormField
|
||||
type="markdown"
|
||||
@@ -276,7 +322,7 @@ function ChannelForm(props: Props) {
|
||||
label={__('Description')}
|
||||
placeholder={__('Description of your content')}
|
||||
value={params.description}
|
||||
onChange={text => setParams({ ...params, description: text })}
|
||||
onChange={(text) => setParams({ ...params, description: text })}
|
||||
textAreaMaxLength={FF_MAX_CHARS_IN_DESCRIPTION}
|
||||
/>
|
||||
</>
|
||||
@@ -291,15 +337,19 @@ function ChannelForm(props: Props) {
|
||||
type="number"
|
||||
name="content_bid2"
|
||||
step="any"
|
||||
label={__('Deposit (LBC)')}
|
||||
postfix="LBC"
|
||||
label={<LbcSymbol postfix={__('Deposit')} size={14} />}
|
||||
value={params.amount}
|
||||
error={bidError}
|
||||
min="0.0"
|
||||
disabled={false}
|
||||
onChange={event => handleBidChange(parseFloat(event.target.value))}
|
||||
onChange={(event) => handleBidChange(parseFloat(event.target.value))}
|
||||
placeholder={0.1}
|
||||
helper={__('Increasing your deposit can help your channel be discovered more easily.')}
|
||||
helper={
|
||||
<>
|
||||
{__('Increasing your deposit can help your channel be discovered more easily.')}
|
||||
<WalletSpendableBalanceHelp inline />
|
||||
</>
|
||||
}
|
||||
/>
|
||||
}
|
||||
/>
|
||||
@@ -313,17 +363,17 @@ function ChannelForm(props: Props) {
|
||||
limitSelect={MAX_TAG_SELECT}
|
||||
tagsPassedIn={params.tags || []}
|
||||
label={__('Selected Tags')}
|
||||
onRemove={clickedTag => {
|
||||
const newTags = params.tags.slice().filter(tag => tag.name !== clickedTag.name);
|
||||
onRemove={(clickedTag) => {
|
||||
const newTags = params.tags.slice().filter((tag) => tag.name !== clickedTag.name);
|
||||
setParams({ ...params, tags: newTags });
|
||||
}}
|
||||
onSelect={newTags => {
|
||||
newTags.forEach(newTag => {
|
||||
if (!params.tags.map(savedTag => savedTag.name).includes(newTag.name)) {
|
||||
onSelect={(newTags) => {
|
||||
newTags.forEach((newTag) => {
|
||||
if (!params.tags.map((savedTag) => savedTag.name).includes(newTag.name)) {
|
||||
setParams({ ...params, tags: [...params.tags, newTag] });
|
||||
} else {
|
||||
// If it already exists and the user types it in, remove it
|
||||
setParams({ ...params, tags: params.tags.filter(tag => tag.name !== newTag.name) });
|
||||
setParams({ ...params, tags: params.tags.filter((tag) => tag.name !== newTag.name) });
|
||||
}
|
||||
});
|
||||
}}
|
||||
@@ -342,7 +392,7 @@ function ChannelForm(props: Props) {
|
||||
placeholder={__('aprettygoodsite.com')}
|
||||
disabled={false}
|
||||
value={params.website}
|
||||
onChange={e => setParams({ ...params, website: e.target.value })}
|
||||
onChange={(e) => setParams({ ...params, website: e.target.value })}
|
||||
/>
|
||||
<FormField
|
||||
type="text"
|
||||
@@ -351,8 +401,45 @@ function ChannelForm(props: Props) {
|
||||
placeholder={__('yourstruly@example.com')}
|
||||
disabled={false}
|
||||
value={params.email}
|
||||
onChange={e => setParams({ ...params, email: e.target.value })}
|
||||
onChange={(e) => setParams({ ...params, email: e.target.value })}
|
||||
/>
|
||||
<FormField
|
||||
name="language_select"
|
||||
type="select"
|
||||
label={__('Primary Language')}
|
||||
onChange={(event) => handleLanguageChange(0, event.target.value)}
|
||||
value={primaryLanguage}
|
||||
helper={__('Your main content language')}
|
||||
>
|
||||
<option key={'pri-langNone'} value={LANG_NONE}>
|
||||
{__('None selected')}
|
||||
</option>
|
||||
{Object.keys(SUPPORTED_LANGUAGES).map((language) => (
|
||||
<option key={language} value={language}>
|
||||
{SUPPORTED_LANGUAGES[language]}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
<FormField
|
||||
name="language_select2"
|
||||
type="select"
|
||||
label={__('Secondary Language')}
|
||||
onChange={(event) => handleLanguageChange(1, event.target.value)}
|
||||
value={secondaryLanguage}
|
||||
disabled={!languageParam[0]}
|
||||
helper={__('Your other content language')}
|
||||
>
|
||||
<option key={'sec-langNone'} value={LANG_NONE}>
|
||||
{__('None selected')}
|
||||
</option>
|
||||
{Object.keys(SUPPORTED_LANGUAGES)
|
||||
.filter((lang) => lang !== languageParam[0])
|
||||
.map((language) => (
|
||||
<option key={language} value={language}>
|
||||
{SUPPORTED_LANGUAGES[language]}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
@@ -375,8 +462,8 @@ function ChannelForm(props: Props) {
|
||||
/>
|
||||
<Button button="link" label={__('Cancel')} onClick={onDone} />
|
||||
</div>
|
||||
{updateError || createError ? (
|
||||
<ErrorText>{updateError || createError}</ErrorText>
|
||||
{errorMsg ? (
|
||||
<ErrorText>{errorMsg}</ErrorText>
|
||||
) : (
|
||||
<p className="help">
|
||||
{__('After submitting, it will take a few minutes for your changes to be live for everyone.')}
|
||||
|
||||
@@ -1,40 +0,0 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
doResolveUri,
|
||||
selectPublishFormValues,
|
||||
selectIsStillEditing,
|
||||
selectMyClaimForUri,
|
||||
selectIsResolvingPublishUris,
|
||||
selectTakeOverAmount,
|
||||
doResetThumbnailStatus,
|
||||
doClearPublish,
|
||||
doUpdatePublishForm,
|
||||
doPrepareEdit,
|
||||
} from 'lbry-redux';
|
||||
import { doPublishDesktop } from 'redux/actions/publish';
|
||||
import { selectUnclaimedRewardValue } from 'redux/selectors/rewards';
|
||||
import ChannelForm from './view';
|
||||
|
||||
const select = state => ({
|
||||
...selectPublishFormValues(state),
|
||||
// The winning claim for a short lbry uri
|
||||
amountNeededForTakeover: selectTakeOverAmount(state),
|
||||
// My previously published claims under this short lbry uri
|
||||
myClaimForUri: selectMyClaimForUri(state),
|
||||
// If I clicked the "edit" button, have I changed the uri?
|
||||
// Need this to make it easier to find the source on previously published content
|
||||
isStillEditing: selectIsStillEditing(state),
|
||||
isResolvingUri: selectIsResolvingPublishUris(state),
|
||||
totalRewardValue: selectUnclaimedRewardValue(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
updatePublishForm: value => dispatch(doUpdatePublishForm(value)),
|
||||
clearPublish: () => dispatch(doClearPublish()),
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
publish: filePath => dispatch(doPublishDesktop(filePath)),
|
||||
prepareEdit: (claim, uri) => dispatch(doPrepareEdit(claim, uri)),
|
||||
resetThumbnailStatus: () => dispatch(doResetThumbnailStatus()),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ChannelForm);
|
||||
@@ -1,63 +0,0 @@
|
||||
// @flow
|
||||
|
||||
import React, { useEffect, Fragment } from 'react';
|
||||
import { CHANNEL_NEW } from 'constants/claim';
|
||||
import { buildURI, isURIValid } from 'lbry-redux';
|
||||
import ChannelCreate from 'component/channelCreate';
|
||||
import Card from 'component/common/card';
|
||||
import * as ICONS from 'constants/icons';
|
||||
|
||||
type Props = {
|
||||
name: ?string,
|
||||
channel: string,
|
||||
resolveUri: string => void,
|
||||
updatePublishForm: any => void,
|
||||
onSuccess: () => void,
|
||||
};
|
||||
|
||||
function ChannelForm(props: Props) {
|
||||
const { name, channel, resolveUri, updatePublishForm, onSuccess } = props;
|
||||
|
||||
// Every time the channel or name changes, resolve the uris to find winning bid amounts
|
||||
useEffect(() => {
|
||||
// If they are midway through a channel creation, treat it as anonymous until it completes
|
||||
const channelName = channel === CHANNEL_NEW ? '' : channel;
|
||||
|
||||
// We are only going to store the full uri, but we need to resolve the uri with and without the channel name
|
||||
let uri;
|
||||
try {
|
||||
uri = name && buildURI({ streamName: name, channelName });
|
||||
} catch (e) {}
|
||||
|
||||
if (channelName && name) {
|
||||
// resolve without the channel name so we know the winning bid for it
|
||||
try {
|
||||
const uriLessChannel = buildURI({ streamName: name });
|
||||
resolveUri(uriLessChannel);
|
||||
} catch (e) {}
|
||||
}
|
||||
|
||||
const isValid = isURIValid(uri);
|
||||
if (uri && isValid) {
|
||||
resolveUri(uri);
|
||||
updatePublishForm({ uri });
|
||||
}
|
||||
}, [name, channel, resolveUri, updatePublishForm]);
|
||||
|
||||
return (
|
||||
<Fragment>
|
||||
<Card
|
||||
icon={ICONS.CHANNEL}
|
||||
title="Create a New Channel"
|
||||
subtitle="This is a username or handle that your content can be found under."
|
||||
actions={
|
||||
<React.Fragment>
|
||||
<ChannelCreate onSuccess={onSuccess} onChannelChange={channel => updatePublishForm({ channel })} />
|
||||
</React.Fragment>
|
||||
}
|
||||
/>
|
||||
</Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelForm;
|
||||
12
ui/component/channelMuteButton/index.js
Normal file
12
ui/component/channelMuteButton/index.js
Normal file
@@ -0,0 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doToggleMuteChannel } from 'redux/actions/blocked';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import ChannelMuteButton from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
isMuted: makeSelectChannelIsMuted(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
doToggleMuteChannel,
|
||||
})(ChannelMuteButton);
|
||||
24
ui/component/channelMuteButton/view.jsx
Normal file
24
ui/component/channelMuteButton/view.jsx
Normal file
@@ -0,0 +1,24 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import Button from 'component/button';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
isMuted: boolean,
|
||||
channelClaim: ?ChannelClaim,
|
||||
doToggleMuteChannel: (string) => void,
|
||||
};
|
||||
|
||||
function ChannelBlockButton(props: Props) {
|
||||
const { uri, doToggleMuteChannel, isMuted } = props;
|
||||
|
||||
return (
|
||||
<Button
|
||||
button={isMuted ? 'alt' : 'secondary'}
|
||||
label={isMuted ? __('Unmute') : __('Mute')}
|
||||
onClick={() => doToggleMuteChannel(uri)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelBlockButton;
|
||||
@@ -1,9 +1,16 @@
|
||||
import { connect } from 'react-redux';
|
||||
import SelectChannel from './view';
|
||||
import { selectMyChannelClaims } from 'lbry-redux';
|
||||
import { selectActiveChannelClaim, selectIncognito } from 'redux/selectors/app';
|
||||
import { doSetActiveChannel, doSetIncognito } from 'redux/actions/app';
|
||||
import SelectChannel from './view';
|
||||
|
||||
const select = state => ({
|
||||
channels: selectMyChannelClaims(state),
|
||||
activeChannelClaim: selectActiveChannelClaim(state),
|
||||
incognito: selectIncognito(state),
|
||||
});
|
||||
|
||||
export default connect(select)(SelectChannel);
|
||||
export default connect(select, {
|
||||
doSetActiveChannel,
|
||||
doSetIncognito,
|
||||
})(SelectChannel);
|
||||
|
||||
@@ -1,16 +1,23 @@
|
||||
// @flow
|
||||
import * as ICONS from 'constants/icons';
|
||||
import * as PAGES from 'constants/pages';
|
||||
import classnames from 'classnames';
|
||||
import React from 'react';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import { Menu, MenuList, MenuButton, MenuItem } from '@reach/menu-button';
|
||||
import ChannelTitle from 'component/channelTitle';
|
||||
import Icon from 'component/common/icon';
|
||||
import { useHistory } from 'react-router';
|
||||
|
||||
type Props = {
|
||||
selectedChannelUrl: string, // currently selected channel
|
||||
channels: ?Array<ChannelClaim>,
|
||||
onChannelSelect: (url: string) => void,
|
||||
hideAnon?: boolean,
|
||||
activeChannelClaim: ?ChannelClaim,
|
||||
doSetActiveChannel: (string) => void,
|
||||
incognito: boolean,
|
||||
doSetIncognito: (boolean) => void,
|
||||
};
|
||||
|
||||
type ListItemProps = {
|
||||
@@ -23,41 +30,71 @@ function ChannelListItem(props: ListItemProps) {
|
||||
|
||||
return (
|
||||
<div className={classnames('channel__list-item', { 'channel__list-item--selected': isSelected })}>
|
||||
<ChannelThumbnail uri={uri} />
|
||||
<ChannelThumbnail uri={uri} hideStakedIndicator />
|
||||
<ChannelTitle uri={uri} />
|
||||
{isSelected && <Icon icon={ICONS.DOWN} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ChannelSelector(props: Props) {
|
||||
const { channels, selectedChannelUrl, onChannelSelect } = props;
|
||||
type IncognitoSelectorProps = {
|
||||
isSelected?: boolean,
|
||||
};
|
||||
|
||||
if (!channels || !selectedChannelUrl) {
|
||||
return null;
|
||||
function IncognitoSelector(props: IncognitoSelectorProps) {
|
||||
return (
|
||||
<div className={classnames('channel__list-item', { 'channel__list-item--selected': props.isSelected })}>
|
||||
<Icon sectionIcon icon={ICONS.ANONYMOUS} />
|
||||
<h2 className="channel__list-text">{__('Anonymous')}</h2>
|
||||
{props.isSelected && <Icon icon={ICONS.DOWN} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function ChannelSelector(props: Props) {
|
||||
const { channels, activeChannelClaim, doSetActiveChannel, hideAnon = false, incognito, doSetIncognito } = props;
|
||||
const {
|
||||
push,
|
||||
location: { pathname },
|
||||
} = useHistory();
|
||||
const activeChannelUrl = activeChannelClaim && activeChannelClaim.permanent_url;
|
||||
|
||||
function handleChannelSelect(channelClaim) {
|
||||
doSetIncognito(false);
|
||||
doSetActiveChannel(channelClaim.claim_id);
|
||||
}
|
||||
|
||||
return (
|
||||
<Menu>
|
||||
<MenuButton className="">
|
||||
<ChannelListItem uri={selectedChannelUrl} isSelected />
|
||||
</MenuButton>
|
||||
<MenuList className="menu__list channel__list">
|
||||
{channels &&
|
||||
channels.map(channel => (
|
||||
<MenuItem
|
||||
key={channel.canonical_url}
|
||||
onSelect={() => {
|
||||
if (selectedChannelUrl !== channel.canonical_url) {
|
||||
onChannelSelect(channel.canonical_url);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<ChannelListItem uri={channel.canonical_url} />
|
||||
<div className="channel__selector">
|
||||
<Menu>
|
||||
<MenuButton>
|
||||
{(incognito && !hideAnon) || !activeChannelUrl ? (
|
||||
<IncognitoSelector isSelected />
|
||||
) : (
|
||||
<ChannelListItem uri={activeChannelUrl} isSelected />
|
||||
)}
|
||||
</MenuButton>
|
||||
<MenuList className="menu__list channel__list">
|
||||
{channels &&
|
||||
channels.map((channel) => (
|
||||
<MenuItem key={channel.permanent_url} onSelect={() => handleChannelSelect(channel)}>
|
||||
<ChannelListItem uri={channel.permanent_url} />
|
||||
</MenuItem>
|
||||
))}
|
||||
{!hideAnon && (
|
||||
<MenuItem onSelect={() => doSetIncognito(true)}>
|
||||
<IncognitoSelector />
|
||||
</MenuItem>
|
||||
))}
|
||||
</MenuList>
|
||||
</Menu>
|
||||
)}
|
||||
<MenuItem onSelect={() => push(`/$/${PAGES.CHANNEL_NEW}?redirect=${pathname}`)}>
|
||||
<div className="channel__list-item">
|
||||
<Icon sectionIcon icon={ICONS.CHANNEL} />
|
||||
<h2 className="channel__list-text">{__('Create a new channel')}</h2>
|
||||
</div>
|
||||
</MenuItem>
|
||||
</MenuList>
|
||||
</Menu>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
15
ui/component/channelStakedIndicator/index.js
Normal file
15
ui/component/channelStakedIndicator/index.js
Normal file
@@ -0,0 +1,15 @@
|
||||
import { connect } from 'react-redux';
|
||||
import {
|
||||
makeSelectClaimForUri,
|
||||
makeSelectStakedLevelForChannelUri,
|
||||
makeSelectTotalStakedAmountForChannelUri,
|
||||
} from 'lbry-redux';
|
||||
import ChannelStakedIndicator from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
channelClaim: makeSelectClaimForUri(props.uri)(state),
|
||||
amount: makeSelectTotalStakedAmountForChannelUri(props.uri)(state),
|
||||
level: makeSelectStakedLevelForChannelUri(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select)(ChannelStakedIndicator);
|
||||
94
ui/component/channelStakedIndicator/view.jsx
Normal file
94
ui/component/channelStakedIndicator/view.jsx
Normal file
@@ -0,0 +1,94 @@
|
||||
// @flow
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import Icon from 'component/common/icon';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
import Tooltip from 'component/common/tooltip';
|
||||
import CreditAmount from 'component/common/credit-amount';
|
||||
|
||||
type Props = {
|
||||
channelClaim: ChannelClaim,
|
||||
amount: number,
|
||||
level: number,
|
||||
large?: boolean,
|
||||
inline?: boolean,
|
||||
};
|
||||
|
||||
function getChannelIcon(level: number): string {
|
||||
const icons = {
|
||||
'1': ICONS.CHANNEL_LEVEL_1,
|
||||
'2': ICONS.CHANNEL_LEVEL_2,
|
||||
'3': ICONS.CHANNEL_LEVEL_3,
|
||||
'4': ICONS.CHANNEL_LEVEL_4,
|
||||
'5': ICONS.CHANNEL_LEVEL_5,
|
||||
};
|
||||
|
||||
return icons[level] || ICONS.CHANNEL_LEVEL_1;
|
||||
}
|
||||
|
||||
function ChannelStakedIndicator(props: Props) {
|
||||
const { channelClaim, amount, level, large = false, inline = false } = props;
|
||||
|
||||
if (!channelClaim || !channelClaim.meta) {
|
||||
return null;
|
||||
}
|
||||
|
||||
const isControlling = channelClaim && channelClaim.meta.is_controlling;
|
||||
const icon = getChannelIcon(level);
|
||||
|
||||
return (
|
||||
SIMPLE_SITE && (
|
||||
<Tooltip
|
||||
label={
|
||||
<div className="channel-staked__tooltip">
|
||||
<div className="channel-staked__tooltip-icons">
|
||||
<LevelIcon icon={icon} isControlling={isControlling} size={isControlling ? 14 : 10} />
|
||||
</div>
|
||||
|
||||
<div className="channel-staked__tooltip-text">
|
||||
<span>{__('Level %current_level%', { current_level: level })}</span>
|
||||
<div className="channel-staked__amount">
|
||||
<LbcSymbol postfix={<CreditAmount amount={amount} showLBC={false} />} size={14} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
>
|
||||
<div
|
||||
className={classnames('channel-staked__wrapper', {
|
||||
'channel-staked__wrapper--large': large,
|
||||
'channel-staked__wrapper--inline': inline,
|
||||
})}
|
||||
>
|
||||
<LevelIcon icon={icon} large={large} isControlling={isControlling} />
|
||||
</div>
|
||||
</Tooltip>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
type LevelIconProps = {
|
||||
isControlling: boolean,
|
||||
icon: string,
|
||||
large?: boolean,
|
||||
};
|
||||
|
||||
function LevelIcon(props: LevelIconProps) {
|
||||
const { large, isControlling, icon } = props;
|
||||
return (
|
||||
icon && (
|
||||
<Icon
|
||||
icon={icon}
|
||||
size={large ? 36 : 14}
|
||||
className={classnames('channel-staked__indicator', {
|
||||
'channel-staked__indicator--large': large,
|
||||
'channel-staked__indicator--controlling': isControlling,
|
||||
})}
|
||||
/>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
export default ChannelStakedIndicator;
|
||||
@@ -1,12 +1,13 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectThumbnailForUri } from 'lbry-redux';
|
||||
import { makeSelectThumbnailForUri, doResolveUri, makeSelectClaimForUri, makeSelectIsUriResolving } from 'lbry-redux';
|
||||
import ChannelThumbnail from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
isResolving: makeSelectIsUriResolving(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
null
|
||||
)(ChannelThumbnail);
|
||||
export default connect(select, {
|
||||
doResolveUri,
|
||||
})(ChannelThumbnail);
|
||||
|
||||
@@ -4,6 +4,7 @@ import { parseURI } from 'lbry-redux';
|
||||
import classnames from 'classnames';
|
||||
import Gerbil from './gerbil.png';
|
||||
import FreezeframeWrapper from 'component/fileThumbnail/FreezeframeWrapper';
|
||||
import ChannelStakedIndicator from 'component/channelStakedIndicator';
|
||||
|
||||
type Props = {
|
||||
thumbnail: ?string,
|
||||
@@ -13,6 +14,11 @@ type Props = {
|
||||
obscure?: boolean,
|
||||
small?: boolean,
|
||||
allowGifs?: boolean,
|
||||
claim: ?ChannelClaim,
|
||||
doResolveUri: (string) => void,
|
||||
isResolving: boolean,
|
||||
showDelayedMessage?: boolean,
|
||||
hideStakedIndicator?: boolean,
|
||||
};
|
||||
|
||||
function ChannelThumbnail(props: Props) {
|
||||
@@ -24,8 +30,14 @@ function ChannelThumbnail(props: Props) {
|
||||
obscure,
|
||||
small = false,
|
||||
allowGifs = false,
|
||||
claim,
|
||||
doResolveUri,
|
||||
isResolving,
|
||||
showDelayedMessage = false,
|
||||
hideStakedIndicator = false,
|
||||
} = props;
|
||||
const [thumbError, setThumbError] = React.useState(false);
|
||||
const shouldResolve = claim === undefined;
|
||||
const thumbnail = rawThumbnail && rawThumbnail.trim().replace(/^http:\/\//i, 'https://');
|
||||
const thumbnailPreview = rawThumbnailPreview && rawThumbnailPreview.trim().replace(/^http:\/\//i, 'https://');
|
||||
const channelThumbnail = thumbnail || thumbnailPreview;
|
||||
@@ -41,8 +53,18 @@ function ChannelThumbnail(props: Props) {
|
||||
colorClassName = `channel-thumbnail__default--4`;
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
if (shouldResolve && uri) {
|
||||
doResolveUri(uri);
|
||||
}
|
||||
}, [doResolveUri, shouldResolve, uri]);
|
||||
|
||||
if (channelThumbnail && channelThumbnail.endsWith('gif') && !allowGifs) {
|
||||
return <FreezeframeWrapper src={channelThumbnail} className="channel-thumbnail" />;
|
||||
return (
|
||||
<FreezeframeWrapper src={channelThumbnail} className={classnames('channel-thumbnail', className)}>
|
||||
{!hideStakedIndicator && <ChannelStakedIndicator uri={uri} claim={claim} />}
|
||||
</FreezeframeWrapper>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
@@ -50,23 +72,32 @@ function ChannelThumbnail(props: Props) {
|
||||
className={classnames('channel-thumbnail', className, {
|
||||
[colorClassName]: !showThumb,
|
||||
'channel-thumbnail--small': small,
|
||||
'channel-thumbnail--resolving': isResolving,
|
||||
})}
|
||||
>
|
||||
{!showThumb && (
|
||||
<img
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__default"
|
||||
src={thumbnailPreview || Gerbil}
|
||||
/>
|
||||
)}
|
||||
{showThumb && (
|
||||
<img
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__custom"
|
||||
src={!thumbError ? thumbnailPreview || thumbnail : Gerbil}
|
||||
src={!thumbError && thumbnailPreview ? thumbnailPreview : Gerbil}
|
||||
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
|
||||
/>
|
||||
)}
|
||||
{showThumb && (
|
||||
<>
|
||||
{showDelayedMessage && thumbError ? (
|
||||
<div className="chanel-thumbnail--waiting">{__('This will be visible in a few minutes.')}</div>
|
||||
) : (
|
||||
<img
|
||||
alt={__('Channel profile picture')}
|
||||
className="channel-thumbnail__custom"
|
||||
src={!thumbError ? thumbnailPreview || thumbnail : Gerbil}
|
||||
onError={() => setThumbError(true)} // if thumb fails (including due to https replace, show gerbil.
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
{!hideStakedIndicator && <ChannelStakedIndicator uri={uri} claim={claim} />}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri } from 'lbry-redux';
|
||||
import ClaimRepostAuthor from './view';
|
||||
import ClaimEffectiveAmount from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri, false)(state),
|
||||
claim: makeSelectClaimForUri(props.uri, true)(state),
|
||||
});
|
||||
|
||||
export default connect(select)(ClaimRepostAuthor);
|
||||
export default connect(select)(ClaimEffectiveAmount);
|
||||
|
||||
@@ -1,19 +1,20 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import CreditAmount from 'component/common/credit-amount';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?Claim,
|
||||
};
|
||||
|
||||
function ClaimRepostAuthor(props: Props) {
|
||||
function ClaimEffectiveAmount(props: Props) {
|
||||
const { claim } = props;
|
||||
|
||||
if (!claim) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <span>{claim.meta.effective_amount} LBC</span>;
|
||||
return <CreditAmount amount={Number(claim.repost_bid_amount || claim.meta.effective_amount || claim.amount)} />;
|
||||
}
|
||||
|
||||
export default ClaimRepostAuthor;
|
||||
export default ClaimEffectiveAmount;
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
import * as React from 'react';
|
||||
import Button from 'component/button';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import LbcSymbol from 'component/common/lbc-symbol';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -23,10 +24,11 @@ function ClaimInsufficientCredits(props: Props) {
|
||||
tokens={{
|
||||
reward_link: <Button button="link" navigate="/$/rewards" label={__('Rewards')} />,
|
||||
buy_link: <Button button="link" navigate="/$/buy" label={__('buy')} />,
|
||||
lbc: <LbcSymbol />,
|
||||
}}
|
||||
>
|
||||
The publisher has chosen to charge LBC to view this content. Your balance is currently too low to view it. Check
|
||||
out %reward_link% for free LBC or send more LBC to your wallet. You can also %buy_link% more LBC.
|
||||
The publisher has chosen to charge %lbc% to view this content. Your balance is currently too low to view it.
|
||||
Check out %reward_link% for free %lbc% or send more %lbc% to your wallet. You can also %buy_link% more %lbc%.
|
||||
</I18nMessage>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { doResolveUri, makeSelectTitleForUri, makeSelectClaimForUri, makeSelectIsUriResolving } from 'lbry-redux';
|
||||
import { selectBlackListedOutpoints } from 'lbryinc';
|
||||
import { selectPlayingUri } from 'redux/selectors/content';
|
||||
import { doSetPlayingUri } from 'redux/actions/content';
|
||||
import ClaimLink from './view';
|
||||
|
||||
const select = (state, props) => {
|
||||
@@ -10,11 +12,11 @@ const select = (state, props) => {
|
||||
title: makeSelectTitleForUri(props.uri)(state),
|
||||
isResolvingUri: makeSelectIsUriResolving(props.uri)(state),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
playingUri: selectPlayingUri(state),
|
||||
};
|
||||
};
|
||||
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ClaimLink);
|
||||
export default connect(select, {
|
||||
doResolveUri,
|
||||
doSetPlayingUri,
|
||||
})(ClaimLink);
|
||||
|
||||
@@ -1,32 +1,32 @@
|
||||
// @flow
|
||||
import * as React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import EmbedPlayButton from 'component/embedPlayButton';
|
||||
import Button from 'component/button';
|
||||
import PreviewLink from 'component/previewLink';
|
||||
import UriIndicator from 'component/uriIndicator';
|
||||
import { INLINE_PLAYER_WRAPPER_CLASS } from 'component/fileRenderFloating/view';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
title: ?string,
|
||||
claim: StreamClaim,
|
||||
children: React.Node,
|
||||
className: ?string,
|
||||
autoEmbed: ?boolean,
|
||||
description: ?string,
|
||||
isResolvingUri: boolean,
|
||||
resolveUri: string => void,
|
||||
doResolveUri: string => void,
|
||||
blackListedOutpoints: Array<{
|
||||
txid: string,
|
||||
nout: number,
|
||||
}>,
|
||||
playingUri: ?PlayingUri,
|
||||
parentCommentId?: string,
|
||||
isMarkdownPost?: boolean,
|
||||
};
|
||||
|
||||
class ClaimLink extends React.Component<Props> {
|
||||
static defaultProps = {
|
||||
href: null,
|
||||
link: false,
|
||||
title: null,
|
||||
thumbnail: null,
|
||||
autoEmbed: false,
|
||||
description: null,
|
||||
isResolvingUri: false,
|
||||
};
|
||||
@@ -55,35 +55,43 @@ class ClaimLink extends React.Component<Props> {
|
||||
}
|
||||
|
||||
resolve = (props: Props) => {
|
||||
const { isResolvingUri, resolveUri, claim, uri } = props;
|
||||
const { isResolvingUri, doResolveUri, claim, uri } = props;
|
||||
|
||||
if (!isResolvingUri && claim === undefined && uri) {
|
||||
resolveUri(uri);
|
||||
doResolveUri(uri);
|
||||
}
|
||||
};
|
||||
|
||||
render() {
|
||||
const { uri, claim, title, className, autoEmbed, children, isResolvingUri } = this.props;
|
||||
const { uri, claim, children, isResolvingUri, playingUri, parentCommentId, isMarkdownPost } = this.props;
|
||||
const isUnresolved = (!isResolvingUri && !claim) || !claim;
|
||||
const isBlacklisted = this.isClaimBlackListed();
|
||||
const isPlayingInline =
|
||||
playingUri &&
|
||||
playingUri.uri === uri &&
|
||||
((playingUri.source === 'comment' && parentCommentId === playingUri.commentId) ||
|
||||
playingUri.source === 'markdown');
|
||||
|
||||
if (isBlacklisted || isUnresolved) {
|
||||
return <span>{children}</span>;
|
||||
}
|
||||
|
||||
const { name: claimName, value_type: valueType } = claim;
|
||||
const { value_type: valueType } = claim;
|
||||
const isChannel = valueType === 'channel';
|
||||
const showPreview = autoEmbed === true && !isUnresolved;
|
||||
|
||||
if(isChannel){
|
||||
return <UriIndicator uri={uri} link addTooltip />
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<Button label={children} title={title || claimName} button={'link'} navigate={uri} className={className} />
|
||||
{showPreview && <PreviewLink uri={uri} />}
|
||||
</React.Fragment>
|
||||
return isChannel ? (
|
||||
<UriIndicator uri={uri} link />
|
||||
) : (
|
||||
<div className={classnames('claim-link')}>
|
||||
<div
|
||||
className={classnames({
|
||||
[INLINE_PLAYER_WRAPPER_CLASS]: isPlayingInline,
|
||||
})}
|
||||
>
|
||||
<EmbedPlayButton uri={uri} parentCommentId={parentCommentId} isMarkdownPost={isMarkdownPost} />
|
||||
</div>
|
||||
<Button button="link" className="preview-link__url" label={uri} navigate={uri} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
import { connect } from 'react-redux';
|
||||
import ClaimList from './view';
|
||||
import { SETTINGS } from 'lbry-redux';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
|
||||
const select = state => ({});
|
||||
const select = (state) => ({
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({});
|
||||
const perform = (dispatch) => ({});
|
||||
|
||||
export default connect(
|
||||
select,
|
||||
perform
|
||||
)(ClaimList);
|
||||
export default connect(select, perform)(ClaimList);
|
||||
|
||||
@@ -8,6 +8,7 @@ import Spinner from 'component/spinner';
|
||||
import { FormField } from 'component/common/form';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import debounce from 'util/debounce';
|
||||
import ClaimPreviewTile from 'component/claimPreviewTile';
|
||||
|
||||
const DEBOUNCE_SCROLL_HANDLER_MS = 150;
|
||||
const SORT_NEW = 'new';
|
||||
@@ -21,7 +22,7 @@ type Props = {
|
||||
type: string,
|
||||
empty?: string,
|
||||
defaultSort?: boolean,
|
||||
onScrollBottom?: any => void,
|
||||
onScrollBottom?: (any) => void,
|
||||
page?: number,
|
||||
pageSize?: number,
|
||||
id?: string,
|
||||
@@ -31,10 +32,12 @@ type Props = {
|
||||
showUnresolvedClaims?: boolean,
|
||||
renderProperties: ?(Claim) => Node,
|
||||
includeSupportAction?: boolean,
|
||||
hideBlock: boolean,
|
||||
injectedItem: ?Node,
|
||||
timedOutMessage?: Node,
|
||||
isCardBody?: boolean,
|
||||
tileLayout?: boolean,
|
||||
renderActions?: (Claim) => ?Node,
|
||||
searchInLanguage: boolean,
|
||||
hideMenu?: boolean,
|
||||
};
|
||||
|
||||
export default function ClaimList(props: Props) {
|
||||
@@ -54,22 +57,28 @@ export default function ClaimList(props: Props) {
|
||||
showUnresolvedClaims,
|
||||
renderProperties,
|
||||
includeSupportAction,
|
||||
hideBlock,
|
||||
injectedItem,
|
||||
timedOutMessage,
|
||||
isCardBody = false,
|
||||
tileLayout = false,
|
||||
renderActions,
|
||||
searchInLanguage,
|
||||
hideMenu,
|
||||
} = props;
|
||||
|
||||
const [currentSort, setCurrentSort] = usePersistedState(persistedStorageKey, SORT_NEW);
|
||||
const timedOut = uris === null;
|
||||
const urisLength = (uris && uris.length) || 0;
|
||||
const sortedUris = (urisLength > 0 && (currentSort === SORT_NEW ? uris : uris.slice().reverse())) || [];
|
||||
const noResultMsg = searchInLanguage
|
||||
? __('No results. Contents may be hidden by the Language filter.')
|
||||
: __('No results');
|
||||
|
||||
function handleSortChange() {
|
||||
setCurrentSort(currentSort === SORT_NEW ? SORT_OLD : SORT_NEW);
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
const handleScroll = debounce(e => {
|
||||
const handleScroll = debounce((e) => {
|
||||
if (page && pageSize && onScrollBottom) {
|
||||
const mainEl = document.querySelector(`.${MAIN_CLASS}`);
|
||||
|
||||
@@ -89,7 +98,14 @@ export default function ClaimList(props: Props) {
|
||||
}
|
||||
}, [loading, onScrollBottom, urisLength, pageSize, page]);
|
||||
|
||||
return (
|
||||
return tileLayout && !header ? (
|
||||
<section className="claim-grid">
|
||||
{urisLength > 0 &&
|
||||
uris.map((uri) => <ClaimPreviewTile key={uri} uri={uri} showHiddenByUser={showHiddenByUser} />)}
|
||||
{!timedOut && urisLength === 0 && !loading && <div className="empty main--empty">{empty || noResultMsg}</div>}
|
||||
{timedOut && timedOutMessage && <div className="empty main--empty">{timedOutMessage}</div>}
|
||||
</section>
|
||||
) : (
|
||||
<section
|
||||
className={classnames('claim-list', {
|
||||
'claim-list--small': type === 'small',
|
||||
@@ -124,8 +140,8 @@ export default function ClaimList(props: Props) {
|
||||
{urisLength > 0 && (
|
||||
<ul
|
||||
className={classnames('ul--no-style', {
|
||||
card: !isCardBody,
|
||||
'claim-list--card-body': isCardBody,
|
||||
card: !(tileLayout || type === 'small'),
|
||||
'claim-list--card-body': tileLayout,
|
||||
})}
|
||||
>
|
||||
{sortedUris.map((uri, index) => (
|
||||
@@ -134,11 +150,13 @@ export default function ClaimList(props: Props) {
|
||||
<ClaimPreview
|
||||
uri={uri}
|
||||
type={type}
|
||||
hideMenu={hideMenu}
|
||||
includeSupportAction={includeSupportAction}
|
||||
showUnresolvedClaim={showUnresolvedClaims}
|
||||
properties={renderProperties || (type !== 'small' ? undefined : false)}
|
||||
renderActions={renderActions}
|
||||
showUserBlocked={showHiddenByUser}
|
||||
hideBlock={hideBlock}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
customShouldHide={(claim: StreamClaim) => {
|
||||
// Hack to hide spee.ch thumbnail publishes
|
||||
// If it meets these requirements, it was probably uploaded here:
|
||||
@@ -154,10 +172,9 @@ export default function ClaimList(props: Props) {
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
{!timedOut && urisLength === 0 && !loading && (
|
||||
<div className="empty empty--centered">{empty || __('No results')}</div>
|
||||
)}
|
||||
{timedOut && timedOutMessage && <div className="empty empty--centered">{timedOutMessage}</div>}
|
||||
|
||||
{!timedOut && urisLength === 0 && !loading && <div className="empty empty--centered">{empty || noResultMsg}</div>}
|
||||
{!loading && timedOut && timedOutMessage && <div className="empty empty--centered">{timedOutMessage}</div>}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -2,22 +2,28 @@ import { connect } from 'react-redux';
|
||||
import {
|
||||
doClaimSearch,
|
||||
selectClaimSearchByQuery,
|
||||
selectClaimSearchByQueryLastPageReached,
|
||||
selectFetchingClaimSearch,
|
||||
selectBlockedChannels,
|
||||
SETTINGS,
|
||||
selectFollowedTags,
|
||||
} from 'lbry-redux';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { selectMutedChannels } from 'redux/selectors/blocked';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting } from 'redux/selectors/settings';
|
||||
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
|
||||
import { selectModerationBlockList } from 'redux/selectors/comments';
|
||||
import ClaimListDiscover from './view';
|
||||
|
||||
const select = state => ({
|
||||
const select = (state) => ({
|
||||
followedTags: selectFollowedTags(state),
|
||||
claimSearchByQuery: selectClaimSearchByQuery(state),
|
||||
claimSearchByQueryLastPageReached: selectClaimSearchByQueryLastPageReached(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
hideReposts: makeSelectClientSetting(SETTINGS.HIDE_REPOSTS)(state),
|
||||
hiddenUris: selectBlockedChannels(state),
|
||||
languageSetting: selectLanguage(state),
|
||||
mutedUris: selectMutedChannels(state),
|
||||
blockedUris: selectModerationBlockList(state),
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
});
|
||||
|
||||
const perform = {
|
||||
|
||||
@@ -1,20 +1,18 @@
|
||||
// @flow
|
||||
import type { Node } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import React, { Fragment, useEffect, useState } from 'react';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import React from 'react';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import { withRouter } from 'react-router';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import { createNormalizedClaimSearchKey, MATURE_TAGS } from 'lbry-redux';
|
||||
import { FormField } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import moment from 'moment';
|
||||
import ClaimList from 'component/claimList';
|
||||
import ClaimPreview from 'component/claimPreview';
|
||||
import { toCapitalCase } from 'util/string';
|
||||
import ClaimPreviewTile from 'component/claimPreviewTile';
|
||||
import I18nMessage from 'component/i18nMessage';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import Card from 'component/common/card';
|
||||
import ClaimListHeader from 'component/claimListHeader';
|
||||
import { useIsLargeScreen } from 'effects/use-screensize';
|
||||
|
||||
type Props = {
|
||||
uris: Array<string>,
|
||||
@@ -22,18 +20,21 @@ type Props = {
|
||||
doClaimSearch: ({}) => void,
|
||||
loading: boolean,
|
||||
personalView: boolean,
|
||||
doToggleTagFollowDesktop: string => void,
|
||||
doToggleTagFollowDesktop: (string) => void,
|
||||
meta?: Node,
|
||||
showNsfw: boolean,
|
||||
hideReposts: boolean,
|
||||
history: { action: string, push: string => void, replace: string => void },
|
||||
history: { action: string, push: (string) => void, replace: (string) => void },
|
||||
location: { search: string, pathname: string },
|
||||
claimSearchByQuery: {
|
||||
[string]: Array<string>,
|
||||
},
|
||||
hiddenUris: Array<string>,
|
||||
claimSearchByQueryLastPageReached: { [string]: boolean },
|
||||
mutedUris: Array<string>,
|
||||
blockedUris: Array<string>,
|
||||
hiddenNsfwMessage?: Node,
|
||||
channelIds?: Array<string>,
|
||||
claimIds?: Array<string>,
|
||||
tags: string, // these are just going to be string. pass a CSV if you want multi
|
||||
defaultTags: string,
|
||||
orderBy?: Array<string>,
|
||||
@@ -43,13 +44,12 @@ type Props = {
|
||||
header?: Node,
|
||||
headerLabel?: string | Node,
|
||||
name?: string,
|
||||
hideBlock?: boolean,
|
||||
hideFilter?: boolean,
|
||||
hideAdvancedFilter?: boolean,
|
||||
claimType?: Array<string>,
|
||||
defaultClaimType?: Array<string>,
|
||||
streamType?: string | Array<string>,
|
||||
defaultStreamType?: string | Array<string>,
|
||||
renderProperties?: Claim => Node,
|
||||
renderProperties?: (Claim) => Node,
|
||||
includeSupportAction?: boolean,
|
||||
repostedClaimId?: string,
|
||||
pageSize?: number,
|
||||
@@ -57,12 +57,21 @@ type Props = {
|
||||
injectedItem: ?Node,
|
||||
infiniteScroll?: Boolean,
|
||||
feeAmount?: string,
|
||||
tileLayout: boolean,
|
||||
hideFilters?: boolean,
|
||||
maxPages?: number,
|
||||
forceShowReposts?: boolean,
|
||||
languageSetting: string,
|
||||
searchInLanguage: boolean,
|
||||
scrollAnchor?: string,
|
||||
showHiddenByUser?: boolean,
|
||||
};
|
||||
|
||||
function ClaimListDiscover(props: Props) {
|
||||
const {
|
||||
doClaimSearch,
|
||||
claimSearchByQuery,
|
||||
claimSearchByQueryLastPageReached,
|
||||
tags,
|
||||
defaultTags,
|
||||
loading,
|
||||
@@ -72,7 +81,8 @@ function ClaimListDiscover(props: Props) {
|
||||
hideReposts,
|
||||
history,
|
||||
location,
|
||||
hiddenUris,
|
||||
mutedUris,
|
||||
blockedUris,
|
||||
hiddenNsfwMessage,
|
||||
defaultOrderBy,
|
||||
orderBy,
|
||||
@@ -81,7 +91,6 @@ function ClaimListDiscover(props: Props) {
|
||||
name,
|
||||
claimType,
|
||||
pageSize,
|
||||
hideBlock,
|
||||
defaultClaimType,
|
||||
streamType,
|
||||
defaultStreamType,
|
||||
@@ -90,28 +99,51 @@ function ClaimListDiscover(props: Props) {
|
||||
renderProperties,
|
||||
includeSupportAction,
|
||||
repostedClaimId,
|
||||
hideFilter,
|
||||
hideAdvancedFilter,
|
||||
infiniteScroll = true,
|
||||
followedTags,
|
||||
injectedItem,
|
||||
feeAmount,
|
||||
uris,
|
||||
tileLayout,
|
||||
hideFilters = false,
|
||||
claimIds,
|
||||
maxPages,
|
||||
forceShowReposts = false,
|
||||
languageSetting,
|
||||
searchInLanguage,
|
||||
scrollAnchor,
|
||||
showHiddenByUser = false,
|
||||
} = props;
|
||||
const didNavigateForward = history.action === 'PUSH';
|
||||
const { search } = location;
|
||||
|
||||
const [page, setPage] = useState(1);
|
||||
const [forceRefresh, setForceRefresh] = useState();
|
||||
const [expanded, setExpanded] = usePersistedState(`expanded-${location.pathname}`, false);
|
||||
const [orderParamEntry, setOrderParamEntry] = useState(CS.ORDER_BY_TRENDING);
|
||||
const [page, setPage] = React.useState(1);
|
||||
const [forceRefresh, setForceRefresh] = React.useState();
|
||||
const isLargeScreen = useIsLargeScreen();
|
||||
const [orderParamEntry, setOrderParamEntry] = usePersistedState(`entry-${location.pathname}`, CS.ORDER_BY_TRENDING);
|
||||
const [orderParamUser, setOrderParamUser] = usePersistedState(`orderUser-${location.pathname}`, CS.ORDER_BY_TRENDING);
|
||||
const followed = (followedTags && followedTags.map(t => t.name)) || [];
|
||||
const followed = (followedTags && followedTags.map((t) => t.name)) || [];
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const tagsParam = // can be 'x,y,z' or 'x' or ['x','y'] or CS.CONSTANT
|
||||
(tags && getParamFromTags(tags)) ||
|
||||
(urlParams.get(CS.TAGS_KEY) !== null && urlParams.get(CS.TAGS_KEY)) ||
|
||||
(defaultTags && getParamFromTags(defaultTags));
|
||||
const freshnessParam = freshness || urlParams.get(CS.FRESH_KEY) || defaultFreshness;
|
||||
const mutedAndBlockedChannelIds = Array.from(new Set(mutedUris.concat(blockedUris).map((uri) => uri.split('#')[1])));
|
||||
|
||||
const langParam = urlParams.get(CS.LANGUAGE_KEY) || null;
|
||||
const languageParams = searchInLanguage
|
||||
? langParam === null
|
||||
? languageSetting.concat(languageSetting === 'en' ? ',none' : '')
|
||||
: langParam === 'any'
|
||||
? null
|
||||
: langParam.concat(langParam === 'en' ? ',none' : '')
|
||||
: langParam === null
|
||||
? null
|
||||
: langParam === 'any'
|
||||
? null
|
||||
: langParam.concat(langParam === 'en' ? ',none' : '');
|
||||
|
||||
const contentTypeParam = urlParams.get(CS.CONTENT_KEY);
|
||||
const claimTypeParam =
|
||||
claimType || (CS.CLAIM_TYPES.includes(contentTypeParam) && contentTypeParam) || defaultClaimType || null;
|
||||
@@ -120,27 +152,15 @@ function ClaimListDiscover(props: Props) {
|
||||
const durationParam = urlParams.get(CS.DURATION_KEY) || null;
|
||||
const channelIdsInUrl = urlParams.get(CS.CHANNEL_IDS_KEY);
|
||||
const channelIdsParam = channelIdsInUrl ? channelIdsInUrl.split(',') : channelIds;
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount || CS.FEE_AMOUNT_ANY;
|
||||
const showDuration = !(claimType && claimType === CS.CLAIM_CHANNEL);
|
||||
const isFiltered = () =>
|
||||
Boolean(
|
||||
urlParams.get(CS.FRESH_KEY) ||
|
||||
urlParams.get(CS.CONTENT_KEY) ||
|
||||
urlParams.get(CS.DURATION_KEY) ||
|
||||
urlParams.get(CS.TAGS_KEY) ||
|
||||
urlParams.get(CS.FEE_AMOUNT_KEY)
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
if (history.action !== 'POP' && isFiltered()) {
|
||||
setExpanded(true);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount;
|
||||
const originalPageSize = pageSize || CS.PAGE_SIZE;
|
||||
const dynamicPageSize = isLargeScreen ? Math.ceil(originalPageSize * (3 / 2)) : originalPageSize;
|
||||
const historyAction = history.action;
|
||||
|
||||
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy;
|
||||
|
||||
if (!orderParam) {
|
||||
if (history.action === 'POP') {
|
||||
if (historyAction === 'POP') {
|
||||
// Reaching here means user have popped back to the page's entry point (e.g. '/$/tags' without any '?order=').
|
||||
orderParam = orderParamEntry;
|
||||
} else {
|
||||
@@ -149,22 +169,27 @@ function ClaimListDiscover(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
React.useEffect(() => {
|
||||
setOrderParamUser(orderParam);
|
||||
}, [orderParam]);
|
||||
}, [orderParam, setOrderParamUser]);
|
||||
|
||||
useEffect(() => {
|
||||
React.useEffect(() => {
|
||||
// One-time update to stash the finalized 'orderParam' at entry.
|
||||
setOrderParamEntry(orderParam);
|
||||
}, []);
|
||||
if (historyAction !== 'POP') {
|
||||
setOrderParamEntry(orderParam);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [historyAction, setOrderParamEntry]);
|
||||
|
||||
let options: {
|
||||
page_size: number,
|
||||
page: number,
|
||||
no_totals: boolean,
|
||||
any_tags?: Array<string>,
|
||||
any_languages?: Array<string>,
|
||||
not_tags: Array<string>,
|
||||
channel_ids: Array<string>,
|
||||
channel_ids?: Array<string>,
|
||||
claim_ids?: Array<string>,
|
||||
not_channel_ids: Array<string>,
|
||||
order_by: Array<string>,
|
||||
release_time?: string,
|
||||
@@ -175,17 +200,16 @@ function ClaimListDiscover(props: Props) {
|
||||
stream_types?: any,
|
||||
fee_amount?: string,
|
||||
} = {
|
||||
page_size: pageSize || CS.PAGE_SIZE,
|
||||
page_size: dynamicPageSize,
|
||||
page,
|
||||
name,
|
||||
claim_type: claimType || undefined,
|
||||
// no_totals makes it so the sdk doesn't have to calculate total number pages for pagination
|
||||
// it's faster, but we will need to remove it if we start using total_pages
|
||||
no_totals: true,
|
||||
channel_ids: channelIdsParam || [],
|
||||
not_channel_ids:
|
||||
// If channelIdsParam were passed in, we don't need not_channel_ids
|
||||
!channelIdsParam && hiddenUris && hiddenUris.length ? hiddenUris.map(hiddenUri => hiddenUri.split('#')[1]) : [],
|
||||
!channelIdsParam ? mutedAndBlockedChannelIds : [],
|
||||
not_tags: !showNsfw ? MATURE_TAGS : [],
|
||||
order_by:
|
||||
orderParam === CS.ORDER_BY_TRENDING
|
||||
@@ -195,70 +219,71 @@ function ClaimListDiscover(props: Props) {
|
||||
: CS.ORDER_BY_TOP_VALUE, // Sort by top
|
||||
};
|
||||
|
||||
if (feeAmountParam && claimType !== CS.CLAIM_CHANNEL) {
|
||||
options.fee_amount = feeAmountParam;
|
||||
}
|
||||
|
||||
if (claimIds) {
|
||||
options.claim_ids = claimIds;
|
||||
}
|
||||
|
||||
if (channelIdsParam) {
|
||||
options.channel_ids = channelIdsParam;
|
||||
}
|
||||
|
||||
if (tagsParam) {
|
||||
if (tagsParam !== CS.TAGS_ALL && tagsParam !== '') {
|
||||
if (tagsParam === CS.TAGS_FOLLOWED) {
|
||||
options.any_tags = followed;
|
||||
} else if (Array.isArray(tagsParam)) {
|
||||
options.any_tags = tagsParam;
|
||||
} else {
|
||||
options.any_tags = tagsParam.split(',');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (repostedClaimId) {
|
||||
// SDK chokes on reposted_claim_id of null or false, needs to not be present if no value
|
||||
options.reposted_claim_id = repostedClaimId;
|
||||
}
|
||||
|
||||
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
||||
options.release_time = `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, freshnessParam)
|
||||
.startOf('hour')
|
||||
.unix()
|
||||
)}`;
|
||||
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
|
||||
// Warning - hack below
|
||||
// If users are following more than 10 channels or tags, limit results to stuff less than a year old
|
||||
// For more than 20, drop it down to 6 months
|
||||
// This helps with timeout issues for users that are following a ton of stuff
|
||||
// https://github.com/lbryio/lbry-sdk/issues/2420
|
||||
if (
|
||||
(options.channel_ids && options.channel_ids.length > 20) ||
|
||||
(options.any_tags && options.any_tags.length > 20)
|
||||
) {
|
||||
options.release_time = `>${Math.floor(
|
||||
moment()
|
||||
.subtract(3, CS.FRESH_MONTH)
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`;
|
||||
} else if (
|
||||
(options.channel_ids && options.channel_ids.length > 10) ||
|
||||
(options.any_tags && options.any_tags.length > 10)
|
||||
) {
|
||||
options.release_time = `>${Math.floor(
|
||||
moment()
|
||||
.subtract(1, CS.FRESH_YEAR)
|
||||
.startOf('week')
|
||||
.unix()
|
||||
)}`;
|
||||
} else {
|
||||
// Hack for at least the New page until https://github.com/lbryio/lbry-sdk/issues/2591 is fixed
|
||||
options.release_time = `<${Math.floor(
|
||||
moment()
|
||||
.startOf('minute')
|
||||
.unix()
|
||||
)}`;
|
||||
if (claimType !== CS.CLAIM_CHANNEL) {
|
||||
if (orderParam === CS.ORDER_BY_TOP && freshnessParam !== CS.FRESH_ALL) {
|
||||
options.release_time = `>${Math.floor(moment().subtract(1, freshnessParam).startOf('hour').unix())}`;
|
||||
} else if (orderParam === CS.ORDER_BY_NEW || orderParam === CS.ORDER_BY_TRENDING) {
|
||||
// Warning - hack below
|
||||
// If users are following more than 10 channels or tags, limit results to stuff less than a year old
|
||||
// For more than 20, drop it down to 6 months
|
||||
// This helps with timeout issues for users that are following a ton of stuff
|
||||
// https://github.com/lbryio/lbry-sdk/issues/2420
|
||||
if (
|
||||
(options.channel_ids && options.channel_ids.length > 20) ||
|
||||
(options.any_tags && options.any_tags.length > 20)
|
||||
) {
|
||||
options.release_time = `>${Math.floor(moment().subtract(3, CS.FRESH_MONTH).startOf('week').unix())}`;
|
||||
} else if (
|
||||
(options.channel_ids && options.channel_ids.length > 10) ||
|
||||
(options.any_tags && options.any_tags.length > 10)
|
||||
) {
|
||||
options.release_time = `>${Math.floor(moment().subtract(1, CS.FRESH_YEAR).startOf('week').unix())}`;
|
||||
} else {
|
||||
// Hack for at least the New page until https://github.com/lbryio/lbry-sdk/issues/2591 is fixed
|
||||
options.release_time = `<${Math.floor(moment().startOf('minute').unix())}`;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (feeAmountParam) {
|
||||
options.fee_amount = feeAmountParam;
|
||||
}
|
||||
|
||||
if (durationParam) {
|
||||
if (durationParam === CS.DURATION_SHORT) {
|
||||
options.duration = '<=1800';
|
||||
options.duration = '<=240';
|
||||
} else if (durationParam === CS.DURATION_LONG) {
|
||||
options.duration = '>=1800';
|
||||
options.duration = '>=1200';
|
||||
}
|
||||
}
|
||||
|
||||
if (streamTypeParam) {
|
||||
if (streamTypeParam !== CS.CONTENT_ALL) {
|
||||
options.stream_types = [streamTypeParam];
|
||||
}
|
||||
if (streamTypeParam && streamTypeParam !== CS.CONTENT_ALL && claimType !== CS.CLAIM_CHANNEL) {
|
||||
options.stream_types = [streamTypeParam];
|
||||
}
|
||||
|
||||
if (claimTypeParam) {
|
||||
@@ -271,6 +296,12 @@ function ClaimListDiscover(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
if (languageParams) {
|
||||
if (languageParams !== CS.LANGUAGES_ALL) {
|
||||
options.any_languages = languageParams.split(',');
|
||||
}
|
||||
}
|
||||
|
||||
if (tagsParam) {
|
||||
if (tagsParam !== CS.TAGS_ALL && tagsParam !== '') {
|
||||
if (tagsParam === CS.TAGS_FOLLOWED) {
|
||||
@@ -282,36 +313,35 @@ function ClaimListDiscover(props: Props) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// https://github.com/lbryio/lbry-desktop/issues/3774
|
||||
if (hideReposts && !options.reposted_claim_id) {
|
||||
// and not claimrepostid
|
||||
|
||||
if (hideReposts && !options.reposted_claim_id && !forceShowReposts) {
|
||||
if (Array.isArray(options.claim_type)) {
|
||||
if (options.claim_type.length > 1) {
|
||||
options.claim_type = options.claim_type.filter(claimType => claimType !== 'repost');
|
||||
options.claim_type = options.claim_type.filter((claimType) => claimType !== 'repost');
|
||||
}
|
||||
} else {
|
||||
options.claim_type = ['stream', 'channel'];
|
||||
}
|
||||
}
|
||||
|
||||
const hasMatureTags = tagsParam && tagsParam.split(',').some(t => MATURE_TAGS.includes(t));
|
||||
const hasMatureTags = tagsParam && tagsParam.split(',').some((t) => MATURE_TAGS.includes(t));
|
||||
const claimSearchCacheQuery = createNormalizedClaimSearchKey(options);
|
||||
const claimSearchResult = claimSearchByQuery[claimSearchCacheQuery];
|
||||
const claimSearchResultLastPageReached = claimSearchByQueryLastPageReached[claimSearchCacheQuery];
|
||||
|
||||
const [prevOptions, setPrevOptions] = useState(null);
|
||||
const [prevOptions, setPrevOptions] = React.useState(null);
|
||||
|
||||
if (!isJustScrollingToNewPage(prevOptions, options)) {
|
||||
// --- New search, or search options changed.
|
||||
setPrevOptions(options);
|
||||
|
||||
if (didNavigateForward) {
|
||||
// --- Reset to top.
|
||||
window.scrollTo(0, 0); // Prevents onScrollBottom() from re-hitting while waiting for doClaimQuery():
|
||||
// --- Reset the page.
|
||||
options.page = 1;
|
||||
setPage(options.page);
|
||||
} else if (claimSearchResult) {
|
||||
// --- Update 'page' based on retrieved 'claimSearchResult'.
|
||||
options.page = Math.ceil(claimSearchResult.length / CS.PAGE_SIZE);
|
||||
options.page = Math.ceil(claimSearchResult.length / dynamicPageSize);
|
||||
if (options.page !== page) {
|
||||
setPage(options.page);
|
||||
}
|
||||
@@ -322,10 +352,11 @@ function ClaimListDiscover(props: Props) {
|
||||
claimSearchResult === undefined ||
|
||||
didNavigateForward ||
|
||||
(!loading &&
|
||||
!claimSearchResultLastPageReached &&
|
||||
claimSearchResult &&
|
||||
claimSearchResult.length &&
|
||||
claimSearchResult.length < CS.PAGE_SIZE * options.page &&
|
||||
claimSearchResult.length % CS.PAGE_SIZE === 0);
|
||||
claimSearchResult.length < dynamicPageSize * options.page &&
|
||||
claimSearchResult.length % dynamicPageSize === 0);
|
||||
|
||||
// Don't use the query from createNormalizedClaimSearchKey for the effect since that doesn't include page & release_time
|
||||
const optionsStringForEffect = JSON.stringify(options);
|
||||
@@ -380,21 +411,6 @@ function ClaimListDiscover(props: Props) {
|
||||
return JSON.stringify(tmpOptions) === JSON.stringify(tmpPrevOptions);
|
||||
}
|
||||
|
||||
function handleChange(change) {
|
||||
const url = buildUrl(change);
|
||||
setPage(1);
|
||||
history.push(url);
|
||||
}
|
||||
|
||||
function handleAdvancedReset() {
|
||||
const newUrlParams = new URLSearchParams(search);
|
||||
newUrlParams.delete('claim_type');
|
||||
newUrlParams.delete('channel_ids');
|
||||
const newSearch = `?${newUrlParams.toString()}`;
|
||||
|
||||
history.push(newSearch);
|
||||
}
|
||||
|
||||
function getParamFromTags(t) {
|
||||
if (t === CS.TAGS_ALL || t === CS.TAGS_FOLLOWED) {
|
||||
return t;
|
||||
@@ -403,356 +419,104 @@ function ClaimListDiscover(props: Props) {
|
||||
}
|
||||
}
|
||||
|
||||
function buildUrl(delta) {
|
||||
const newUrlParams = new URLSearchParams(location.search);
|
||||
CS.KEYS.forEach(k => {
|
||||
// $FlowFixMe append() can't take null as second arg, but get() can return null
|
||||
if (urlParams.get(k) !== null) newUrlParams.append(k, urlParams.get(k));
|
||||
});
|
||||
|
||||
switch (delta.key) {
|
||||
case CS.ORDER_BY_KEY:
|
||||
newUrlParams.set(CS.ORDER_BY_KEY, delta.value);
|
||||
break;
|
||||
case CS.FRESH_KEY:
|
||||
if (delta.value === defaultFreshness || delta.value === CS.FRESH_DEFAULT) {
|
||||
newUrlParams.delete(CS.FRESH_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.FRESH_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
case CS.CONTENT_KEY:
|
||||
if (delta.value === CS.CLAIM_CHANNEL || delta.value === CS.CLAIM_REPOST) {
|
||||
newUrlParams.delete(CS.DURATION_KEY);
|
||||
newUrlParams.set(CS.CONTENT_KEY, delta.value);
|
||||
} else if (delta.value === CS.CONTENT_ALL) {
|
||||
newUrlParams.delete(CS.CONTENT_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.CONTENT_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
case CS.DURATION_KEY:
|
||||
if (delta.value === CS.DURATION_ALL) {
|
||||
newUrlParams.delete(CS.DURATION_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.DURATION_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
case CS.TAGS_KEY:
|
||||
if (delta.value === CS.TAGS_ALL) {
|
||||
if (defaultTags === CS.TAGS_ALL) {
|
||||
newUrlParams.delete(CS.TAGS_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.TAGS_KEY, delta.value);
|
||||
}
|
||||
} else if (delta.value === CS.TAGS_FOLLOWED) {
|
||||
if (defaultTags === CS.TAGS_FOLLOWED) {
|
||||
newUrlParams.delete(CS.TAGS_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.TAGS_KEY, delta.value); // redundant but special
|
||||
}
|
||||
} else {
|
||||
newUrlParams.set(CS.TAGS_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
case CS.FEE_AMOUNT_KEY:
|
||||
if (delta.value === CS.FEE_AMOUNT_ANY) {
|
||||
newUrlParams.delete(CS.FEE_AMOUNT_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.FEE_AMOUNT_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return `?${newUrlParams.toString()}`;
|
||||
}
|
||||
|
||||
function handleScrollBottom() {
|
||||
if (maxPages !== undefined && page === maxPages) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!loading && infiniteScroll) {
|
||||
if (claimSearchResult && claimSearchResult.length % CS.PAGE_SIZE === 0) {
|
||||
// Only increment the page if the current page is full. A partially-filled page probably
|
||||
// indicates "no more search results" (at least based on my testing). Gating this prevents
|
||||
// incrementing the page when scrolling upwards.
|
||||
if (claimSearchResult && !claimSearchResultLastPageReached) {
|
||||
setPage(page + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
React.useEffect(() => {
|
||||
if (shouldPerformSearch) {
|
||||
const searchOptions = JSON.parse(optionsStringForEffect);
|
||||
doClaimSearch(searchOptions);
|
||||
}
|
||||
}, [doClaimSearch, shouldPerformSearch, optionsStringForEffect, forceRefresh]);
|
||||
|
||||
const defaultHeader = repostedClaimId ? null : (
|
||||
<Fragment>
|
||||
<div className={'claim-search__wrapper'}>
|
||||
<div className={'claim-search__top'}>
|
||||
<div className={'claim-search__top-row'}>
|
||||
{CS.ORDER_BY_TYPES.map(type => (
|
||||
<Button
|
||||
key={type}
|
||||
button="alt"
|
||||
onClick={e =>
|
||||
handleChange({
|
||||
key: CS.ORDER_BY_KEY,
|
||||
value: type,
|
||||
})
|
||||
}
|
||||
className={classnames(`button-toggle button-toggle--${type}`, {
|
||||
'button-toggle--active': orderParam === type,
|
||||
})}
|
||||
disabled={orderBy}
|
||||
icon={toCapitalCase(type)}
|
||||
label={__(toCapitalCase(type))}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
<div>
|
||||
{!hideFilter && (
|
||||
<Button
|
||||
button={'alt'}
|
||||
aria-label={__('More')}
|
||||
className={classnames(`button-toggle button-toggle--top button-toggle--more`, {
|
||||
'button-toggle--custom': isFiltered(),
|
||||
})}
|
||||
icon={ICONS.SLIDERS}
|
||||
onClick={() => setExpanded(!expanded)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{expanded && (
|
||||
<>
|
||||
<div className={classnames('card--inline', `claim-search__menus`)}>
|
||||
{/* FRESHNESS FIELD */}
|
||||
{orderParam === CS.ORDER_BY_TOP && (
|
||||
<div className={'claim-search__input-container'}>
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected': freshnessParam !== defaultFreshness,
|
||||
})}
|
||||
type="select"
|
||||
name="trending_time"
|
||||
label={__('How Fresh')}
|
||||
value={freshnessParam}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.FRESH_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{CS.FRESH_TYPES.map(time => (
|
||||
<option key={time} value={time}>
|
||||
{/* i18fixme */}
|
||||
{time === CS.FRESH_DAY && __('Today')}
|
||||
{time !== CS.FRESH_ALL &&
|
||||
time !== CS.FRESH_DEFAULT &&
|
||||
time !== CS.FRESH_DAY &&
|
||||
__('This ' + toCapitalCase(time)) /* yes, concat before i18n, since it is read from const */}
|
||||
{time === CS.FRESH_ALL && __('All time')}
|
||||
{time === CS.FRESH_DEFAULT && __('Default')}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* CONTENT_TYPES FIELD */}
|
||||
{!claimType && (
|
||||
<div
|
||||
className={classnames('claim-search__input-container', {
|
||||
'claim-search__input-container--selected': contentTypeParam,
|
||||
})}
|
||||
>
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected': contentTypeParam,
|
||||
})}
|
||||
type="select"
|
||||
name="claimType"
|
||||
label={__('Content Type')}
|
||||
value={contentTypeParam || CS.CONTENT_ALL}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.CONTENT_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{CS.CONTENT_TYPES.map(type => {
|
||||
if (type !== CS.CLAIM_CHANNEL || (type === CS.CLAIM_CHANNEL && !channelIdsParam)) {
|
||||
return (
|
||||
<option key={type} value={type}>
|
||||
{/* i18fixme */}
|
||||
{type === CS.CLAIM_CHANNEL && __('Channel')}
|
||||
{type === CS.CLAIM_REPOST && __('Repost')}
|
||||
{type === CS.FILE_VIDEO && __('Video')}
|
||||
{type === CS.FILE_AUDIO && __('Audio')}
|
||||
{type === CS.FILE_IMAGE && __('Image')}
|
||||
{type === CS.FILE_MODEL && __('Model')}
|
||||
{type === CS.FILE_BINARY && __('Other')}
|
||||
{type === CS.FILE_DOCUMENT && __('Document')}
|
||||
{type === CS.CONTENT_ALL && __('Any')}
|
||||
</option>
|
||||
);
|
||||
}
|
||||
})}
|
||||
</FormField>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* DURATIONS FIELD */}
|
||||
{showDuration && (
|
||||
<div className={'claim-search__input-container'}>
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected': durationParam,
|
||||
})}
|
||||
label={__('Duration')}
|
||||
type="select"
|
||||
name="duration"
|
||||
disabled={
|
||||
!(
|
||||
contentTypeParam === null ||
|
||||
streamTypeParam === CS.FILE_AUDIO ||
|
||||
streamTypeParam === CS.FILE_VIDEO
|
||||
)
|
||||
}
|
||||
value={durationParam || CS.DURATION_ALL}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.DURATION_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{CS.DURATION_TYPES.map(dur => (
|
||||
<option key={dur} value={dur}>
|
||||
{/* i18fixme */}
|
||||
{dur === CS.DURATION_SHORT && __('Short')}
|
||||
{dur === CS.DURATION_LONG && __('Long')}
|
||||
{dur === CS.DURATION_ALL && __('Any')}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* TAGS FIELD */}
|
||||
{!tags && (
|
||||
<div className={'claim-search__input-container'}>
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected':
|
||||
((!defaultTags || defaultTags === CS.TAGS_ALL) && tagsParam && tagsParam !== CS.TAGS_ALL) ||
|
||||
(defaultTags === CS.TAGS_FOLLOWED && tagsParam !== CS.TAGS_FOLLOWED),
|
||||
})}
|
||||
label={__('Tags')}
|
||||
type="select"
|
||||
name="tags"
|
||||
value={tagsParam || CS.TAGS_ALL}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.TAGS_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{[
|
||||
CS.TAGS_ALL,
|
||||
CS.TAGS_FOLLOWED,
|
||||
...followed,
|
||||
...(followed.includes(tagsParam) || tagsParam === CS.TAGS_ALL || tagsParam === CS.TAGS_FOLLOWED
|
||||
? []
|
||||
: [tagsParam]), // if they unfollow while filtered, add Other
|
||||
].map(tag => (
|
||||
<option
|
||||
key={tag}
|
||||
value={tag}
|
||||
className={classnames({
|
||||
'claim-search__input-special': !followed.includes(tag),
|
||||
})}
|
||||
>
|
||||
{followed.includes(tag) && typeof tag === 'string' && toCapitalCase(tag)}
|
||||
{tag === CS.TAGS_ALL && __('Any')}
|
||||
{tag === CS.TAGS_FOLLOWED && __('Following')}
|
||||
{!followed.includes(tag) && tag !== CS.TAGS_ALL && tag !== CS.TAGS_FOLLOWED && __('Other')}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* PAID FIELD */}
|
||||
<div className={'claim-search__input-container'}>
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected':
|
||||
feeAmountParam === CS.FEE_AMOUNT_ONLY_FREE || feeAmountParam === CS.FEE_AMOUNT_ONLY_PAID,
|
||||
})}
|
||||
label={__('Price')}
|
||||
type="select"
|
||||
name="paidcontent"
|
||||
value={feeAmountParam}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.FEE_AMOUNT_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
<option value={CS.FEE_AMOUNT_ANY}>{__('Anything')}</option>
|
||||
<option value={CS.FEE_AMOUNT_ONLY_FREE}>{__('Free')}</option>
|
||||
<option value={CS.FEE_AMOUNT_ONLY_PAID}>{__('Paid')}</option>
|
||||
))}
|
||||
</FormField>
|
||||
</div>
|
||||
|
||||
{channelIdsInUrl && (
|
||||
<div className={'claim-search__input-container'}>
|
||||
<label>{__('Advanced Filters from URL')}</label>
|
||||
<Button button="alt" label={__('Clear')} onClick={handleAdvancedReset} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{hasMatureTags && hiddenNsfwMessage}
|
||||
</Fragment>
|
||||
const headerToUse = header || (
|
||||
<ClaimListHeader
|
||||
channelIds={channelIds}
|
||||
defaultTags={defaultTags}
|
||||
tags={tags}
|
||||
freshness={freshness}
|
||||
defaultFreshness={defaultFreshness}
|
||||
claimType={claimType}
|
||||
streamType={streamType}
|
||||
defaultStreamType={defaultStreamType}
|
||||
feeAmount={feeAmount}
|
||||
orderBy={orderBy}
|
||||
defaultOrderBy={defaultOrderBy}
|
||||
hideAdvancedFilter={hideAdvancedFilter}
|
||||
hasMatureTags={hasMatureTags}
|
||||
hiddenNsfwMessage={hiddenNsfwMessage}
|
||||
setPage={setPage}
|
||||
tileLayout={tileLayout}
|
||||
hideFilters={hideFilters}
|
||||
scrollAnchor={scrollAnchor}
|
||||
/>
|
||||
);
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
{headerLabel && <label className="claim-list__header-label">{headerLabel}</label>}
|
||||
<Card
|
||||
title={header || defaultHeader}
|
||||
titleActions={meta && <div className="card__actions--inline">{meta}</div>}
|
||||
isBodyList
|
||||
body={
|
||||
<>
|
||||
<ClaimList
|
||||
isCardBody
|
||||
id={claimSearchCacheQuery}
|
||||
loading={loading}
|
||||
uris={uris || claimSearchResult}
|
||||
onScrollBottom={handleScrollBottom}
|
||||
page={page}
|
||||
pageSize={CS.PAGE_SIZE}
|
||||
timedOutMessage={timedOutMessage}
|
||||
renderProperties={renderProperties}
|
||||
includeSupportAction={includeSupportAction}
|
||||
hideBlock={hideBlock}
|
||||
injectedItem={injectedItem}
|
||||
/>
|
||||
{loading &&
|
||||
new Array(pageSize || CS.PAGE_SIZE).fill(1).map((x, i) => <ClaimPreview key={i} placeholder="loading" />)}
|
||||
</>
|
||||
}
|
||||
/>
|
||||
{tileLayout ? (
|
||||
<div>
|
||||
{!repostedClaimId && (
|
||||
<div className="section__header--actions">
|
||||
{headerToUse}
|
||||
{meta && <div className="section__actions--no-margin">{meta}</div>}
|
||||
</div>
|
||||
)}
|
||||
<ClaimList
|
||||
tileLayout
|
||||
id={claimSearchCacheQuery}
|
||||
loading={loading}
|
||||
uris={uris || claimSearchResult}
|
||||
onScrollBottom={handleScrollBottom}
|
||||
page={page}
|
||||
pageSize={dynamicPageSize}
|
||||
timedOutMessage={timedOutMessage}
|
||||
renderProperties={renderProperties}
|
||||
includeSupportAction={includeSupportAction}
|
||||
injectedItem={injectedItem}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
/>
|
||||
{loading && (
|
||||
<div className="claim-grid">
|
||||
{new Array(dynamicPageSize).fill(1).map((x, i) => (
|
||||
<ClaimPreviewTile key={i} placeholder="loading" />
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
) : (
|
||||
<div>
|
||||
<div className="section__header--actions">
|
||||
{headerToUse}
|
||||
{meta && <div className="section__actions--no-margin">{meta}</div>}
|
||||
</div>
|
||||
|
||||
<ClaimList
|
||||
id={claimSearchCacheQuery}
|
||||
loading={loading}
|
||||
uris={uris || claimSearchResult}
|
||||
onScrollBottom={handleScrollBottom}
|
||||
page={page}
|
||||
pageSize={dynamicPageSize}
|
||||
timedOutMessage={timedOutMessage}
|
||||
renderProperties={renderProperties}
|
||||
includeSupportAction={includeSupportAction}
|
||||
injectedItem={injectedItem}
|
||||
showHiddenByUser={showHiddenByUser}
|
||||
/>
|
||||
{loading && new Array(dynamicPageSize).fill(1).map((x, i) => <ClaimPreview key={i} placeholder="loading" />)}
|
||||
</div>
|
||||
)}
|
||||
</React.Fragment>
|
||||
);
|
||||
}
|
||||
|
||||
22
ui/component/claimListHeader/index.js
Normal file
22
ui/component/claimListHeader/index.js
Normal file
@@ -0,0 +1,22 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { selectFetchingClaimSearch, SETTINGS } from 'lbry-redux';
|
||||
import { selectFollowedTags } from 'redux/selectors/tags';
|
||||
import { doToggleTagFollowDesktop } from 'redux/actions/tags';
|
||||
import { makeSelectClientSetting, selectLanguage } from 'redux/selectors/settings';
|
||||
import { doSetClientSetting } from 'redux/actions/settings';
|
||||
import ClaimListHeader from './view';
|
||||
|
||||
const select = state => ({
|
||||
followedTags: selectFollowedTags(state),
|
||||
loading: selectFetchingClaimSearch(state),
|
||||
showNsfw: makeSelectClientSetting(SETTINGS.SHOW_MATURE)(state),
|
||||
searchInLanguage: makeSelectClientSetting(SETTINGS.SEARCH_IN_LANGUAGE)(state),
|
||||
languageSetting: selectLanguage(state),
|
||||
});
|
||||
|
||||
const perform = {
|
||||
doToggleTagFollowDesktop,
|
||||
doSetClientSetting,
|
||||
};
|
||||
|
||||
export default connect(select, perform)(ClaimListHeader);
|
||||
466
ui/component/claimListHeader/view.jsx
Normal file
466
ui/component/claimListHeader/view.jsx
Normal file
@@ -0,0 +1,466 @@
|
||||
// @flow
|
||||
import { SIMPLE_SITE } from 'config';
|
||||
import * as CS from 'constants/claim_search';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import type { Node } from 'react';
|
||||
import classnames from 'classnames';
|
||||
import React from 'react';
|
||||
import usePersistedState from 'effects/use-persisted-state';
|
||||
import { useHistory } from 'react-router';
|
||||
import { SETTINGS } from 'lbry-redux';
|
||||
import { FormField } from 'component/common/form';
|
||||
import Button from 'component/button';
|
||||
import { toCapitalCase } from 'util/string';
|
||||
import SEARCHABLE_LANGUAGES from 'constants/searchable_languages';
|
||||
|
||||
type Props = {
|
||||
defaultTags: string,
|
||||
freshness?: string,
|
||||
defaultFreshness?: string,
|
||||
claimType?: Array<string>,
|
||||
streamType?: string | Array<string>,
|
||||
defaultStreamType?: string | Array<string>,
|
||||
feeAmount: string,
|
||||
orderBy?: Array<string>,
|
||||
defaultOrderBy?: string,
|
||||
hideAdvancedFilter: boolean,
|
||||
hasMatureTags: boolean,
|
||||
hiddenNsfwMessage?: Node,
|
||||
channelIds?: Array<string>,
|
||||
tileLayout: boolean,
|
||||
doSetClientSetting: (string, boolean, ?boolean) => void,
|
||||
setPage: number => void,
|
||||
hideFilters: boolean,
|
||||
searchInLanguage: boolean,
|
||||
languageSetting: string,
|
||||
scrollAnchor?: string,
|
||||
};
|
||||
|
||||
function ClaimListHeader(props: Props) {
|
||||
const {
|
||||
defaultTags,
|
||||
freshness,
|
||||
defaultFreshness,
|
||||
claimType,
|
||||
streamType,
|
||||
defaultStreamType,
|
||||
feeAmount,
|
||||
orderBy,
|
||||
defaultOrderBy,
|
||||
hideAdvancedFilter,
|
||||
hasMatureTags,
|
||||
hiddenNsfwMessage,
|
||||
channelIds,
|
||||
tileLayout,
|
||||
doSetClientSetting,
|
||||
setPage,
|
||||
hideFilters,
|
||||
searchInLanguage,
|
||||
languageSetting,
|
||||
scrollAnchor,
|
||||
} = props;
|
||||
const { action, push, location } = useHistory();
|
||||
const { search } = location;
|
||||
const [expanded, setExpanded] = usePersistedState(`expanded-${location.pathname}`, false);
|
||||
const [orderParamEntry, setOrderParamEntry] = usePersistedState(`entry-${location.pathname}`, CS.ORDER_BY_TRENDING);
|
||||
const [orderParamUser, setOrderParamUser] = usePersistedState(`orderUser-${location.pathname}`, CS.ORDER_BY_TRENDING);
|
||||
const urlParams = new URLSearchParams(search);
|
||||
const freshnessParam = freshness || urlParams.get(CS.FRESH_KEY) || defaultFreshness;
|
||||
const contentTypeParam = urlParams.get(CS.CONTENT_KEY);
|
||||
const streamTypeParam =
|
||||
streamType || (CS.FILE_TYPES.includes(contentTypeParam) && contentTypeParam) || defaultStreamType || null;
|
||||
const durationParam = urlParams.get(CS.DURATION_KEY) || null;
|
||||
const languageParam = urlParams.get(CS.LANGUAGE_KEY) || null;
|
||||
const channelIdsInUrl = urlParams.get(CS.CHANNEL_IDS_KEY);
|
||||
const channelIdsParam = channelIdsInUrl ? channelIdsInUrl.split(',') : channelIds;
|
||||
const feeAmountParam = urlParams.get('fee_amount') || feeAmount || CS.FEE_AMOUNT_ANY;
|
||||
const showDuration = !(claimType && claimType === CS.CLAIM_CHANNEL);
|
||||
const isFiltered = () =>
|
||||
Boolean(
|
||||
urlParams.get(CS.FRESH_KEY) ||
|
||||
urlParams.get(CS.CONTENT_KEY) ||
|
||||
urlParams.get(CS.DURATION_KEY) ||
|
||||
urlParams.get(CS.TAGS_KEY) ||
|
||||
urlParams.get(CS.FEE_AMOUNT_KEY) ||
|
||||
urlParams.get(CS.LANGUAGE_KEY)
|
||||
);
|
||||
|
||||
const languageValue = searchInLanguage
|
||||
? languageParam === null
|
||||
? languageSetting
|
||||
: languageParam
|
||||
: languageParam === null
|
||||
? CS.LANGUAGES_ALL
|
||||
: languageParam;
|
||||
|
||||
const shouldHighlight = searchInLanguage
|
||||
? languageParam !== languageSetting && languageParam !== null
|
||||
: languageParam !== CS.LANGUAGES_ALL && languageParam !== null;
|
||||
|
||||
React.useEffect(() => {
|
||||
if (action !== 'POP' && isFiltered()) {
|
||||
setExpanded(true);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
let orderParam = orderBy || urlParams.get(CS.ORDER_BY_KEY) || defaultOrderBy;
|
||||
if (!orderParam) {
|
||||
if (action === 'POP') {
|
||||
// Reaching here means user have popped back to the page's entry point (e.g. '/$/tags' without any '?order=').
|
||||
orderParam = orderParamEntry;
|
||||
} else {
|
||||
// This is the direct entry into the page, so we load the user's previous value.
|
||||
orderParam = orderParamUser;
|
||||
}
|
||||
}
|
||||
|
||||
React.useEffect(() => {
|
||||
setOrderParamUser(orderParam);
|
||||
}, [orderParam, setOrderParamUser]);
|
||||
|
||||
React.useEffect(() => {
|
||||
// One-time update to stash the finalized 'orderParam' at entry.
|
||||
if (action !== 'POP') {
|
||||
setOrderParamEntry(orderParam);
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, []);
|
||||
|
||||
function handleChange(change) {
|
||||
const url = buildUrl(change);
|
||||
setPage(1);
|
||||
push(url);
|
||||
}
|
||||
|
||||
function handleAdvancedReset() {
|
||||
const newUrlParams = new URLSearchParams(search);
|
||||
newUrlParams.delete('claim_type');
|
||||
newUrlParams.delete('channel_ids');
|
||||
const newSearch = `?${newUrlParams.toString()}`;
|
||||
|
||||
push(newSearch);
|
||||
}
|
||||
|
||||
function buildUrl(delta) {
|
||||
const newUrlParams = new URLSearchParams(location.search);
|
||||
CS.KEYS.forEach(k => {
|
||||
// $FlowFixMe get() can return null
|
||||
if (urlParams.get(k) !== null) newUrlParams.set(k, urlParams.get(k));
|
||||
});
|
||||
|
||||
switch (delta.key) {
|
||||
case CS.ORDER_BY_KEY:
|
||||
newUrlParams.set(CS.ORDER_BY_KEY, delta.value);
|
||||
break;
|
||||
case CS.FRESH_KEY:
|
||||
if (delta.value === defaultFreshness || delta.value === CS.FRESH_DEFAULT) {
|
||||
newUrlParams.delete(CS.FRESH_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.FRESH_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
case CS.CONTENT_KEY:
|
||||
if (delta.value === CS.CLAIM_CHANNEL || delta.value === CS.CLAIM_REPOST) {
|
||||
newUrlParams.delete(CS.DURATION_KEY);
|
||||
newUrlParams.set(CS.CONTENT_KEY, delta.value);
|
||||
} else if (delta.value === CS.CONTENT_ALL) {
|
||||
newUrlParams.delete(CS.CONTENT_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.CONTENT_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
case CS.DURATION_KEY:
|
||||
if (delta.value === CS.DURATION_ALL) {
|
||||
newUrlParams.delete(CS.DURATION_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.DURATION_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
case CS.LANGUAGE_KEY:
|
||||
newUrlParams.set(CS.LANGUAGE_KEY, delta.value);
|
||||
break;
|
||||
case CS.TAGS_KEY:
|
||||
if (delta.value === CS.TAGS_ALL) {
|
||||
if (defaultTags === CS.TAGS_ALL) {
|
||||
newUrlParams.delete(CS.TAGS_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.TAGS_KEY, delta.value);
|
||||
}
|
||||
} else if (delta.value === CS.TAGS_FOLLOWED) {
|
||||
if (defaultTags === CS.TAGS_FOLLOWED) {
|
||||
newUrlParams.delete(CS.TAGS_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.TAGS_KEY, delta.value); // redundant but special
|
||||
}
|
||||
} else {
|
||||
newUrlParams.set(CS.TAGS_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
case CS.FEE_AMOUNT_KEY:
|
||||
if (delta.value === CS.FEE_AMOUNT_ANY) {
|
||||
newUrlParams.delete(CS.FEE_AMOUNT_KEY);
|
||||
} else {
|
||||
newUrlParams.set(CS.FEE_AMOUNT_KEY, delta.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
return `?${newUrlParams.toString()}` + (scrollAnchor ? '#' + scrollAnchor : '');
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="claim-search__wrapper">
|
||||
<div className="claim-search__top">
|
||||
<div className="claim-search__menu-group">
|
||||
{!hideFilters &&
|
||||
CS.ORDER_BY_TYPES.map(type => (
|
||||
<Button
|
||||
key={type}
|
||||
button="alt"
|
||||
onClick={e =>
|
||||
handleChange({
|
||||
key: CS.ORDER_BY_KEY,
|
||||
value: type,
|
||||
})
|
||||
}
|
||||
className={classnames(`button-toggle button-toggle--${type}`, {
|
||||
'button-toggle--active': orderParam === type,
|
||||
})}
|
||||
disabled={orderBy}
|
||||
icon={toCapitalCase(type)}
|
||||
iconSize={toCapitalCase(type) === ICONS.NEW ? 20 : undefined}
|
||||
label={__(toCapitalCase(type))}
|
||||
/>
|
||||
))}
|
||||
</div>
|
||||
|
||||
<div className="claim-search__menu-group">
|
||||
{!hideAdvancedFilter && !SIMPLE_SITE && (
|
||||
<Button
|
||||
button="alt"
|
||||
aria-label={__('More')}
|
||||
className={classnames(`button-toggle button-toggle--top button-toggle--more`, {
|
||||
'button-toggle--custom': isFiltered(),
|
||||
'button-toggle--active': expanded,
|
||||
})}
|
||||
icon={ICONS.SLIDERS}
|
||||
onClick={() => setExpanded(!expanded)}
|
||||
/>
|
||||
)}
|
||||
|
||||
{tileLayout !== undefined && (
|
||||
<Button
|
||||
onClick={() => {
|
||||
doSetClientSetting(SETTINGS.TILE_LAYOUT, !tileLayout);
|
||||
}}
|
||||
button="alt"
|
||||
className="button-toggle"
|
||||
aria-label={tileLayout ? __('Change to list layout') : __('Change to tile layout')}
|
||||
icon={ICONS.LAYOUT}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
{expanded && !SIMPLE_SITE && (
|
||||
<>
|
||||
<div className={classnames(`card claim-search__menus`)}>
|
||||
{/* FRESHNESS FIELD */}
|
||||
{orderParam === CS.ORDER_BY_TOP && (
|
||||
<div className="claim-search__input-container">
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected': freshnessParam !== defaultFreshness,
|
||||
})}
|
||||
type="select"
|
||||
name="trending_time"
|
||||
label={__('How Fresh')}
|
||||
value={freshnessParam}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.FRESH_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{CS.FRESH_TYPES.map(time => (
|
||||
<option key={time} value={time}>
|
||||
{/* i18fixme */}
|
||||
{time === CS.FRESH_DAY && __('Today')}
|
||||
{time !== CS.FRESH_ALL &&
|
||||
time !== CS.FRESH_DEFAULT &&
|
||||
time !== CS.FRESH_DAY &&
|
||||
__('This ' + toCapitalCase(time)) /* yes, concat before i18n, since it is read from const */}
|
||||
{time === CS.FRESH_ALL && __('All time')}
|
||||
{time === CS.FRESH_DEFAULT && __('Default')}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* CONTENT_TYPES FIELD */}
|
||||
{!claimType && (
|
||||
<div
|
||||
className={classnames('claim-search__input-container', {
|
||||
'claim-search__input-container--selected': contentTypeParam,
|
||||
})}
|
||||
>
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected': contentTypeParam,
|
||||
})}
|
||||
type="select"
|
||||
name="claimType"
|
||||
label={__('Content Type')}
|
||||
value={contentTypeParam || CS.CONTENT_ALL}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.CONTENT_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{CS.CONTENT_TYPES.map(type => {
|
||||
if (type !== CS.CLAIM_CHANNEL || (type === CS.CLAIM_CHANNEL && !channelIdsParam)) {
|
||||
return (
|
||||
<option key={type} value={type}>
|
||||
{/* i18fixme */}
|
||||
{type === CS.CLAIM_CHANNEL && __('Channel')}
|
||||
{type === CS.CLAIM_REPOST && __('Repost')}
|
||||
{type === CS.FILE_VIDEO && __('Video')}
|
||||
{type === CS.FILE_AUDIO && __('Audio')}
|
||||
{type === CS.FILE_IMAGE && __('Image')}
|
||||
{type === CS.FILE_MODEL && __('Model')}
|
||||
{type === CS.FILE_BINARY && __('Other')}
|
||||
{type === CS.FILE_DOCUMENT && __('Document')}
|
||||
{type === CS.CONTENT_ALL && __('Any')}
|
||||
</option>
|
||||
);
|
||||
}
|
||||
})}
|
||||
</FormField>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* LANGUAGE FIELD */}
|
||||
{!claimType && (
|
||||
<div
|
||||
className={classnames('claim-search__input-container', {
|
||||
'claim-search__input-container--selected': shouldHighlight,
|
||||
})}
|
||||
>
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected': shouldHighlight,
|
||||
})}
|
||||
type="select"
|
||||
name="claimType"
|
||||
label={__('Language')}
|
||||
value={languageValue || CS.LANGUAGES_ALL}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.LANGUAGE_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
<option key={CS.LANGUAGES_ALL} value={CS.LANGUAGES_ALL}>
|
||||
{__('Any')}
|
||||
{/* i18fixme */}
|
||||
</option>
|
||||
{Object.entries(SEARCHABLE_LANGUAGES).map(([code, label]) => {
|
||||
return (
|
||||
<option key={code} value={code}>
|
||||
{String(label)}
|
||||
</option>
|
||||
);
|
||||
})}
|
||||
</FormField>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* DURATIONS FIELD */}
|
||||
{showDuration && (
|
||||
<div className={'claim-search__input-container'}>
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected': durationParam,
|
||||
})}
|
||||
label={__('Duration')}
|
||||
type="select"
|
||||
name="duration"
|
||||
disabled={
|
||||
!(
|
||||
contentTypeParam === null ||
|
||||
streamTypeParam === CS.FILE_AUDIO ||
|
||||
streamTypeParam === CS.FILE_VIDEO
|
||||
)
|
||||
}
|
||||
value={durationParam || CS.DURATION_ALL}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.DURATION_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
{CS.DURATION_TYPES.map(dur => (
|
||||
<option key={dur} value={dur}>
|
||||
{/* i18fixme */}
|
||||
{dur === CS.DURATION_SHORT && __('Short (< 4 minutes)')}
|
||||
{dur === CS.DURATION_LONG && __('Long (> 20 min)')}
|
||||
{dur === CS.DURATION_ALL && __('Any')}
|
||||
</option>
|
||||
))}
|
||||
</FormField>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* PAID FIELD */}
|
||||
<div className={'claim-search__input-container'}>
|
||||
<FormField
|
||||
className={classnames('claim-search__dropdown', {
|
||||
'claim-search__dropdown--selected':
|
||||
feeAmountParam === CS.FEE_AMOUNT_ONLY_FREE || feeAmountParam === CS.FEE_AMOUNT_ONLY_PAID,
|
||||
})}
|
||||
label={__('Price')}
|
||||
type="select"
|
||||
name="paidcontent"
|
||||
value={feeAmountParam}
|
||||
onChange={e =>
|
||||
handleChange({
|
||||
key: CS.FEE_AMOUNT_KEY,
|
||||
value: e.target.value,
|
||||
})
|
||||
}
|
||||
>
|
||||
<option value={CS.FEE_AMOUNT_ANY}>{__('Any')}</option>
|
||||
<option value={CS.FEE_AMOUNT_ONLY_FREE}>{__('Free')}</option>
|
||||
<option value={CS.FEE_AMOUNT_ONLY_PAID}>{__('Paid')}</option>
|
||||
))}
|
||||
</FormField>
|
||||
</div>
|
||||
|
||||
{channelIdsInUrl && (
|
||||
<div className={'claim-search__input-container'}>
|
||||
<label>{__('Advanced Filters from URL')}</label>
|
||||
<Button
|
||||
button="alt"
|
||||
className="claim-search__filter-button"
|
||||
label={__('Clear')}
|
||||
onClick={handleAdvancedReset}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{hasMatureTags && hiddenNsfwMessage}
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
||||
export default ClaimListHeader;
|
||||
20
ui/component/claimMenuList/index.js
Normal file
20
ui/component/claimMenuList/index.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import { connect } from 'react-redux';
|
||||
import { makeSelectClaimForUri, makeSelectClaimIsMine } from 'lbry-redux';
|
||||
import { makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { doToggleMuteChannel } from 'redux/actions/blocked';
|
||||
import { doCommentModBlock, doCommentModUnBlock } from 'redux/actions/comments';
|
||||
import { makeSelectChannelIsBlocked } from 'redux/selectors/comments';
|
||||
import ClaimPreview from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
claim: makeSelectClaimForUri(props.uri)(state),
|
||||
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
|
||||
channelIsMuted: makeSelectChannelIsMuted(props.uri)(state),
|
||||
channelIsBlocked: makeSelectChannelIsBlocked(props.uri)(state),
|
||||
});
|
||||
|
||||
export default connect(select, {
|
||||
doToggleMuteChannel,
|
||||
doCommentModBlock,
|
||||
doCommentModUnBlock,
|
||||
})(ClaimPreview);
|
||||
120
ui/component/claimMenuList/view.jsx
Normal file
120
ui/component/claimMenuList/view.jsx
Normal file
@@ -0,0 +1,120 @@
|
||||
// @flow
|
||||
import { URL, SHARE_DOMAIN_URL } from 'config';
|
||||
import * as ICONS from 'constants/icons';
|
||||
import React from 'react';
|
||||
import classnames from 'classnames';
|
||||
import { Menu, MenuButton, MenuList, MenuItem } from '@reach/menu-button';
|
||||
import Icon from 'component/common/icon';
|
||||
import { generateShareUrl } from 'util/url';
|
||||
|
||||
const SHARE_DOMAIN = SHARE_DOMAIN_URL || URL;
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
claim: ?Claim,
|
||||
inline?: boolean,
|
||||
claimIsMine: boolean,
|
||||
channelIsMuted: boolean,
|
||||
channelIsBlocked: boolean,
|
||||
doToggleMuteChannel: (string) => void,
|
||||
doCommentModBlock: (string) => void,
|
||||
doCommentModUnBlock: (string) => void,
|
||||
};
|
||||
|
||||
function ClaimMenuList(props: Props) {
|
||||
const {
|
||||
uri,
|
||||
claim,
|
||||
inline = false,
|
||||
claimIsMine,
|
||||
doToggleMuteChannel,
|
||||
channelIsMuted,
|
||||
channelIsBlocked,
|
||||
doCommentModBlock,
|
||||
doCommentModUnBlock,
|
||||
} = props;
|
||||
const channelUri =
|
||||
claim &&
|
||||
(claim.value_type === 'channel'
|
||||
? claim.permanent_url
|
||||
: claim.signing_channel && claim.signing_channel.permanent_url);
|
||||
|
||||
const shareUrl: string = generateShareUrl(SHARE_DOMAIN, uri);
|
||||
|
||||
if (!channelUri || !claim) {
|
||||
return null;
|
||||
}
|
||||
|
||||
function handleToggleMute() {
|
||||
doToggleMuteChannel(channelUri);
|
||||
}
|
||||
|
||||
function handleToggleBlock() {
|
||||
if (channelIsBlocked) {
|
||||
doCommentModUnBlock(channelUri);
|
||||
} else {
|
||||
doCommentModBlock(channelUri);
|
||||
}
|
||||
}
|
||||
|
||||
function handleCopyLink() {
|
||||
navigator.clipboard.writeText(shareUrl);
|
||||
}
|
||||
|
||||
function handleReportContent() {
|
||||
window.open(`https://lbry.com/dmca/${claim.claim_id}`, '_blank', 'noopener');
|
||||
}
|
||||
|
||||
return (
|
||||
<Menu>
|
||||
<MenuButton
|
||||
className={classnames('menu__button', { 'claim__menu-button': !inline, 'claim__menu-button--inline': inline })}
|
||||
onClick={(e) => {
|
||||
e.stopPropagation();
|
||||
e.preventDefault();
|
||||
}}
|
||||
>
|
||||
<Icon size={20} icon={ICONS.MORE_VERTICAL} />
|
||||
</MenuButton>
|
||||
<MenuList className="menu__list">
|
||||
{!claimIsMine && (
|
||||
<>
|
||||
<MenuItem className="comment__menu-option" onSelect={handleToggleBlock}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.BLOCK} />
|
||||
{channelIsBlocked ? __('Unblock Channel') : __('Block Channel')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
|
||||
<MenuItem className="comment__menu-option" onSelect={handleToggleMute}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.MUTE} />
|
||||
{channelIsMuted ? __('Unmute Channel') : __('Mute Channel')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
|
||||
<hr className="menu__separator" />
|
||||
</>
|
||||
)}
|
||||
|
||||
<MenuItem className="comment__menu-option" onSelect={handleCopyLink}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.SHARE} />
|
||||
{__('Copy Link')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
|
||||
{!claimIsMine && (
|
||||
<MenuItem className="comment__menu-option" onSelect={handleReportContent}>
|
||||
<div className="menu__link">
|
||||
<Icon aria-hidden icon={ICONS.REPORT} />
|
||||
{__('Report Content')}
|
||||
</div>
|
||||
</MenuItem>
|
||||
)}
|
||||
</MenuList>
|
||||
</Menu>
|
||||
);
|
||||
}
|
||||
|
||||
export default ClaimMenuList;
|
||||
30
ui/component/claimPreview/claim-preview-loading.jsx
Normal file
30
ui/component/claimPreview/claim-preview-loading.jsx
Normal file
@@ -0,0 +1,30 @@
|
||||
// @flow
|
||||
import classnames from 'classnames';
|
||||
import React from 'react';
|
||||
|
||||
type Props = {
|
||||
isChannel: boolean,
|
||||
type: string,
|
||||
};
|
||||
|
||||
function ClaimPreviewLoading(props: Props) {
|
||||
const { isChannel, type } = props;
|
||||
return (
|
||||
<li
|
||||
className={classnames('claim-preview__wrapper', {
|
||||
'claim-preview__wrapper--channel': isChannel && type !== 'inline',
|
||||
'claim-preview__wrapper--inline': type === 'inline',
|
||||
})}
|
||||
>
|
||||
<div className={classnames('claim-preview', { 'claim-preview--large': type === 'large' })}>
|
||||
<div className="placeholder media__thumb" />
|
||||
<div className="placeholder__wrapper">
|
||||
<div className="placeholder claim-preview__title" />
|
||||
<div className="placeholder media__subtitle" />
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
export default ClaimPreviewLoading;
|
||||
32
ui/component/claimPreview/claim-preview-no-content.jsx
Normal file
32
ui/component/claimPreview/claim-preview-no-content.jsx
Normal file
@@ -0,0 +1,32 @@
|
||||
// @flow
|
||||
import classnames from 'classnames';
|
||||
import React from 'react';
|
||||
import Empty from 'component/common/empty';
|
||||
|
||||
type Props = {
|
||||
isChannel: boolean,
|
||||
type: string,
|
||||
};
|
||||
|
||||
function ClaimPreviewNoContent(props: Props) {
|
||||
const { isChannel, type } = props;
|
||||
return (
|
||||
<li
|
||||
className={classnames('claim-preview__wrapper', {
|
||||
'claim-preview__wrapper--channel': isChannel && type !== 'inline',
|
||||
'claim-preview__wrapper--inline': type === 'inline',
|
||||
})}
|
||||
>
|
||||
<div
|
||||
className={classnames('claim-preview claim-preview--inactive', {
|
||||
'claim-preview--large': type === 'large',
|
||||
'claim-preview__empty': true,
|
||||
})}
|
||||
>
|
||||
<Empty text={__('Nothing found here. Like big tech ethics.')} />
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
export default ClaimPreviewNoContent;
|
||||
33
ui/component/claimPreview/claim-preview-no-mature.jsx
Normal file
33
ui/component/claimPreview/claim-preview-no-mature.jsx
Normal file
@@ -0,0 +1,33 @@
|
||||
// @flow
|
||||
import classnames from 'classnames';
|
||||
import React from 'react';
|
||||
import Empty from 'component/common/empty';
|
||||
|
||||
type Props = {
|
||||
isChannel: boolean,
|
||||
type: string,
|
||||
message: string,
|
||||
};
|
||||
|
||||
function ClaimPreviewHidden(props: Props) {
|
||||
const { isChannel, type, message } = props;
|
||||
return (
|
||||
<li
|
||||
className={classnames('claim-preview__wrapper', {
|
||||
'claim-preview__wrapper--channel': isChannel && type !== 'inline',
|
||||
'claim-preview__wrapper--inline': type === 'inline',
|
||||
})}
|
||||
>
|
||||
<div
|
||||
className={classnames('claim-preview claim-preview--inactive claim-preview--empty', {
|
||||
'claim-preview--large': type === 'large',
|
||||
})}
|
||||
>
|
||||
<div className="media__thumb" />
|
||||
<Empty text={message} />
|
||||
</div>
|
||||
</li>
|
||||
);
|
||||
}
|
||||
|
||||
export default ClaimPreviewHidden;
|
||||
@@ -5,43 +5,44 @@ import {
|
||||
makeSelectIsUriResolving,
|
||||
makeSelectClaimIsMine,
|
||||
makeSelectClaimIsPending,
|
||||
makeSelectCoverForUri,
|
||||
makeSelectClaimIsNsfw,
|
||||
selectBlockedChannels,
|
||||
selectChannelIsBlocked,
|
||||
doFileGet,
|
||||
makeSelectReflectingClaimForUri,
|
||||
makeSelectClaimWasPurchased,
|
||||
makeSelectStreamingUrlForUri,
|
||||
} from 'lbry-redux';
|
||||
import { selectMutedChannels, makeSelectChannelIsMuted } from 'redux/selectors/blocked';
|
||||
import { selectBlackListedOutpoints, selectFilteredOutpoints } from 'lbryinc';
|
||||
import { selectShowMatureContent } from 'redux/selectors/settings';
|
||||
import { makeSelectHasVisitedUri } from 'redux/selectors/content';
|
||||
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
|
||||
import { selectModerationBlockList } from 'redux/selectors/comments';
|
||||
import ClaimPreview from './view';
|
||||
|
||||
const select = (state, props) => ({
|
||||
pending: props.uri && makeSelectClaimIsPending(props.uri)(state),
|
||||
claim: props.uri && makeSelectClaimForUri(props.uri)(state),
|
||||
reflectingInfo: props.uri && makeSelectReflectingClaimForUri(props.uri)(state),
|
||||
obscureNsfw: !selectShowMatureContent(state),
|
||||
reflectingProgress: props.uri && makeSelectReflectingClaimForUri(props.uri)(state),
|
||||
obscureNsfw: selectShowMatureContent(state) === false,
|
||||
claimIsMine: props.uri && makeSelectClaimIsMine(props.uri)(state),
|
||||
isResolvingUri: props.uri && makeSelectIsUriResolving(props.uri)(state),
|
||||
cover: props.uri && makeSelectCoverForUri(props.uri)(state),
|
||||
isResolvingRepost: props.uri && makeSelectIsUriResolving(props.repostUrl)(state),
|
||||
repostClaim: props.uri && makeSelectClaimForUri(props.uri)(state),
|
||||
nsfw: props.uri && makeSelectClaimIsNsfw(props.uri)(state),
|
||||
blackListedOutpoints: selectBlackListedOutpoints(state),
|
||||
filteredOutpoints: selectFilteredOutpoints(state),
|
||||
blockedChannelUris: selectBlockedChannels(state),
|
||||
mutedUris: selectMutedChannels(state),
|
||||
blockedUris: selectModerationBlockList(state),
|
||||
hasVisitedUri: props.uri && makeSelectHasVisitedUri(props.uri)(state),
|
||||
channelIsBlocked: props.uri && selectChannelIsBlocked(props.uri)(state),
|
||||
channelIsBlocked: props.uri && makeSelectChannelIsMuted(props.uri)(state),
|
||||
isSubscribed: props.uri && makeSelectIsSubscribed(props.uri, true)(state),
|
||||
streamingUrl: props.uri && makeSelectStreamingUrlForUri(props.uri)(state),
|
||||
wasPurchased: props.uri && makeSelectClaimWasPurchased(props.uri)(state),
|
||||
});
|
||||
|
||||
const perform = dispatch => ({
|
||||
resolveUri: uri => dispatch(doResolveUri(uri)),
|
||||
getFile: uri => dispatch(doFileGet(uri, false)),
|
||||
const perform = (dispatch) => ({
|
||||
resolveUri: (uri) => dispatch(doResolveUri(uri)),
|
||||
getFile: (uri) => dispatch(doFileGet(uri, false)),
|
||||
});
|
||||
|
||||
export default connect(select, perform)(ClaimPreview);
|
||||
|
||||
@@ -3,8 +3,7 @@ import type { Node } from 'react';
|
||||
import React, { useEffect, forwardRef } from 'react';
|
||||
import { NavLink, withRouter } from 'react-router-dom';
|
||||
import classnames from 'classnames';
|
||||
import { parseURI, convertToShareLink } from 'lbry-redux';
|
||||
import { openCopyLinkMenu } from 'util/context-menu';
|
||||
import { parseURI } from 'lbry-redux';
|
||||
import { formatLbryUrlForWeb } from 'util/url';
|
||||
import { isEmpty } from 'util/object';
|
||||
import FileThumbnail from 'component/fileThumbnail';
|
||||
@@ -13,7 +12,6 @@ import FileProperties from 'component/fileProperties';
|
||||
import ClaimTags from 'component/claimTags';
|
||||
import SubscribeButton from 'component/subscribeButton';
|
||||
import ChannelThumbnail from 'component/channelThumbnail';
|
||||
import BlockButton from 'component/blockButton';
|
||||
import ClaimSupportButton from 'component/claimSupportButton';
|
||||
import useGetThumbnail from 'effects/use-get-thumbnail';
|
||||
import ClaimPreviewTitle from 'component/claimPreviewTitle';
|
||||
@@ -22,6 +20,10 @@ import ClaimRepostAuthor from 'component/claimRepostAuthor';
|
||||
import FileDownloadLink from 'component/fileDownloadLink';
|
||||
import AbandonedChannelPreview from 'component/abandonedChannelPreview';
|
||||
import PublishPending from 'component/publishPending';
|
||||
import ClaimMenuList from 'component/claimMenuList';
|
||||
import ClaimPreviewLoading from './claim-preview-loading';
|
||||
import ClaimPreviewHidden from './claim-preview-no-mature';
|
||||
import ClaimPreviewNoContent from './claim-preview-no-content';
|
||||
|
||||
type Props = {
|
||||
uri: string,
|
||||
@@ -30,10 +32,10 @@ type Props = {
|
||||
showUserBlocked: boolean,
|
||||
claimIsMine: boolean,
|
||||
pending?: boolean,
|
||||
reflectingInfo?: any, // fxme
|
||||
resolveUri: string => void,
|
||||
reflectingProgress?: any, // fxme
|
||||
resolveUri: (string) => void,
|
||||
isResolvingUri: boolean,
|
||||
history: { push: string => void },
|
||||
history: { push: (string) => void },
|
||||
title: string,
|
||||
nsfw: boolean,
|
||||
placeholder: string,
|
||||
@@ -47,56 +49,80 @@ type Props = {
|
||||
txid: string,
|
||||
nout: number,
|
||||
}>,
|
||||
blockedChannelUris: Array<string>,
|
||||
mutedUris: Array<string>,
|
||||
blockedUris: Array<string>,
|
||||
channelIsBlocked: boolean,
|
||||
isSubscribed: boolean,
|
||||
actions: boolean | Node | string | number,
|
||||
properties: boolean | Node | string | number | (Claim => Node),
|
||||
onClick?: any => any,
|
||||
hideBlock?: boolean,
|
||||
properties: boolean | Node | string | number | ((Claim) => Node),
|
||||
empty?: Node,
|
||||
onClick?: (any) => any,
|
||||
streamingUrl: ?string,
|
||||
getFile: string => void,
|
||||
customShouldHide?: Claim => boolean,
|
||||
getFile: (string) => void,
|
||||
customShouldHide?: (Claim) => boolean,
|
||||
showUnresolvedClaim?: boolean,
|
||||
showNullPlaceholder?: boolean,
|
||||
includeSupportAction?: boolean,
|
||||
hideActions?: boolean,
|
||||
renderActions?: (Claim) => ?Node,
|
||||
wrapperElement?: string,
|
||||
hideRepostLabel?: boolean,
|
||||
repostUrl?: string,
|
||||
hideMenu?: boolean,
|
||||
};
|
||||
|
||||
const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
const {
|
||||
obscureNsfw,
|
||||
claimIsMine,
|
||||
pending,
|
||||
reflectingInfo,
|
||||
history,
|
||||
// core
|
||||
uri,
|
||||
isResolvingUri,
|
||||
nsfw,
|
||||
resolveUri,
|
||||
claim,
|
||||
placeholder,
|
||||
type,
|
||||
blackListedOutpoints,
|
||||
filteredOutpoints,
|
||||
blockedChannelUris,
|
||||
hasVisitedUri,
|
||||
showUserBlocked,
|
||||
isResolvingUri,
|
||||
// core actions
|
||||
getFile,
|
||||
resolveUri,
|
||||
// claim properties
|
||||
// is the claim consider nsfw?
|
||||
nsfw,
|
||||
claimIsMine,
|
||||
streamingUrl,
|
||||
// user properties
|
||||
channelIsBlocked,
|
||||
isSubscribed,
|
||||
actions,
|
||||
hasVisitedUri,
|
||||
// component
|
||||
history,
|
||||
wrapperElement,
|
||||
type,
|
||||
placeholder,
|
||||
// pending
|
||||
reflectingProgress,
|
||||
pending,
|
||||
empty,
|
||||
// modifiers
|
||||
customShouldHide,
|
||||
showNullPlaceholder,
|
||||
// value from show mature content user setting
|
||||
// true if the user doesn't wanna see nsfw content
|
||||
obscureNsfw,
|
||||
showUserBlocked,
|
||||
showUnresolvedClaim,
|
||||
hideRepostLabel = false,
|
||||
hideActions = false,
|
||||
properties,
|
||||
onClick,
|
||||
hideBlock,
|
||||
getFile,
|
||||
streamingUrl,
|
||||
customShouldHide,
|
||||
showUnresolvedClaim,
|
||||
actions,
|
||||
mutedUris,
|
||||
blockedUris,
|
||||
blackListedOutpoints,
|
||||
filteredOutpoints,
|
||||
includeSupportAction,
|
||||
renderActions,
|
||||
hideMenu = false,
|
||||
// repostUrl,
|
||||
} = props;
|
||||
const WrapperElement = wrapperElement || 'li';
|
||||
const shouldFetch =
|
||||
claim === undefined || (claim !== null && claim.value_type === 'channel' && isEmpty(claim.meta) && !pending);
|
||||
const abandoned = !isResolvingUri && !claim;
|
||||
const showPublishLink = abandoned && !showUnresolvedClaim && placeholder === 'publish';
|
||||
const hideActions = type === 'small' || type === 'tooltip';
|
||||
const shouldHideActions = hideActions || type === 'small' || type === 'tooltip';
|
||||
const canonicalUrl = claim && claim.canonical_url;
|
||||
let isValid = false;
|
||||
if (uri) {
|
||||
@@ -107,25 +133,27 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
isValid = false;
|
||||
}
|
||||
}
|
||||
const isRepost = claim && claim.repost_url;
|
||||
|
||||
const isChannel = isValid ? parseURI(uri).isChannel : false;
|
||||
const contentUri = claim && isRepost ? claim.canonical_url || claim.permanent_url : uri;
|
||||
const isChannelUri = isValid ? parseURI(contentUri).isChannel : false;
|
||||
const signingChannel = claim && claim.signing_channel;
|
||||
const navigateUrl = formatLbryUrlForWeb((claim && claim.canonical_url) || uri || '/');
|
||||
const navLinkProps = {
|
||||
to: navigateUrl,
|
||||
onClick: e => e.stopPropagation(),
|
||||
onClick: (e) => e.stopPropagation(),
|
||||
};
|
||||
|
||||
// do not block abandoned and nsfw claims if showUserBlocked is passed
|
||||
let shouldHide =
|
||||
placeholder !== 'loading' &&
|
||||
!showUserBlocked &&
|
||||
((abandoned && !showUnresolvedClaim && !showPublishLink) || (!claimIsMine && obscureNsfw && nsfw));
|
||||
((abandoned && !showUnresolvedClaim) || (!claimIsMine && obscureNsfw && nsfw));
|
||||
|
||||
// This will be replaced once blocking is done at the wallet server level
|
||||
if (claim && !claimIsMine && !shouldHide && blackListedOutpoints) {
|
||||
shouldHide = blackListedOutpoints.some(
|
||||
outpoint =>
|
||||
(outpoint) =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
@@ -134,19 +162,17 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
// or signing channel outpoint is in the filter list
|
||||
if (claim && !claimIsMine && !shouldHide && filteredOutpoints) {
|
||||
shouldHide = filteredOutpoints.some(
|
||||
outpoint =>
|
||||
(outpoint) =>
|
||||
(signingChannel && outpoint.txid === signingChannel.txid && outpoint.nout === signingChannel.nout) ||
|
||||
(outpoint.txid === claim.txid && outpoint.nout === claim.nout)
|
||||
);
|
||||
}
|
||||
// block stream claims
|
||||
if (claim && !shouldHide && !showUserBlocked && blockedChannelUris.length && signingChannel) {
|
||||
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === signingChannel.permanent_url);
|
||||
if (claim && !shouldHide && !showUserBlocked && mutedUris.length && signingChannel) {
|
||||
shouldHide = mutedUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
|
||||
}
|
||||
// block channel claims if we can't control for them in claim search
|
||||
// e.g. fetchRecommendedSubscriptions
|
||||
if (claim && isChannel && !shouldHide && !showUserBlocked && blockedChannelUris.length) {
|
||||
shouldHide = blockedChannelUris.some(blockedUri => blockedUri === claim.permanent_url);
|
||||
if (claim && !shouldHide && !showUserBlocked && blockedUris.length && signingChannel) {
|
||||
shouldHide = blockedUris.some((blockedUri) => blockedUri === signingChannel.permanent_url);
|
||||
}
|
||||
|
||||
if (!shouldHide && customShouldHide && claim) {
|
||||
@@ -157,18 +183,7 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
|
||||
// Weird placement warning
|
||||
// Make sure this happens after we figure out if this claim needs to be hidden
|
||||
const thumbnailUrl = useGetThumbnail(uri, claim, streamingUrl, getFile, shouldHide);
|
||||
|
||||
function handleContextMenu(e) {
|
||||
// @if TARGET='app'
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
if (claim) {
|
||||
const shareLink = convertToShareLink(claim.canonical_url || claim.permanent_url);
|
||||
openCopyLinkMenu(shareLink.replace(/#/g, ':'), e);
|
||||
}
|
||||
// @endif
|
||||
}
|
||||
const thumbnailUrl = useGetThumbnail(contentUri, claim, streamingUrl, getFile, shouldHide);
|
||||
|
||||
function handleOnClick(e) {
|
||||
if (onClick) {
|
||||
@@ -184,51 +199,53 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
if (isValid && !isResolvingUri && shouldFetch && uri) {
|
||||
resolveUri(uri);
|
||||
}
|
||||
}, [isValid, isResolvingUri, uri, resolveUri, shouldFetch]);
|
||||
}, [isValid, uri, isResolvingUri, shouldFetch, resolveUri]);
|
||||
|
||||
if (shouldHide) {
|
||||
if (shouldHide && !showNullPlaceholder) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (placeholder === 'loading' || claim === undefined || (isResolvingUri && !claim)) {
|
||||
if (placeholder === 'loading' || (uri && !claim && isResolvingUri)) {
|
||||
return <ClaimPreviewLoading isChannel={isChannelUri} type={type} />;
|
||||
}
|
||||
|
||||
if (claim && showNullPlaceholder && shouldHide && nsfw && obscureNsfw) {
|
||||
return (
|
||||
<li
|
||||
disabled
|
||||
className={classnames('claim-preview__wrapper', {
|
||||
'claim-preview__wrapper--channel': isChannel && type !== 'inline',
|
||||
'claim-preview__wrapper--inline': type === 'inline',
|
||||
})}
|
||||
>
|
||||
<div className={classnames('claim-preview', { 'claim-preview--large': type === 'large' })}>
|
||||
<div className="placeholder media__thumb" />
|
||||
<div className="placeholder__wrapper">
|
||||
<div className="placeholder claim-preview__title" />
|
||||
<div className="placeholder media__subtitle" />
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
<ClaimPreviewHidden
|
||||
message={__('Mature content hidden by your preferences')}
|
||||
isChannel={isChannelUri}
|
||||
type={type}
|
||||
/>
|
||||
);
|
||||
}
|
||||
if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && claim === null) {
|
||||
return <AbandonedChannelPreview uri={uri} type />;
|
||||
|
||||
if (claim && showNullPlaceholder && shouldHide) {
|
||||
return <ClaimPreviewHidden message={__('This content is hidden')} isChannel={isChannelUri} type={type} />;
|
||||
}
|
||||
if (placeholder === 'publish' && !claim && uri.startsWith('lbry://@')) {
|
||||
|
||||
if (!claim && (showNullPlaceholder || empty)) {
|
||||
return empty || <ClaimPreviewNoContent isChannel={isChannelUri} type={type} />;
|
||||
}
|
||||
|
||||
if (!shouldFetch && showUnresolvedClaim && !isResolvingUri && claim === null) {
|
||||
return <AbandonedChannelPreview uri={contentUri} type />;
|
||||
}
|
||||
if (placeholder === 'publish' && !claim && contentUri.startsWith('lbry://@')) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<li
|
||||
<WrapperElement
|
||||
ref={ref}
|
||||
role="link"
|
||||
onClick={pending || type === 'inline' ? undefined : handleOnClick}
|
||||
onContextMenu={handleContextMenu}
|
||||
className={classnames('claim-preview__wrapper', {
|
||||
'claim-preview__wrapper--channel': isChannel && type !== 'inline',
|
||||
'claim-preview__wrapper--channel': isChannelUri && type !== 'inline',
|
||||
'claim-preview__wrapper--inline': type === 'inline',
|
||||
'claim-preview__wrapper--small': type === 'small',
|
||||
})}
|
||||
>
|
||||
<ClaimRepostAuthor uri={uri} />
|
||||
{!hideRepostLabel && <ClaimRepostAuthor uri={uri} />}
|
||||
|
||||
<div
|
||||
className={classnames('claim-preview', {
|
||||
@@ -236,18 +253,18 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
'claim-preview--large': type === 'large',
|
||||
'claim-preview--inline': type === 'inline',
|
||||
'claim-preview--tooltip': type === 'tooltip',
|
||||
'claim-preview--channel': isChannel,
|
||||
'claim-preview--visited': !isChannel && !claimIsMine && hasVisitedUri,
|
||||
'claim-preview--channel': isChannelUri,
|
||||
'claim-preview--visited': !isChannelUri && !claimIsMine && hasVisitedUri,
|
||||
'claim-preview--pending': pending,
|
||||
})}
|
||||
>
|
||||
{isChannel && claim ? (
|
||||
<UriIndicator uri={uri} link>
|
||||
<ChannelThumbnail uri={uri} obscure={channelIsBlocked} />
|
||||
{isChannelUri && claim ? (
|
||||
<UriIndicator uri={contentUri} link>
|
||||
<ChannelThumbnail uri={contentUri} />
|
||||
</UriIndicator>
|
||||
) : (
|
||||
<>
|
||||
{showPublishLink ? null : !pending ? (
|
||||
{!pending ? (
|
||||
<NavLink {...navLinkProps}>
|
||||
<FileThumbnail thumbnail={thumbnailUrl}>
|
||||
{/* @if TARGET='app' */}
|
||||
@@ -257,6 +274,11 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
</div>
|
||||
)}
|
||||
{/* @endif */}
|
||||
{!isRepost && !isChannelUri && (
|
||||
<div className="claim-preview__file-property-overlay">
|
||||
<FileProperties uri={contentUri} small />
|
||||
</div>
|
||||
)}
|
||||
</FileThumbnail>
|
||||
</NavLink>
|
||||
) : (
|
||||
@@ -269,32 +291,39 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
<div className="claim-preview-metadata">
|
||||
<div className="claim-preview-info">
|
||||
{pending ? (
|
||||
<ClaimPreviewTitle uri={uri} />
|
||||
<ClaimPreviewTitle uri={contentUri} />
|
||||
) : (
|
||||
<NavLink {...navLinkProps}>
|
||||
<ClaimPreviewTitle uri={uri} />
|
||||
</NavLink>
|
||||
)}
|
||||
|
||||
{!isChannel && <FileProperties uri={uri} />}
|
||||
{/* {type !== 'small' && !isChannelUri && signingChannel && SIMPLE_SITE && (
|
||||
<ChannelThumbnail uri={signingChannel.permanent_url} />
|
||||
)} */}
|
||||
</div>
|
||||
<ClaimPreviewSubtitle uri={uri} type={type} />
|
||||
{(pending || !!reflectingInfo) && <PublishPending uri={uri} />}
|
||||
{(pending || !!reflectingProgress) && <PublishPending uri={uri} />}
|
||||
</div>
|
||||
{type !== 'small' && (
|
||||
<div className="claim-preview__actions">
|
||||
{!pending && (
|
||||
<>
|
||||
{hideActions ? null : actions !== undefined ? (
|
||||
{renderActions && claim && renderActions(claim)}
|
||||
{shouldHideActions || renderActions ? null : actions !== undefined ? (
|
||||
actions
|
||||
) : (
|
||||
<div className="claim-preview__primary-actions">
|
||||
{isChannel && !channelIsBlocked && !claimIsMine && (
|
||||
<SubscribeButton uri={uri.startsWith('lbry://') ? uri : `lbry://${uri}`} />
|
||||
{!isChannelUri && signingChannel && (
|
||||
<div className="claim-preview__channel-staked">
|
||||
<ChannelThumbnail uri={signingChannel.permanent_url} />
|
||||
</div>
|
||||
)}
|
||||
{!hideBlock && isChannel && !isSubscribed && !claimIsMine && (
|
||||
<BlockButton uri={uri.startsWith('lbry://') ? uri : `lbry://${uri}`} />
|
||||
|
||||
{isChannelUri && !channelIsBlocked && !claimIsMine && (
|
||||
<SubscribeButton uri={contentUri.startsWith('lbry://') ? contentUri : `lbry://${contentUri}`} />
|
||||
)}
|
||||
|
||||
{includeSupportAction && <ClaimSupportButton uri={uri} />}
|
||||
</div>
|
||||
)}
|
||||
@@ -315,7 +344,8 @@ const ClaimPreview = forwardRef<any, {}>((props: Props, ref: any) => {
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
{!hideMenu && <ClaimMenuList uri={uri} />}
|
||||
</WrapperElement>
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user