Compare commits
307 Commits
IN-146-fil
...
develop
| Author | SHA1 | Date |
|---|---|---|
|
|
8896df9f1f | 2 years ago |
|
|
10bca448dc | 2 years ago |
|
|
7a2423568a | 2 years ago |
|
|
ccb265cb2e | 2 years ago |
|
|
3152372c39 | 2 years ago |
|
|
4e43b9aea8 | 2 years ago |
|
|
0c5a1aac4f | 2 years ago |
|
|
fc3a3c052c | 2 years ago |
|
|
888ac35156 | 2 years ago |
|
|
2b9b93ef31 | 2 years ago |
|
|
1335d34b07 | 2 years ago |
|
|
42623654bb | 2 years ago |
|
|
c0d06f8ef9 | 2 years ago |
|
|
2dba409aa7 | 2 years ago |
|
|
8dce04b35d | 2 years ago |
|
|
642e3809dc | 2 years ago |
|
|
c41acef4ce | 2 years ago |
|
|
af912dca10 | 2 years ago |
|
|
d06425df94 | 2 years ago |
|
|
0e0f24454e | 2 years ago |
|
|
2a95f32aeb | 2 years ago |
|
|
bef03ff120 | 2 years ago |
|
|
bd218b8888 | 2 years ago |
|
|
2d321ff6a2 | 2 years ago |
|
|
d4c4bd6e81 | 2 years ago |
|
|
0b2c38871a | 2 years ago |
|
|
9f0c779246 | 2 years ago |
|
|
02c72a87f1 | 2 years ago |
|
|
f70fe23926 | 2 years ago |
|
|
5e0b262839 | 2 years ago |
|
|
590ce1bb90 | 2 years ago |
|
|
806a2519b6 | 2 years ago |
|
|
efce351342 | 2 years ago |
|
|
f4b96c4668 | 2 years ago |
|
|
77f71b852b | 2 years ago |
|
|
93e2716817 | 2 years ago |
|
|
1edd818afd | 2 years ago |
|
|
01786d947a | 2 years ago |
|
|
f9823d191f | 2 years ago |
|
|
d9d4de4072 | 2 years ago |
|
|
63f7c01e09 | 2 years ago |
|
|
0170d0fb06 | 2 years ago |
|
|
e5552e4d8b | 2 years ago |
|
|
c67bc5a22c | 2 years ago |
|
|
247a08902d | 2 years ago |
|
|
8c88cb7517 | 2 years ago |
|
|
551460fc14 | 2 years ago |
|
|
cc595acfd4 | 2 years ago |
|
|
541a042597 | 2 years ago |
|
|
1b7a2eb111 | 2 years ago |
|
|
e1d82fc86e | 2 years ago |
|
|
17e8794399 | 3 years ago |
|
|
c90d4fc769 | 3 years ago |
|
|
90f7568a2a | 3 years ago |
|
|
b163307892 | 3 years ago |
|
|
1e7ffc7366 | 3 years ago |
|
|
cf8515fe9e | 3 years ago |
|
|
3a786f97c9 | 3 years ago |
|
|
403690369d | 3 years ago |
|
|
98bb7e24c1 | 3 years ago |
|
|
a055f9df80 | 3 years ago |
|
|
4c4b594b3c | 3 years ago |
|
|
d9bd7e68fa | 3 years ago |
|
|
767d7794c3 | 3 years ago |
|
|
4a53d56881 | 3 years ago |
|
|
472949baad | 3 years ago |
|
|
795a8237f7 | 3 years ago |
|
|
27b91ac3a0 | 3 years ago |
|
|
1e0a2cfc2d | 3 years ago |
|
|
86934cf6b8 | 3 years ago |
|
|
e188c32fcd | 3 years ago |
|
|
e1c8ff491e | 3 years ago |
|
|
4129e2730a | 3 years ago |
|
|
46b80b8e6c | 3 years ago |
|
|
66a53765dc | 3 years ago |
|
|
fcaa0015e5 | 3 years ago |
|
|
fe18150ee7 | 3 years ago |
|
|
aa41e833c7 | 3 years ago |
|
|
83880792cc | 3 years ago |
|
|
ca35f3d238 | 3 years ago |
|
|
877747322b | 3 years ago |
|
|
727aaece68 | 3 years ago |
|
|
2b3427800c | 3 years ago |
|
|
00ce4f76ab | 3 years ago |
|
|
9990d8eec6 | 3 years ago |
|
|
96ab8c588f | 3 years ago |
|
|
df1ac5508d | 3 years ago |
|
|
d6112d0db1 | 3 years ago |
|
|
ec60b7c1bc | 3 years ago |
|
|
4153cd8444 | 3 years ago |
|
|
e3332c4e3f | 3 years ago |
|
|
0697dbf072 | 3 years ago |
|
|
061b09d1c4 | 3 years ago |
|
|
e546a77f99 | 3 years ago |
|
|
e202aa1d30 | 3 years ago |
|
|
3d1d9e05cd | 3 years ago |
|
|
a56c44521b | 3 years ago |
|
|
ea00f09c7e | 3 years ago |
|
|
d783ef64e0 | 3 years ago |
|
|
ac6383bff9 | 3 years ago |
|
|
0750331e6a | 3 years ago |
|
|
27b2449711 | 3 years ago |
|
|
b0b7ab6073 | 3 years ago |
|
|
f31a83629d | 3 years ago |
|
|
5815744de4 | 3 years ago |
|
|
6a286d46dd | 3 years ago |
|
|
603f098b12 | 3 years ago |
|
|
e83c4032a9 | 3 years ago |
|
|
786a11281b | 3 years ago |
|
|
9b8242a712 | 3 years ago |
|
|
942a895004 | 3 years ago |
|
|
c9868effeb | 3 years ago |
|
|
bd71c5ef0c | 3 years ago |
|
|
62173b545b | 3 years ago |
|
|
282c652c63 | 3 years ago |
|
|
3c7e8c3a75 | 3 years ago |
|
|
370c165905 | 3 years ago |
|
|
1081406926 | 3 years ago |
|
|
7a5301f891 | 3 years ago |
|
|
4e681d01b2 | 3 years ago |
|
|
5edf656d1f | 3 years ago |
|
|
437f7d4d70 | 3 years ago |
|
|
a93f2e4c6c | 3 years ago |
|
|
27f7c3f092 | 3 years ago |
|
|
89e07e70e6 | 3 years ago |
|
|
b0c9b2a6c9 | 3 years ago |
|
|
7681462c83 | 3 years ago |
|
|
d5cf526725 | 3 years ago |
|
|
0f067862f9 | 3 years ago |
|
|
c0a594d7c8 | 3 years ago |
|
|
a69fbe6c4b | 3 years ago |
|
|
6a8d3f9200 | 3 years ago |
|
|
9205c61454 | 3 years ago |
|
|
b7026e08bb | 3 years ago |
|
|
e357fa8d6c | 3 years ago |
|
|
d5e2964e19 | 3 years ago |
|
|
44a550a67d | 3 years ago |
|
|
a910921bde | 3 years ago |
|
|
3795025519 | 3 years ago |
|
|
5f93cc4717 | 3 years ago |
|
|
c4403ea089 | 3 years ago |
|
|
e48b890fd7 | 3 years ago |
|
|
5eeaacde4c | 3 years ago |
|
|
b59c5ce832 | 3 years ago |
|
|
9376098b61 | 3 years ago |
|
|
27002909a5 | 3 years ago |
|
|
8a46f0a363 | 3 years ago |
|
|
b6c77febac | 3 years ago |
|
|
e43cbc2c02 | 3 years ago |
|
|
f335295dae | 3 years ago |
|
|
355f9fab5d | 3 years ago |
|
|
d97c10e56b | 3 years ago |
|
|
5b999d0657 | 3 years ago |
|
|
c4b304b031 | 3 years ago |
|
|
7feed32c37 | 3 years ago |
|
|
e50e3c1d8c | 3 years ago |
|
|
b80ced0877 | 3 years ago |
|
|
5c43a69c13 | 3 years ago |
|
|
5a38dfdc57 | 3 years ago |
|
|
8859004e6c | 3 years ago |
|
|
452f713c49 | 3 years ago |
|
|
7f1634b3e9 | 3 years ago |
|
|
090d28c1fd | 3 years ago |
|
|
e967ee24ed | 3 years ago |
|
|
0e8e83634c | 3 years ago |
|
|
912ccd452d | 3 years ago |
|
|
9646f24c03 | 3 years ago |
|
|
7e3c8b5473 | 3 years ago |
|
|
32a1720e9f | 3 years ago |
|
|
2103b69fea | 3 years ago |
|
|
7d1d37c6b5 | 3 years ago |
|
|
7b3b0fe2c0 | 3 years ago |
|
|
8d069a4242 | 3 years ago |
|
|
ba23f5258d | 3 years ago |
|
|
eafdc35971 | 3 years ago |
|
|
d6d89c3e90 | 3 years ago |
|
|
7b3e3b521d | 3 years ago |
|
|
633e729cce | 3 years ago |
|
|
d5bc16f083 | 3 years ago |
|
|
953fc449cf | 3 years ago |
|
|
459c39a0ea | 3 years ago |
|
|
59766a9601 | 3 years ago |
|
|
6b19ad2ec3 | 3 years ago |
|
|
0e68373893 | 3 years ago |
|
|
02ca2e1400 | 3 years ago |
|
|
f33146c376 | 3 years ago |
|
|
6002643f36 | 3 years ago |
|
|
af5be4bfab | 3 years ago |
|
|
ae93db8c8a | 3 years ago |
|
|
ffbca0cf2f | 3 years ago |
|
|
f2f883de62 | 3 years ago |
|
|
cd9c35b301 | 3 years ago |
|
|
749491521a | 3 years ago |
|
|
eb4a368ad1 | 3 years ago |
|
|
62281019f1 | 3 years ago |
|
|
9bf9f65f51 | 3 years ago |
|
|
40369dcded | 3 years ago |
|
|
d0bcb49a29 | 3 years ago |
|
|
a5757e44fe | 3 years ago |
|
|
6dad0f3758 | 3 years ago |
|
|
cab081346e | 3 years ago |
|
|
7155a80a29 | 3 years ago |
|
|
93328cd9eb | 3 years ago |
|
|
07c928ab97 | 3 years ago |
|
|
a47ccbbe3e | 3 years ago |
|
|
6d88197ac3 | 3 years ago |
|
|
d5adc2cd7e | 3 years ago |
|
|
f02325c470 | 3 years ago |
|
|
f2c12bed8c | 3 years ago |
|
|
e8dac0541d | 3 years ago |
|
|
8956dbc169 | 3 years ago |
|
|
bf52b61309 | 3 years ago |
|
|
a9925f7bb8 | 3 years ago |
|
|
790c049ea5 | 3 years ago |
|
|
a7bd8c392e | 3 years ago |
|
|
e66d8147fa | 3 years ago |
|
|
42a9f916d9 | 3 years ago |
|
|
7cdfd41fe2 | 3 years ago |
|
|
6ed5fea40d | 3 years ago |
|
|
34dfd327bb | 3 years ago |
|
|
9a6d3cae1b | 3 years ago |
|
|
5b9130eb11 | 3 years ago |
|
|
3474509c25 | 3 years ago |
|
|
af92f35e13 | 3 years ago |
|
|
2bd97402f4 | 3 years ago |
|
|
474cad5925 | 3 years ago |
|
|
3aca022f7b | 3 years ago |
|
|
cd4d2cdfd3 | 3 years ago |
|
|
8fe116103d | 3 years ago |
|
|
90af38ce77 | 3 years ago |
|
|
20d5c3eae4 | 3 years ago |
|
|
e3f4f737b2 | 3 years ago |
|
|
9e56f5cf87 | 3 years ago |
|
|
4cd7ff8f54 | 3 years ago |
|
|
6c8bbf1933 | 3 years ago |
|
|
8c28c0d1b3 | 3 years ago |
|
|
f15ea1c466 | 3 years ago |
|
|
6acacd93d0 | 3 years ago |
|
|
1d56682a60 | 3 years ago |
|
|
e60b59dde8 | 3 years ago |
|
|
a7eb04b6f4 | 3 years ago |
|
|
18068fd10f | 3 years ago |
|
|
57014e0fc5 | 3 years ago |
|
|
ce28930d1f | 3 years ago |
|
|
31babf85b7 | 3 years ago |
|
|
0fcd19a828 | 3 years ago |
|
|
5e771c21f9 | 3 years ago |
|
|
7976da693c | 3 years ago |
|
|
5b75d10390 | 3 years ago |
|
|
ed9cf58569 | 3 years ago |
|
|
765eacc9a6 | 3 years ago |
|
|
269ddad403 | 3 years ago |
|
|
6f694eeb9f | 3 years ago |
|
|
773dd2dba8 | 3 years ago |
|
|
7d9b0c374c | 3 years ago |
|
|
79e6e43dfa | 3 years ago |
|
|
b972a6f6ce | 3 years ago |
|
|
c1b3747603 | 3 years ago |
|
|
f6d8f5fea9 | 3 years ago |
|
|
f1451a3bcb | 3 years ago |
|
|
ad94da060f | 3 years ago |
|
|
c18009f2d8 | 3 years ago |
|
|
6c4bb15a4a | 3 years ago |
|
|
407a9d9261 | 3 years ago |
|
|
8e19b230cc | 3 years ago |
|
|
7d63348391 | 3 years ago |
|
|
4c51ae8ce2 | 3 years ago |
|
|
5bffc91ad8 | 3 years ago |
|
|
d1f0a6e4b5 | 3 years ago |
|
|
44e70269ba | 3 years ago |
|
|
5f47bbce1b | 3 years ago |
|
|
66ddaf141e | 3 years ago |
|
|
2d445cbc02 | 3 years ago |
|
|
998b7176de | 3 years ago |
|
|
1dc9da94fc | 3 years ago |
|
|
fb76eaa14e | 3 years ago |
|
|
5e259d1cdf | 3 years ago |
|
|
12c01cbc63 | 3 years ago |
|
|
b556416aae | 3 years ago |
|
|
053ba2a636 | 3 years ago |
|
|
e004e6ad9a | 3 years ago |
|
|
cf55087b34 | 3 years ago |
|
|
3ce2ab1cb8 | 3 years ago |
|
|
c93c820406 | 3 years ago |
|
|
f588b1de11 | 3 years ago |
|
|
62417be7c1 | 3 years ago |
|
|
65cdb73ec5 | 3 years ago |
|
|
da50a761ef | 3 years ago |
|
|
7d46c0be53 | 3 years ago |
|
|
b9b11d394f | 3 years ago |
|
|
9d11a525a1 | 3 years ago |
|
|
d800c5ef9a | 3 years ago |
|
|
3fafdca9a8 | 3 years ago |
|
|
77784a4a5a | 3 years ago |
|
|
ef3e40de61 | 3 years ago |
|
|
52c5619b54 | 3 years ago |
|
|
fa84a64c3d | 3 years ago |
|
|
391577367d | 3 years ago |
|
|
f6418de5c9 | 3 years ago |
|
|
9752a5eeb6 | 3 years ago |
|
|
83dcbd93bc | 3 years ago |
|
|
6f755da982 | 3 years ago |
|
|
7b417df0c2 | 3 years ago |
|
|
41d7131610 | 3 years ago |
|
|
8b484e1fd2 | 3 years ago |
|
|
dc73d9157a | 3 years ago |
|
|
bfdf684287 | 3 years ago |
@ -0,0 +1 @@ |
||||
google.com, pub-6802442215403184, DIRECT, f08c47fec0942fa0 |
||||
@ -0,0 +1,9 @@ |
||||
{ |
||||
"applinks": { |
||||
"apps": [], |
||||
"details": [{ |
||||
"appID": "2X9NY5X2LZ.com.insports.ott", |
||||
"paths": ["*"] |
||||
}] |
||||
} |
||||
} |
||||
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 81 KiB After Width: | Height: | Size: 67 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 793 B |
|
Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 76 KiB |
|
After Width: | Height: | Size: 19 KiB |
|
After Width: | Height: | Size: 802 B |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
@ -0,0 +1,12 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<browserconfig> |
||||
<msapplication> |
||||
<tile> |
||||
<square70x70logo src="/mstile-70x70.png"/> |
||||
<square144x144logo src="/mstile-144x144.png"/> |
||||
<square150x150logo src="/mstile-150x150.png"/> |
||||
<square310x310logo src="/mstile-310x310.png"/> |
||||
<TileColor>#da532c</TileColor> |
||||
</tile> |
||||
</msapplication> |
||||
</browserconfig> |
||||
|
After Width: | Height: | Size: 477 B |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,19 @@ |
||||
{ |
||||
"name": "", |
||||
"short_name": "", |
||||
"icons": [ |
||||
{ |
||||
"src": "/android-chrome-192x192.png", |
||||
"sizes": "192x192", |
||||
"type": "image/png" |
||||
}, |
||||
{ |
||||
"src": "/android-chrome-512x512.png", |
||||
"sizes": "512x512", |
||||
"type": "image/png" |
||||
} |
||||
], |
||||
"theme_color": "#ffffff", |
||||
"background_color": "#ffffff", |
||||
"display": "standalone" |
||||
} |
||||
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 93 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 598 B After Width: | Height: | Size: 884 B |
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 2.2 KiB |
|
Before Width: | Height: | Size: 102 KiB After Width: | Height: | Size: 15 KiB |
|
After Width: | Height: | Size: 7.4 KiB |
|
After Width: | Height: | Size: 16 KiB |
|
After Width: | Height: | Size: 6.5 KiB |
@ -0,0 +1,12 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<browserconfig> |
||||
<msapplication> |
||||
<tile> |
||||
<square70x70logo src="/mstile-70x70.png"/> |
||||
<square144x144logo src="/mstile-144x144.png"/> |
||||
<square150x150logo src="/mstile-150x150.png"/> |
||||
<square310x310logo src="/mstile-310x310.png"/> |
||||
<TileColor>#da532c</TileColor> |
||||
</tile> |
||||
</msapplication> |
||||
</browserconfig> |
||||
|
After Width: | Height: | Size: 477 B |
|
After Width: | Height: | Size: 982 B |
|
After Width: | Height: | Size: 15 KiB |
@ -0,0 +1,19 @@ |
||||
{ |
||||
"name": "", |
||||
"short_name": "", |
||||
"icons": [ |
||||
{ |
||||
"src": "/android-chrome-192x192.png", |
||||
"sizes": "192x192", |
||||
"type": "image/png" |
||||
}, |
||||
{ |
||||
"src": "/android-chrome-512x512.png", |
||||
"sizes": "512x512", |
||||
"type": "image/png" |
||||
} |
||||
], |
||||
"theme_color": "#ffffff", |
||||
"background_color": "#ffffff", |
||||
"display": "standalone" |
||||
} |
||||
|
After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 2.6 KiB |
|
After Width: | Height: | Size: 5.6 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.1 KiB |
|
After Width: | Height: | Size: 568 B |
|
Before Width: | Height: | Size: 696 B |
|
Before Width: | Height: | Size: 717 B |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 624 B |
|
After Width: | Height: | Size: 51 KiB |
|
After Width: | Height: | Size: 170 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 334 KiB |
|
After Width: | Height: | Size: 36 KiB |
|
After Width: | Height: | Size: 112 KiB |
|
After Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 229 B |
|
After Width: | Height: | Size: 2.8 KiB |
|
After Width: | Height: | Size: 2.3 KiB |
|
After Width: | Height: | Size: 908 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 451 B |
|
After Width: | Height: | Size: 755 B |
|
After Width: | Height: | Size: 1.4 KiB |
|
After Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 329 B |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
|
After Width: | Height: | Size: 1.4 MiB |
|
After Width: | Height: | Size: 2.0 KiB |
@ -1,15 +1,28 @@ |
||||
<!DOCTYPE html> |
||||
<html lang="en"> |
||||
|
||||
<head> |
||||
<title></title> |
||||
</head> |
||||
|
||||
<body> |
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/oidc-client/1.11.5/oidc-client.min.js" integrity="sha512-pGtU1n/6GJ8fu6bjYVGIOT9Dphaw5IWPwVlqkpvVgqBxFkvdNbytUh0H8AP15NYF777P4D3XEeA/uDWFCpSQ1g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script> |
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/oidc-client/1.11.5/oidc-client.min.js" |
||||
integrity="sha512-pGtU1n/6GJ8fu6bjYVGIOT9Dphaw5IWPwVlqkpvVgqBxFkvdNbytUh0H8AP15NYF777P4D3XEeA/uDWFCpSQ1g==" |
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script> |
||||
<script> |
||||
new Oidc.UserManager().signinSilentCallback() |
||||
.catch((err) => { |
||||
console.error('OIDC: silent refresh callback error', err); |
||||
}); |
||||
// обновляем рефреш токен в локалсторадже |
||||
// так как safari не дает доступ к кукам |
||||
.then(() => { |
||||
const refreshToken = localStorage.getItem('refresh_token'); |
||||
if (refreshToken) { |
||||
localStorage.setItem('refresh_token', new URLSearchParams(document.location.search).get('refresh_token')); |
||||
} |
||||
}) |
||||
.catch((err) => { |
||||
console.error('OIDC: silent refresh callback error', err); |
||||
}); |
||||
</script> |
||||
</body> |
||||
</html> |
||||
|
||||
</html> |
||||
@ -1,9 +0,0 @@ |
||||
#!/bin/bash |
||||
|
||||
branch=$1 |
||||
composefile=$2 |
||||
|
||||
cd /home/ubuntu/ott-auth |
||||
docker-compose -f $composefile down |
||||
docker-compose -f $composefile up -d |
||||
echo "[>] Deployment done." |
||||
@ -0,0 +1,128 @@ |
||||
import { |
||||
useEffect, |
||||
useState, |
||||
RefObject, |
||||
} from 'react' |
||||
|
||||
import { T9n } from 'features/T9n' |
||||
import { Icon } from 'features/Icon' |
||||
import { useAuthStore } from 'features/AuthStore' |
||||
|
||||
import { |
||||
AccessTimerContainer, |
||||
PreviewInfo, |
||||
SignInBtn, |
||||
SignText, |
||||
Timer, |
||||
TimerContainer, |
||||
} from './styled' |
||||
|
||||
import { SimplePopup } from '../SimplePopup' |
||||
import { secondsToHms } from '../../helpers' |
||||
import { getViewMatchDuration } from '../../requests/getViewMatchDuration' |
||||
import { usePageParams } from '../../hooks' |
||||
import { getUserInfo } from '../../requests' |
||||
|
||||
type AccessTimerType = { |
||||
access: boolean, |
||||
isFullscreen: boolean, |
||||
onFullscreenClick: () => void, |
||||
playing: boolean, |
||||
videoRef?: RefObject<HTMLVideoElement> | null, |
||||
} |
||||
|
||||
const ACCESS_TIME = 60 |
||||
|
||||
export const AccessTimer = ({ |
||||
access, |
||||
isFullscreen, |
||||
onFullscreenClick, |
||||
playing, |
||||
videoRef, |
||||
}: AccessTimerType) => { |
||||
const { |
||||
logout, |
||||
setUserInfo, |
||||
userInfo, |
||||
} = useAuthStore() |
||||
|
||||
const { profileId, sportType } = usePageParams() |
||||
|
||||
const [timeIsFinished, setTimeIsFinished] = useState(true) |
||||
const [time, setTime] = useState(ACCESS_TIME) |
||||
const isTimeExpired = time <= 0 || !access |
||||
|
||||
useEffect(() => { |
||||
if (isTimeExpired) { |
||||
document.pictureInPictureEnabled && document.exitPictureInPicture() |
||||
setTimeIsFinished(true) |
||||
videoRef?.current?.pause() |
||||
setTime(0) |
||||
if (isFullscreen) onFullscreenClick() |
||||
} |
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [access, playing, profileId]) |
||||
|
||||
useEffect(() => { |
||||
let stopWatch: ReturnType<typeof setInterval> | null = null |
||||
if (playing) { |
||||
stopWatch = setInterval(() => { |
||||
setTime((prev) => prev - 1) |
||||
}, 1000) |
||||
} else { |
||||
stopWatch && clearInterval(stopWatch) |
||||
} |
||||
return () => { |
||||
stopWatch && clearInterval(stopWatch) |
||||
} |
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [playing, profileId]) |
||||
|
||||
useEffect(() => { |
||||
(async () => { |
||||
setTime(ACCESS_TIME) |
||||
const updatedUserInfo = await getUserInfo() |
||||
setUserInfo(updatedUserInfo) |
||||
const timeViewed = await getViewMatchDuration({ |
||||
matchId: profileId, |
||||
sportType, |
||||
userId: Number(updatedUserInfo?.email), |
||||
}) |
||||
setTime(isTimeExpired ? 0 : (ACCESS_TIME - Number(timeViewed.duration))) |
||||
})() |
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [profileId]) |
||||
|
||||
return ( |
||||
<> |
||||
{(!userInfo || Number(userInfo?.email) < 0) && access && time > 0 |
||||
? ( |
||||
<AccessTimerContainer isFullscreen={isFullscreen}> |
||||
<TimerContainer> |
||||
<PreviewInfo> |
||||
<Timer>{secondsToHms(time)} </Timer> |
||||
<T9n t='game_preview' className='gamePreview' /> |
||||
</PreviewInfo> |
||||
<SignText> |
||||
<T9n t='sign_in_full_game' /> |
||||
</SignText> |
||||
</TimerContainer> |
||||
<SignInBtn onClick={() => logout('saveToken')} id='match_register'> |
||||
<T9n t='sign_in' /> |
||||
</SignInBtn> |
||||
</AccessTimerContainer> |
||||
) |
||||
: ( |
||||
<SimplePopup |
||||
isModalOpen={timeIsFinished} |
||||
withCloseButton={false} |
||||
headerName='sec_60' |
||||
mainText='continue_watching' |
||||
buttonName='sign_in' |
||||
onHandle={() => logout('saveToken')} |
||||
icon={<Icon refIcon='ExclamationPoint' />} |
||||
/> |
||||
)} |
||||
</> |
||||
) |
||||
} |
||||
@ -0,0 +1,124 @@ |
||||
import styled, { css } from 'styled-components/macro' |
||||
|
||||
import { isMobileDevice } from 'config' |
||||
|
||||
import { ButtonSolid } from 'features/Common' |
||||
|
||||
export const AccessTimerContainer = styled.div<{isFullscreen?: boolean}>` |
||||
display: flex; |
||||
align-items: center; |
||||
|
||||
position: absolute; |
||||
left: 50%; |
||||
bottom: 5.7rem; |
||||
transform: translateX(-50%); |
||||
background-color: #333333; |
||||
border-radius: 5px; |
||||
padding: 20px 50px; |
||||
|
||||
gap: 40px; |
||||
|
||||
${isMobileDevice |
||||
? css` |
||||
padding: 9px 7px 9px 15px; |
||||
bottom: 6.5rem; |
||||
|
||||
@media screen and (orientation: landscape) { |
||||
max-width: 95%; |
||||
bottom: 4rem; |
||||
} |
||||
` |
||||
: ''}; |
||||
|
||||
${({ isFullscreen }) => isFullscreen && css` |
||||
${isMobileDevice |
||||
? css` |
||||
padding: 9px 7px 9px 15px; |
||||
bottom: 12rem; |
||||
|
||||
@media screen and (orientation: landscape) { |
||||
max-width: 95%; |
||||
bottom: 6rem; |
||||
} |
||||
` |
||||
: ''}; |
||||
`}
|
||||
` |
||||
|
||||
export const SignInBtn = styled(ButtonSolid)` |
||||
width: 246px; |
||||
border-radius: 5px; |
||||
height: 50px; |
||||
font-weight: 600; |
||||
font-size: 20px; |
||||
white-space: nowrap; |
||||
padding: 0 35px; |
||||
|
||||
${isMobileDevice |
||||
? css` |
||||
font-size: 12px; |
||||
white-space: nowrap; |
||||
padding: 0px 16px; |
||||
width: 140px; |
||||
height: 30px; |
||||
|
||||
@media screen and (orientation: landscape) { |
||||
font-size: 12px; |
||||
padding: 0px 8px; |
||||
} |
||||
` |
||||
: ''}; |
||||
|
||||
` |
||||
|
||||
export const TimerContainer = styled.div` |
||||
color: white; |
||||
font-weight: 700; |
||||
font-size: 20px; |
||||
line-height: 24px; |
||||
white-space: nowrap; |
||||
max-width: 215px; |
||||
|
||||
${isMobileDevice |
||||
? css` |
||||
font-size: 12px; |
||||
line-height: 28px; |
||||
` |
||||
: ''}; |
||||
` |
||||
|
||||
export const PreviewInfo = styled.div` |
||||
display: flex; |
||||
line-height: 24px; |
||||
|
||||
${isMobileDevice |
||||
? css` |
||||
line-height: 14px; |
||||
` |
||||
: ''}; |
||||
` |
||||
|
||||
export const Timer = styled.div` |
||||
min-width: 67px; |
||||
|
||||
${isMobileDevice |
||||
? css` |
||||
min-width: 40px; |
||||
` |
||||
: ''}; |
||||
` |
||||
|
||||
export const SignText = styled.span` |
||||
display: block; |
||||
font-size: 16px; |
||||
line-height: 20px; |
||||
font-weight: 400; |
||||
white-space: break-spaces; |
||||
|
||||
${isMobileDevice |
||||
? css` |
||||
font-size: 9px; |
||||
line-height: 14px |
||||
` |
||||
: ''}; |
||||
` |
||||
@ -0,0 +1,163 @@ |
||||
import { useEffect, useState } from 'react' |
||||
|
||||
import ReactGA from 'react-ga' |
||||
|
||||
import { updateAdsView } from 'requests' |
||||
|
||||
import { useToggle } from 'hooks' |
||||
|
||||
import { getLocalStorageItem, isMatchPage } from 'helpers' |
||||
|
||||
import { |
||||
device, |
||||
COUNTRY, |
||||
} from 'config' |
||||
|
||||
import { useMatchPageStore } from 'features/MatchPage/store' |
||||
|
||||
import type { AdComponentType } from './index' |
||||
|
||||
import { checkVideo } from '../../helpers' |
||||
import { |
||||
adsViews, |
||||
EventGA, |
||||
ViewsType, |
||||
} from '../../types' |
||||
|
||||
const countryCode = getLocalStorageItem(COUNTRY) |
||||
|
||||
export const useAd = ({ ad }: AdComponentType) => { |
||||
const isMatch = isMatchPage() |
||||
|
||||
const [isOpenAd, setIsOpenAd] = useState(isMatch) |
||||
const [isNeedToShow, setIsNeedToShow] = useState(isMatch) |
||||
const [shownTime, setShownTime] = useState(0) |
||||
|
||||
const { isFullscreen } = useMatchPageStore() |
||||
|
||||
const views = getLocalStorageItem(adsViews) as ViewsType |
||||
const { |
||||
duration, |
||||
frequency, |
||||
id, |
||||
media, |
||||
name, |
||||
time_close, |
||||
} = ad |
||||
|
||||
const { |
||||
close, |
||||
isOpen: isOpenCloseBtn, |
||||
open: showCloseBtn, |
||||
} = useToggle() |
||||
|
||||
const isNeedBanner = Number(views?.HOME) % frequency === 0 |
||||
const isVideo = checkVideo(media.url) |
||||
const currentAdsTime = duration - shownTime |
||||
|
||||
useEffect(() => { |
||||
if (!isFullscreen) { |
||||
if (currentAdsTime === 0) { |
||||
setShownTime(0) |
||||
} else { |
||||
const stopWatch = setInterval(() => { |
||||
setShownTime((prev) => prev + 1) |
||||
}, 1000) |
||||
return () => clearInterval(stopWatch) |
||||
} |
||||
} |
||||
return undefined |
||||
}, [ |
||||
isFullscreen, |
||||
currentAdsTime, |
||||
]) |
||||
|
||||
const handleClose = () => { |
||||
setIsOpenAd(false) |
||||
isMatch && setIsNeedToShow(false) |
||||
sendBannerClickEvent(EventGA.CLOSE) |
||||
} |
||||
|
||||
const sendBannerClickEvent = (event: EventGA) => { |
||||
ReactGA.initialize('Advertisement') |
||||
ReactGA.event({ |
||||
action: event, |
||||
category: 'Advertisement', |
||||
label: `${name}_${countryCode ?? ''}_${device}`, |
||||
value: id, |
||||
}) |
||||
} |
||||
|
||||
useEffect(() => { |
||||
setShownTime(0) |
||||
|
||||
if (isMatch) { |
||||
const interval = setInterval(() => { |
||||
setIsNeedToShow(true) |
||||
setIsOpenAd(true) |
||||
}, frequency * 1000) |
||||
|
||||
return () => clearInterval(interval) |
||||
} |
||||
|
||||
setIsNeedToShow(isNeedBanner) |
||||
return setIsOpenAd(isNeedBanner) |
||||
}, [ |
||||
frequency, |
||||
isNeedToShow, |
||||
views?.HOME, |
||||
isNeedBanner, |
||||
isMatch, |
||||
]) |
||||
|
||||
useEffect(() => { |
||||
if (isFullscreen || !isOpenAd) return undefined |
||||
|
||||
const timeoutCloseAd = setTimeout(handleClose, currentAdsTime * 1000) |
||||
return () => { |
||||
clearTimeout(timeoutCloseAd) |
||||
} |
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [ |
||||
isNeedToShow, |
||||
isOpenAd, |
||||
isFullscreen, |
||||
currentAdsTime, |
||||
]) |
||||
|
||||
useEffect(() => { |
||||
close() |
||||
const timeoutCloseBtn = time_close && setTimeout(showCloseBtn, time_close * 1000) |
||||
return () => { |
||||
time_close && clearTimeout(timeoutCloseBtn) |
||||
} |
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [ |
||||
isNeedToShow, |
||||
isOpenAd, |
||||
views?.HOME, |
||||
]) |
||||
|
||||
useEffect(() => { |
||||
if (!isNeedToShow || (!isMatch && !isNeedBanner)) return |
||||
|
||||
(async () => { |
||||
await updateAdsView({ adv_id: id }) |
||||
})() |
||||
sendBannerClickEvent(EventGA.DISPLAY) |
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [ |
||||
id, |
||||
isNeedToShow, |
||||
isMatch, |
||||
]) |
||||
|
||||
return { |
||||
handleClose, |
||||
isNeedToShow, |
||||
isOpenAd, |
||||
isOpenCloseBtn, |
||||
isVideo, |
||||
sendBannerClickEvent, |
||||
} |
||||
} |
||||
@ -0,0 +1,91 @@ |
||||
import type { MouseEvent } from 'react' |
||||
import { memo } from 'react' |
||||
|
||||
import type { AdType } from 'requests' |
||||
|
||||
import { useLexicsStore } from 'features/LexicsStore' |
||||
|
||||
import { useAd } from './hooks' |
||||
|
||||
import { EventGA } from '../../types' |
||||
|
||||
import { |
||||
AdImg, |
||||
AdVideo, |
||||
AdWrapper, |
||||
LinkWrapper, |
||||
AdsCloseButton, |
||||
} from './styled' |
||||
|
||||
export type AdComponentType = { |
||||
ad: AdType, |
||||
} |
||||
export const AdComponent = memo(({ ad }: AdComponentType) => { |
||||
const { |
||||
link, |
||||
media, |
||||
position, |
||||
} = ad |
||||
|
||||
const { |
||||
handleClose, |
||||
isNeedToShow, |
||||
isOpenAd, |
||||
isOpenCloseBtn, |
||||
isVideo, |
||||
sendBannerClickEvent, |
||||
} = useAd({ ad }) |
||||
|
||||
const { suffix } = useLexicsStore() |
||||
|
||||
const close = (e: MouseEvent<HTMLButtonElement>) => { |
||||
e.stopPropagation() |
||||
handleClose() |
||||
} |
||||
|
||||
const onLinkClick = () => { |
||||
link && sendBannerClickEvent(EventGA.CLICK) |
||||
} |
||||
|
||||
return ( |
||||
position && isOpenAd && isNeedToShow |
||||
? ( |
||||
<AdWrapper |
||||
position={position.id} |
||||
isOpenAd={isOpenAd} |
||||
> |
||||
{isOpenCloseBtn && ( |
||||
<AdsCloseButton |
||||
onClick={close} |
||||
size={12} |
||||
position={position.id} |
||||
/> |
||||
)} |
||||
<LinkWrapper |
||||
href={link} |
||||
target='_blank' |
||||
rel='noreferrer' |
||||
onClick={onLinkClick} |
||||
> |
||||
{isVideo |
||||
? ( |
||||
<AdVideo |
||||
muted={isVideo} |
||||
autoPlay={isVideo} |
||||
loop={isVideo} |
||||
src={media.url} |
||||
position={position.id} |
||||
/> |
||||
) |
||||
: ( |
||||
<AdImg |
||||
src={media.url} |
||||
position={position.id} |
||||
alt={`name_${suffix}`} |
||||
/> |
||||
)} |
||||
</LinkWrapper> |
||||
</AdWrapper> |
||||
) : null |
||||
) |
||||
}) |
||||
@ -0,0 +1,109 @@ |
||||
import styled, { css } from 'styled-components/macro' |
||||
|
||||
import includes from 'lodash/includes' |
||||
|
||||
import { CloseButton } from 'features/PopupComponents' |
||||
|
||||
import { |
||||
MATCH_ADS, |
||||
PLAYER_ADS, |
||||
VIEW_ADS, |
||||
} from '../../types' |
||||
|
||||
type Props = { |
||||
position: number, |
||||
} |
||||
|
||||
const header = [7, 8, 9] |
||||
|
||||
const chooseStyle = (type: number) => { |
||||
switch (true) { |
||||
case VIEW_ADS.COLUMN === type: |
||||
return 'grid-row: 1 / 3; img {max-height: none;}' |
||||
case VIEW_ADS.ROW === type: |
||||
return 'grid-column: 1 / 3' |
||||
case VIEW_ADS.SQUARE === type: |
||||
return 'grid-row: 1 / 3; grid-column: 1 / 3; img {max-height: none;}' |
||||
case VIEW_ADS.SECOND_COLUMN === type: |
||||
return 'grid-column: 2 / 3; grid-row: 1 / 1' |
||||
case VIEW_ADS.SECOND_ROW === type: |
||||
return 'grid-column: 1 / 2; grid-row: 2 / 3;' |
||||
case MATCH_ADS.PLAYS_TOP === type: |
||||
return 'margin-left: 14px; height: 48px' |
||||
case MATCH_ADS.PLAYS_BOTTOM === type: |
||||
return 'grid-row: 4; margin-bottom: 12px; height: 48px;' |
||||
case PLAYER_ADS.LEFT_BOTTOM === type: |
||||
return css` |
||||
height: auto;
|
||||
width: 42.4%;
|
||||
bottom: 100px;
|
||||
left: 20px;
|
||||
` |
||||
case PLAYER_ADS.CENTER_BOTTOM === type: |
||||
return css` |
||||
height: 18.3%;
|
||||
width: 81.3%;
|
||||
bottom: 100px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%); |
||||
` |
||||
case PLAYER_ADS.RIGHT === type: |
||||
return css` |
||||
height: 87.2%;
|
||||
width: 18.3%;
|
||||
bottom: 90px;
|
||||
right: 18px; |
||||
` |
||||
case PLAYER_ADS.FULL_SCREEN === type: |
||||
return 'bottom: 0; left: 0;' |
||||
default: |
||||
return '' |
||||
} |
||||
} |
||||
|
||||
export const AdImg = styled.img<Props>` |
||||
width: 100%; |
||||
min-height: ${({ position }) => (!includes(header, position) && '100%')}; |
||||
max-height: ${({ position }) => (includes(header, position) ? '13rem' : '100%')}; |
||||
cursor: pointer; |
||||
border-radius: 3px; |
||||
` |
||||
|
||||
export const AdVideo = styled.video<Props>` |
||||
object-fit: contain; |
||||
width: 100%; |
||||
cursor: pointer; |
||||
max-height: ${({ position }) => (includes(header, position) ? '283px' : '100%')}; |
||||
background-color: black; |
||||
border-radius: 3px; |
||||
` |
||||
|
||||
export const AdWrapper = styled.div<Props & {isOpenAd: boolean}>` |
||||
position: ${({ position }) => (includes(PLAYER_ADS, position) ? 'absolute' : 'relative')}; |
||||
width: 100%; |
||||
height: 100%; |
||||
z-index: 1; |
||||
|
||||
${({ position }) => chooseStyle(position)}; |
||||
|
||||
display: ${({ isOpenAd }) => (isOpenAd ? '' : 'none')}; |
||||
` |
||||
|
||||
export const AdsCloseButton = styled(CloseButton)<Props>` |
||||
position: absolute; |
||||
right: ${({ position }) => (position === PLAYER_ADS.FULL_SCREEN ? '10px' : '0')}; |
||||
top: ${({ position }) => (position === PLAYER_ADS.FULL_SCREEN ? '10px' : '0')}; |
||||
background: none; |
||||
border-radius: 0; |
||||
z-index: 2; |
||||
cursor: pointer; |
||||
color: #9B9B9B; |
||||
width: 28px; |
||||
height: 28px; |
||||
|
||||
:hover { |
||||
background: none; |
||||
} |
||||
` |
||||
|
||||
export const LinkWrapper = styled.a`` |
||||
@ -0,0 +1,79 @@ |
||||
import type { MouseEvent } from 'react' |
||||
|
||||
import includes from 'lodash/includes' |
||||
|
||||
import type { AdType } from 'requests' |
||||
|
||||
import { useLexicsStore } from 'features/LexicsStore' |
||||
|
||||
import { useAd } from '../AdComponent/hooks' |
||||
import { EventGA, PLAYER_MOBILE_FULL_SCREEN } from '../../types' |
||||
|
||||
import { |
||||
AdsCloseButton, |
||||
Img, |
||||
MobileAdWrapper, |
||||
Video, |
||||
} from './styled' |
||||
|
||||
type MobileAdTypes = { |
||||
ad: AdType, |
||||
} |
||||
|
||||
export const MobileAd = ({ ad }: MobileAdTypes) => { |
||||
const { |
||||
link, |
||||
media, |
||||
position, |
||||
} = ad |
||||
|
||||
const { suffix } = useLexicsStore() |
||||
|
||||
const { |
||||
handleClose, |
||||
isNeedToShow, |
||||
isOpenAd, |
||||
isOpenCloseBtn, |
||||
isVideo, |
||||
sendBannerClickEvent, |
||||
} = useAd({ ad }) |
||||
|
||||
const close = (e: MouseEvent<HTMLButtonElement>) => { |
||||
e.stopPropagation() |
||||
handleClose() |
||||
} |
||||
|
||||
const onLinkClick = () => { |
||||
if (link) { |
||||
sendBannerClickEvent(EventGA.CLICK) |
||||
window.open(link, '_blank') |
||||
} |
||||
} |
||||
|
||||
return ( |
||||
position && isOpenAd && isNeedToShow ? ( |
||||
<MobileAdWrapper |
||||
position={position.id} |
||||
onClick={onLinkClick} |
||||
> |
||||
{isOpenCloseBtn |
||||
&& ( |
||||
<AdsCloseButton |
||||
position={position.id} |
||||
onClick={close} |
||||
size={includes(PLAYER_MOBILE_FULL_SCREEN, position.id) ? 12 : 8} |
||||
/> |
||||
)} |
||||
{isVideo |
||||
? <Video position={position.id} src={media.url} /> |
||||
: ( |
||||
<Img |
||||
position={position.id} |
||||
src={media.url} |
||||
alt={`name_${suffix}`} |
||||
/> |
||||
)} |
||||
</MobileAdWrapper> |
||||
) : null |
||||
) |
||||
} |
||||
@ -0,0 +1,115 @@ |
||||
import styled, { css } from 'styled-components/macro' |
||||
|
||||
import includes from 'lodash/includes' |
||||
|
||||
import { CloseButton } from 'features/PopupComponents' |
||||
|
||||
import { |
||||
MATCH_ADS, |
||||
PLAYER_MOBILE_FULL_SCREEN, |
||||
PLAYER_MOBILE_ADS, |
||||
MATCH_PAGE_MOBILE_ADS, |
||||
VIEW_ADS, |
||||
} from '../../types' |
||||
|
||||
type Props = { |
||||
position: number, |
||||
} |
||||
|
||||
const chooseStyle = (type: number) => { |
||||
switch (type) { |
||||
case MATCH_ADS.PLAYS_BOTTOM_MOBILE: |
||||
return css` |
||||
grid-row: 4;
|
||||
margin-bottom: 12px;
|
||||
height: 48px; |
||||
` |
||||
case PLAYER_MOBILE_ADS: |
||||
return css` |
||||
position: absolute; |
||||
width: 92%;
|
||||
bottom: 50px;
|
||||
left: 15px; |
||||
` |
||||
case PLAYER_MOBILE_FULL_SCREEN.VERTICAL_FULL_SCREEN: |
||||
case PLAYER_MOBILE_FULL_SCREEN.HORIZONTAL_FULL_SCREEN: |
||||
return css` |
||||
position: absolute; |
||||
top: 0; |
||||
left: 0; |
||||
height: 100%; |
||||
padding: 5px;
|
||||
background-color: rgba(0, 0, 0, 0.7); |
||||
` |
||||
case VIEW_ADS.MOBILE_IN_COLLAPSE_FOOTER: |
||||
case VIEW_ADS.MOBILE_IN_COLLAPSE_HEADER: |
||||
return 'margin-top: 6px' |
||||
default: |
||||
return '' |
||||
} |
||||
} |
||||
|
||||
export const MobileAdWrapper = styled.div<Props>` |
||||
position: relative; |
||||
width: 100%; |
||||
z-index: ${({ position }) => (includes(PLAYER_MOBILE_FULL_SCREEN, position) ? '101' : '4')}; |
||||
|
||||
${({ position }) => chooseStyle(position)}; |
||||
` |
||||
|
||||
export const AdsCloseButton = styled(CloseButton)<Props>` |
||||
position: absolute; |
||||
right: ${({ position }) => (includes(PLAYER_MOBILE_FULL_SCREEN, position) ? '-5px' : '-10px')}; |
||||
top: ${({ position }) => (includes(PLAYER_MOBILE_FULL_SCREEN, position) ? '15px' : '10px')}; |
||||
background: none; |
||||
border-radius: 0; |
||||
transform: translate(-50%, -50%); |
||||
z-index: 2; |
||||
color: #9B9B9B; |
||||
` |
||||
|
||||
export const Img = styled.img<Props>` |
||||
border-radius: 2px; |
||||
width: 100%; |
||||
|
||||
object-fit: ${({ position }) => { |
||||
switch (true) { |
||||
case position === PLAYER_MOBILE_FULL_SCREEN.VERTICAL_FULL_SCREEN: |
||||
return 'fill' |
||||
case position === MATCH_ADS.PLAYS_TOP_MOBILE: |
||||
return 'contain' |
||||
default: |
||||
return 'cover' |
||||
} |
||||
}}; |
||||
|
||||
height: ${({ position }) => { |
||||
switch (true) { |
||||
case position === 10: |
||||
return '50px' |
||||
case includes(MATCH_PAGE_MOBILE_ADS, position): |
||||
return '100%' |
||||
default: |
||||
return '75px' |
||||
} |
||||
}} |
||||
` |
||||
|
||||
export const Video = styled.video<Props>` |
||||
max-height: 100%; |
||||
object-fit: cover; |
||||
min-width: 100%; |
||||
height: ${({ position }) => (position === 10 ? '50px' : '75px')}; |
||||
border-radius: 2px; |
||||
|
||||
height: ${({ position }) => { |
||||
switch (true) { |
||||
case position === 10: |
||||
return '50px' |
||||
case position === MATCH_ADS.PLAYS_TOP_MOBILE: |
||||
return '48px' |
||||
default: |
||||
return '75px' |
||||
} |
||||
}} |
||||
` |
||||
@ -0,0 +1,16 @@ |
||||
import type { AdResponse, AdsListType } from 'requests' |
||||
|
||||
export const calcMaxAdDurationAds = (advertisements: AdResponse) => { |
||||
const allAds = Object.values(advertisements) |
||||
|
||||
const combineAds = allAds.reduce((result, currentAd) => { |
||||
result.push(...currentAd) |
||||
|
||||
return result |
||||
}, [] as AdsListType) |
||||
|
||||
const maxDuration = combineAds |
||||
.reduce((result, { duration }) => Math.max(result, duration), 0) |
||||
|
||||
return maxDuration |
||||
} |
||||
@ -0,0 +1 @@ |
||||
export * from './isVideo' |
||||
@ -0,0 +1,2 @@ |
||||
const regexp = /^https?:\/\/\S+(?:mp4)$/ |
||||
export const checkVideo = (url: string) => regexp.test(url) |
||||