IN-352-scores-method #96

Merged
andrey.dekterev merged 3 commits from IN-352-scores-method into develop 3 years ago
  1. 1
      .eslintrc
  2. 164
      package-lock.json
  3. 1
      package.json
  4. 1
      src/components/ItemInfo/ItemInfo.tsx
  5. 1
      src/config/clients/types.tsx
  6. 1
      src/config/index.tsx
  7. 4
      src/config/queries.tsx
  8. 1
      src/features/AirPlay/index.tsx
  9. 12
      src/features/App/index.tsx
  10. 1
      src/features/ChromeCast/index.tsx
  11. 1
      src/features/Combobox/helpers/index.tsx
  12. 2
      src/features/HeaderFilters/store/hooks/index.tsx
  13. 5
      src/features/Icon/index.tsx
  14. 9
      src/features/MatchCard/CardFrontside/MatchCardMobile/index.tsx
  15. 9
      src/features/MatchCard/CardFrontside/index.tsx
  16. 6
      src/features/MatchCard/index.tsx
  17. 17
      src/features/MatchPage/components/FavouriteTeam/hooks.tsx
  18. 32
      src/features/MatchPage/components/MatchDescription/index.tsx
  19. 31
      src/features/MatchesGrid/index.tsx
  20. 1
      src/features/MultiSourcePlayer/components/ProgressBar/hooks.tsx
  21. 2
      src/features/Name/index.tsx
  22. 2
      src/features/SportsFilter/components/SelectSportPopup/index.tsx
  23. 1
      src/features/StreamPlayer/components/ProgressBar/hooks.tsx
  24. 2
      src/features/StreamPlayer/hooks/useSlider.tsx
  25. 8
      src/features/UserAccount/components/PageSubscriptions/hooks.tsx
  26. 1
      src/helpers/callApi/types.tsx
  27. 1
      src/hooks/useEventListener.tsx
  28. 29
      src/hooks/useLocalStorage.tsx
  29. 2
      src/hooks/useObjectState.tsx
  30. 1
      src/hooks/useRequest.tsx
  31. 1
      src/hooks/useStorage/index.tsx
  32. 4
      src/pages/HighlightsPage/components/FormHighlights/hooks.tsx
  33. 28
      src/requests/getLiveScores.tsx
  34. 14
      src/requests/getMatchInfo.tsx
  35. 33
      src/requests/getMatchScore.tsx
  36. 2
      src/requests/getSound.tsx
  37. 1
      src/requests/getSounds.tsx
  38. 2
      src/requests/getUserSubscribes.tsx
  39. 2
      src/requests/index.tsx
  40. 2
      src/serviceWorker.ts

@ -11,6 +11,7 @@
"postro4no" "postro4no"
], ],
"rules": { "rules": {
"@typescript-eslint/no-explicit-any": "warn",
"@typescript-eslint/array-type": [ "@typescript-eslint/array-type": [
"warn", "warn",
{ "default" : "generic" } { "default" : "generic" }

164
package-lock.json generated

@ -20,6 +20,7 @@
"react": "^17.0.2", "react": "^17.0.2",
"react-datepicker": "^3.1.3", "react-datepicker": "^3.1.3",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-query": "^3.39.3",
"react-router": "^5.2.0", "react-router": "^5.2.0",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1", "react-scripts": "^5.0.1",
@ -15819,8 +15820,6 @@
"version": "1.6.51", "version": "1.6.51",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz",
"integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==",
"dev": true,
"optional": true,
"engines": { "engines": {
"node": ">=0.6" "node": ">=0.6"
} }
@ -16079,6 +16078,21 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/broadcast-channel": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/broadcast-channel/-/broadcast-channel-3.7.0.tgz",
"integrity": "sha512-cIAKJXAxGJceNZGTZSBzMxzyOn72cVgPnKx4dc6LRjQgbaJUQqhy5rzL3zbMxkMWsGKkv2hSFkPRMEXfoMZ2Mg==",
"dependencies": {
"@babel/runtime": "^7.7.2",
"detect-node": "^2.1.0",
"js-sha3": "0.8.0",
"microseconds": "0.2.0",
"nano-time": "1.0.0",
"oblivious-set": "1.0.0",
"rimraf": "3.0.2",
"unload": "2.2.0"
}
},
"node_modules/brorand": { "node_modules/brorand": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
@ -26209,6 +26223,11 @@
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz",
"integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==" "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q=="
}, },
"node_modules/js-sha3": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz",
"integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q=="
},
"node_modules/js-string-escape": { "node_modules/js-string-escape": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz",
@ -27281,6 +27300,15 @@
"url": "https://github.com/sponsors/wooorm" "url": "https://github.com/sponsors/wooorm"
} }
}, },
"node_modules/match-sorter": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/match-sorter/-/match-sorter-6.3.1.tgz",
"integrity": "sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw==",
"dependencies": {
"@babel/runtime": "^7.12.5",
"remove-accents": "0.4.2"
}
},
"node_modules/mathml-tag-names": { "node_modules/mathml-tag-names": {
"version": "2.1.3", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz",
@ -27601,6 +27629,11 @@
"node": ">=8.6" "node": ">=8.6"
} }
}, },
"node_modules/microseconds": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/microseconds/-/microseconds-0.2.0.tgz",
"integrity": "sha512-n7DHHMjR1avBbSpsTBj6fmMGh2AGrifVV4e+WYc3Q9lO+xnSZ3NyhcBND3vzzatt05LFhoKFRxrIyklmLlUtyA=="
},
"node_modules/miller-rabin": { "node_modules/miller-rabin": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz",
@ -28049,6 +28082,14 @@
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"node_modules/nano-time": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/nano-time/-/nano-time-1.0.0.tgz",
"integrity": "sha512-flnngywOoQ0lLQOTRNexn2gGSNuM9bKj9RZAWSzhQ+UJYaAFG9bac4DW9VHjUAzrOaIcajHybCTHe/bkvozQqA==",
"dependencies": {
"big-integer": "^1.6.16"
}
},
"node_modules/nanoid": { "node_modules/nanoid": {
"version": "3.3.4", "version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
@ -28606,6 +28647,11 @@
"integrity": "sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==", "integrity": "sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==",
"dev": true "dev": true
}, },
"node_modules/oblivious-set": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/oblivious-set/-/oblivious-set-1.0.0.tgz",
"integrity": "sha512-z+pI07qxo4c2CulUHCDf9lcqDlMSo72N/4rLUpRXf6fu+q8vjt8y0xS+Tlf8NTJDdTXHbdeO1n3MlbctwEoXZw=="
},
"node_modules/obuf": { "node_modules/obuf": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz",
@ -31820,6 +31866,31 @@
"react": "0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0" "react": "0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0"
} }
}, },
"node_modules/react-query": {
"version": "3.39.3",
"resolved": "https://registry.npmjs.org/react-query/-/react-query-3.39.3.tgz",
"integrity": "sha512-nLfLz7GiohKTJDuT4us4X3h/8unOh+00MLb2yJoGTPjxKs2bc1iDhkNx2bd5MKklXnOD3NrVZ+J2UXujA5In4g==",
"dependencies": {
"@babel/runtime": "^7.5.5",
"broadcast-channel": "^3.4.1",
"match-sorter": "^6.0.2"
},
"funding": {
"type": "github",
"url": "https://github.com/sponsors/tannerlinsley"
},
"peerDependencies": {
"react": "^16.8.0 || ^17.0.0 || ^18.0.0"
},
"peerDependenciesMeta": {
"react-dom": {
"optional": true
},
"react-native": {
"optional": true
}
}
},
"node_modules/react-refresh": { "node_modules/react-refresh": {
"version": "0.11.0", "version": "0.11.0",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz",
@ -32723,6 +32794,11 @@
"url": "https://opencollective.com/unified" "url": "https://opencollective.com/unified"
} }
}, },
"node_modules/remove-accents": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.2.tgz",
"integrity": "sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA=="
},
"node_modules/remove-trailing-separator": { "node_modules/remove-trailing-separator": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
@ -36571,6 +36647,15 @@
"node": ">= 10.0.0" "node": ">= 10.0.0"
} }
}, },
"node_modules/unload": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/unload/-/unload-2.2.0.tgz",
"integrity": "sha512-B60uB5TNBLtN6/LsgAf3udH9saB5p7gqJwcFfbOEZ8BcBHnGwCf6G/TGiEqkRAxX7zAFIUtzdrXQSdL3Q/wqNA==",
"dependencies": {
"@babel/runtime": "^7.6.2",
"detect-node": "^2.0.4"
}
},
"node_modules/unpipe": { "node_modules/unpipe": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
@ -50498,9 +50583,7 @@
"big-integer": { "big-integer": {
"version": "1.6.51", "version": "1.6.51",
"resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz", "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.51.tgz",
"integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg==", "integrity": "sha512-GPEid2Y9QU1Exl1rpO9B2IPJGHPSupF5GnVIP0blYvNOMer2bTvSWs1jGOUg04hTmu67nmLsQ9TBo1puaotBHg=="
"dev": true,
"optional": true
}, },
"big.js": { "big.js": {
"version": "5.2.2", "version": "5.2.2",
@ -50705,6 +50788,21 @@
"fill-range": "^7.0.1" "fill-range": "^7.0.1"
} }
}, },
"broadcast-channel": {
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/broadcast-channel/-/broadcast-channel-3.7.0.tgz",
"integrity": "sha512-cIAKJXAxGJceNZGTZSBzMxzyOn72cVgPnKx4dc6LRjQgbaJUQqhy5rzL3zbMxkMWsGKkv2hSFkPRMEXfoMZ2Mg==",
"requires": {
"@babel/runtime": "^7.7.2",
"detect-node": "^2.1.0",
"js-sha3": "0.8.0",
"microseconds": "0.2.0",
"nano-time": "1.0.0",
"oblivious-set": "1.0.0",
"rimraf": "3.0.2",
"unload": "2.2.0"
}
},
"brorand": { "brorand": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz",
@ -58413,6 +58511,11 @@
"resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.1.5.tgz",
"integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q==" "integrity": "sha512-08bOAKweV2NUC1wqTtf3qZlnpOX/R2DU9ikpjOHs0H+ibQv3zpncVQg6um4uYtRtrwIX8M4Nh3ytK4HGlYAq7Q=="
}, },
"js-sha3": {
"version": "0.8.0",
"resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz",
"integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q=="
},
"js-string-escape": { "js-string-escape": {
"version": "1.0.1", "version": "1.0.1",
"resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz",
@ -59249,6 +59352,15 @@
"integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==", "integrity": "sha512-8z4efJYk43E0upd0NbVXwgSTQs6cT3T06etieCMEg7dRbzCbxUCK/GHlX8mhHRDcp+OLlHkPKsvqQTCvsRl2cg==",
"dev": true "dev": true
}, },
"match-sorter": {
"version": "6.3.1",
"resolved": "https://registry.npmjs.org/match-sorter/-/match-sorter-6.3.1.tgz",
"integrity": "sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw==",
"requires": {
"@babel/runtime": "^7.12.5",
"remove-accents": "0.4.2"
}
},
"mathml-tag-names": { "mathml-tag-names": {
"version": "2.1.3", "version": "2.1.3",
"resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz", "resolved": "https://registry.npmjs.org/mathml-tag-names/-/mathml-tag-names-2.1.3.tgz",
@ -59504,6 +59616,11 @@
"picomatch": "^2.3.1" "picomatch": "^2.3.1"
} }
}, },
"microseconds": {
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/microseconds/-/microseconds-0.2.0.tgz",
"integrity": "sha512-n7DHHMjR1avBbSpsTBj6fmMGh2AGrifVV4e+WYc3Q9lO+xnSZ3NyhcBND3vzzatt05LFhoKFRxrIyklmLlUtyA=="
},
"miller-rabin": { "miller-rabin": {
"version": "4.0.1", "version": "4.0.1",
"resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz",
@ -59871,6 +59988,14 @@
"dev": true, "dev": true,
"optional": true "optional": true
}, },
"nano-time": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/nano-time/-/nano-time-1.0.0.tgz",
"integrity": "sha512-flnngywOoQ0lLQOTRNexn2gGSNuM9bKj9RZAWSzhQ+UJYaAFG9bac4DW9VHjUAzrOaIcajHybCTHe/bkvozQqA==",
"requires": {
"big-integer": "^1.6.16"
}
},
"nanoid": { "nanoid": {
"version": "3.3.4", "version": "3.3.4",
"resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz", "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.4.tgz",
@ -60321,6 +60446,11 @@
"integrity": "sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==", "integrity": "sha512-eJJDYkhJFFbBBAxeh8xW+weHlkI28n2ZdQV/J/DNfWfSKlGEf2xcfAbZTv3riEXHAhL9SVOTs2pRmXiSTf78xg==",
"dev": true "dev": true
}, },
"oblivious-set": {
"version": "1.0.0",
"resolved": "https://registry.npmjs.org/oblivious-set/-/oblivious-set-1.0.0.tgz",
"integrity": "sha512-z+pI07qxo4c2CulUHCDf9lcqDlMSo72N/4rLUpRXf6fu+q8vjt8y0xS+Tlf8NTJDdTXHbdeO1n3MlbctwEoXZw=="
},
"obuf": { "obuf": {
"version": "1.1.2", "version": "1.1.2",
"resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz", "resolved": "https://registry.npmjs.org/obuf/-/obuf-1.1.2.tgz",
@ -62534,6 +62664,16 @@
"warning": "^4.0.2" "warning": "^4.0.2"
} }
}, },
"react-query": {
"version": "3.39.3",
"resolved": "https://registry.npmjs.org/react-query/-/react-query-3.39.3.tgz",
"integrity": "sha512-nLfLz7GiohKTJDuT4us4X3h/8unOh+00MLb2yJoGTPjxKs2bc1iDhkNx2bd5MKklXnOD3NrVZ+J2UXujA5In4g==",
"requires": {
"@babel/runtime": "^7.5.5",
"broadcast-channel": "^3.4.1",
"match-sorter": "^6.0.2"
}
},
"react-refresh": { "react-refresh": {
"version": "0.11.0", "version": "0.11.0",
"resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz", "resolved": "https://registry.npmjs.org/react-refresh/-/react-refresh-0.11.0.tgz",
@ -63224,6 +63364,11 @@
"mdast-util-to-markdown": "^0.6.0" "mdast-util-to-markdown": "^0.6.0"
} }
}, },
"remove-accents": {
"version": "0.4.2",
"resolved": "https://registry.npmjs.org/remove-accents/-/remove-accents-0.4.2.tgz",
"integrity": "sha512-7pXIJqJOq5tFgG1A2Zxti3Ht8jJF337m4sowbuHsW30ZnkQFnDzy9qBNhgzX8ZLW4+UBcXiiR7SwR6pokHsxiA=="
},
"remove-trailing-separator": { "remove-trailing-separator": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",
@ -66161,6 +66306,15 @@
"resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz",
"integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==" "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ=="
}, },
"unload": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/unload/-/unload-2.2.0.tgz",
"integrity": "sha512-B60uB5TNBLtN6/LsgAf3udH9saB5p7gqJwcFfbOEZ8BcBHnGwCf6G/TGiEqkRAxX7zAFIUtzdrXQSdL3Q/wqNA==",
"requires": {
"@babel/runtime": "^7.6.2",
"detect-node": "^2.0.4"
}
},
"unpipe": { "unpipe": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",

@ -33,6 +33,7 @@
"react": "^17.0.2", "react": "^17.0.2",
"react-datepicker": "^3.1.3", "react-datepicker": "^3.1.3",
"react-dom": "^17.0.2", "react-dom": "^17.0.2",
"react-query": "^3.39.3",
"react-router": "^5.2.0", "react-router": "^5.2.0",
"react-router-dom": "^5.2.0", "react-router-dom": "^5.2.0",
"react-scripts": "^5.0.1", "react-scripts": "^5.0.1",

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { import {
ProfileTypes, ProfileTypes,
PROFILE_NAMES, PROFILE_NAMES,

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { css } from 'styled-components/macro' import { css } from 'styled-components/macro'
type ProcedureName = string type ProcedureName = string

@ -10,3 +10,4 @@ export * from './currencies'
export * from './dashes' export * from './dashes'
export * from './env' export * from './env'
export * from './userAgent' export * from './userAgent'
export * from './queries'

@ -0,0 +1,4 @@
export const querieKeys = {
andrey.dekterev marked this conversation as resolved

добавь в индекс

добавь в индекс
liveMatchScores: 'liveMatchScores',
matchScore: 'matchScore',
}

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useEffect } from 'react' import { useEffect } from 'react'
import includes from 'lodash/includes' import includes from 'lodash/includes'

@ -4,6 +4,8 @@ import {
useState, useState,
} from 'react' } from 'react'
import { Router } from 'react-router-dom' import { Router } from 'react-router-dom'
import { QueryClient, QueryClientProvider } from 'react-query'
import { ReactQueryDevtools } from 'react-query/devtools'
import { history } from 'config/history' import { history } from 'config/history'
import { client } from 'config/clients' import { client } from 'config/clients'
@ -11,6 +13,8 @@ import { isAvailable } from 'config/env'
import { readToken } from 'helpers' import { readToken } from 'helpers'
import { isLocalhost } from 'serviceWorker'
import { setClientTitleAndDescription } from 'helpers/setClientHeads' import { setClientTitleAndDescription } from 'helpers/setClientHeads'
import { GlobalStores } from 'features/GlobalStores' import { GlobalStores } from 'features/GlobalStores'
@ -28,13 +32,19 @@ setClientTitleAndDescription(client.title, client.description)
const Main = () => { const Main = () => {
const [isToken, setIsToken] = useState(false) const [isToken, setIsToken] = useState(false)
const { userInfo } = useAuthStore() const { userInfo } = useAuthStore()
const queryClient = new QueryClient()
useEffect(() => { useEffect(() => {
readToken() && setIsToken(true) readToken() && setIsToken(true)
}, [userInfo]) }, [userInfo])
// имеется действующий токен // имеется действующий токен
return isToken ? <AuthenticatedApp /> : null return isToken ? (
<QueryClientProvider client={queryClient}>
<ReactQueryDevtools initialIsOpen={isLocalhost} />
<AuthenticatedApp />
</QueryClientProvider>
) : null
} }
const date = new Date() const date = new Date()

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { import {
Fragment, Fragment,
memo, memo,

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import startsWith from 'lodash/startsWith' import startsWith from 'lodash/startsWith'
import orderBy from 'lodash/orderBy' import orderBy from 'lodash/orderBy'
import toLower from 'lodash/toLower' import toLower from 'lodash/toLower'

@ -34,7 +34,7 @@ export const useFilters = () => {
const [selectedFilters, setSelectedFilters] = useState<Array<string>>([]) const [selectedFilters, setSelectedFilters] = useState<Array<string>>([])
const [isShowTournament, setIsShowTournament] = useState(true) const [isShowTournament, setIsShowTournament] = useState(true)
const [selectTournament, setSelectTournament] = useState<TournamentType>() const [selectTournament, setSelectTournament] = useState<TournamentType>()
const [sportIds, setSportIds] = useState<any>() const [sportIds, setSportIds] = useState<Array<number>>([])
const isTodaySelected = isToday(selectedDate) const isTodaySelected = isToday(selectedDate)
const compareSport = useCallback((match: Match, sportNames: Array<string>) => { const compareSport = useCallback((match: Match, sportNames: Array<string>) => {

@ -1,4 +1,5 @@
import React from 'react' /* eslint-disable @typescript-eslint/no-explicit-any */
import React, { CSSProperties } from 'react'
import * as icons from '../../libs/index' import * as icons from '../../libs/index'
export type IconProps = { export type IconProps = {
@ -8,7 +9,7 @@ export type IconProps = {
onClick?: () => void, onClick?: () => void,
refIcon: any, refIcon: any,
size?: number | string, size?: number | string,
styles?: any, styles?: CSSProperties,
} }
export const Icon: React.FC<IconProps> = ({ export const Icon: React.FC<IconProps> = ({

@ -12,8 +12,11 @@ import { useName } from 'features/Name'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
import { MatchAccess } from 'features/Matches/helpers/getMatchClickAction' import { MatchAccess } from 'features/Matches/helpers/getMatchClickAction'
import { useUserFavoritesStore } from 'features/UserFavorites/store' import { useUserFavoritesStore } from 'features/UserFavorites/store'
import { getCardColor } from 'helpers/getCardColor' import { getCardColor } from 'helpers/getCardColor'
import type { LiveScore } from 'requests'
import { NoAccessMessage } from '../../NoAccessMessage' import { NoAccessMessage } from '../../NoAccessMessage'
import { getPrepareTimeFormat } from '../../helpers' import { getPrepareTimeFormat } from '../../helpers'
import { getPrepareDateFormat } from '../../helpers/getPrepareDateFormat' import { getPrepareDateFormat } from '../../helpers/getPrepareDateFormat'
@ -50,6 +53,7 @@ type Props = {
match: Match, match: Match,
onClick: () => void, onClick: () => void,
onKeyPress: (e: KeyboardEvent<HTMLLIElement>) => void, onKeyPress: (e: KeyboardEvent<HTMLLIElement>) => void,
score?: LiveScore,
} }
export const CardFrontsideMobile = ({ export const CardFrontsideMobile = ({
@ -58,6 +62,7 @@ export const CardFrontsideMobile = ({
match, match,
onClick, onClick,
onKeyPress, onKeyPress,
score,
}: Props) => { }: Props) => {
const location = useLocation() const location = useLocation()
const { const {
@ -150,14 +155,14 @@ export const CardFrontsideMobile = ({
<TeamName nameObj={team1} /> <TeamName nameObj={team1} />
{team1InFavorites && <FavoriteSign />} {team1InFavorites && <FavoriteSign />}
</NameSignWrapper> </NameSignWrapper>
{showScore && <Score>{team1.score}</Score>} {showScore && <Score>{score?.team1.score ?? team1.score}</Score>}
</Team> </Team>
<Team> <Team>
<NameSignWrapper> <NameSignWrapper>
<TeamName nameObj={team2} /> <TeamName nameObj={team2} />
{team2InFavorites && <FavoriteSign />} {team2InFavorites && <FavoriteSign />}
</NameSignWrapper> </NameSignWrapper>
{showScore && <Score>{team2.score}</Score>} {showScore && <Score>{score?.team2.score ?? team2.score}</Score>}
</Team> </Team>
</Teams> </Teams>
<SecondaryInfo> <SecondaryInfo>

@ -6,7 +6,10 @@ import getUnixTime from 'date-fns/getUnixTime'
import { ProfileTypes, PAGES } from 'config' import { ProfileTypes, PAGES } from 'config'
import { isLffClient } from 'config/clients' import { isLffClient } from 'config/clients'
import type { LiveScore } from 'requests'
import { getCardColor } from 'helpers/getCardColor' import { getCardColor } from 'helpers/getCardColor'
import type { Match } from 'features/Matches' import type { Match } from 'features/Matches'
import { useMatchSwitchesStore } from 'features/MatchSwitches' import { useMatchSwitchesStore } from 'features/MatchSwitches'
import { useName } from 'features/Name' import { useName } from 'features/Name'
@ -47,6 +50,7 @@ type Props = {
match: Match, match: Match,
onClick: () => void, onClick: () => void,
onKeyPress: (e: KeyboardEvent<HTMLLIElement>) => void, onKeyPress: (e: KeyboardEvent<HTMLLIElement>) => void,
score?: LiveScore,
} }
export const CardFrontside = ({ export const CardFrontside = ({
@ -54,6 +58,7 @@ export const CardFrontside = ({
match, match,
onClick, onClick,
onKeyPress, onKeyPress,
score,
}: Props) => { }: Props) => {
const location = useLocation() const location = useLocation()
const { const {
@ -165,14 +170,14 @@ export const CardFrontside = ({
<TeamName nameObj={team1} /> <TeamName nameObj={team1} />
{team1InFavorites && <FavoriteSign />} {team1InFavorites && <FavoriteSign />}
</NameSignWrapper> </NameSignWrapper>
{showScore && <Score>{team1.score}</Score>} {showScore && <Score>{score?.team1.score ?? team1.score}</Score>}
</Team> </Team>
<Team isMatchPage={isMatchPage}> <Team isMatchPage={isMatchPage}>
<NameSignWrapper> <NameSignWrapper>
<TeamName nameObj={team2} /> <TeamName nameObj={team2} />
{team2InFavorites && <FavoriteSign />} {team2InFavorites && <FavoriteSign />}
</NameSignWrapper> </NameSignWrapper>
{showScore && <Score>{team2.score}</Score>} {showScore && <Score>{score?.team2.score ?? team2.score}</Score>}
</Team> </Team>
</Teams> </Teams>
{!isMatchPage && ( {!isMatchPage && (

@ -2,15 +2,18 @@ import type { Match } from 'features/Matches'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
import { LiveScore } from 'requests/getLiveScores'
andrey.dekterev marked this conversation as resolved
import type { LiveScore } from 'requests'
``` import type { LiveScore } from 'requests' ```
import { CardFrontside } from './CardFrontside' import { CardFrontside } from './CardFrontside'
import { CardFrontsideMobile } from './CardFrontside/MatchCardMobile' import { CardFrontsideMobile } from './CardFrontside/MatchCardMobile'
import { useCard } from './hooks' import { useCard } from './hooks'
type Props = { type Props = {
match: Match, match: Match,
score?: LiveScore,
} }
export const MatchCard = ({ match }: Props) => { export const MatchCard = ({ match, score }: Props) => {
const { const {
isNeedFormatTimeChanged, isNeedFormatTimeChanged,
isOwnedMatches, isOwnedMatches,
@ -27,6 +30,7 @@ export const MatchCard = ({ match }: Props) => {
onKeyPress={onKeyPress} onKeyPress={onKeyPress}
isNeedFormatTimeChanged={isNeedFormatTimeChanged} isNeedFormatTimeChanged={isNeedFormatTimeChanged}
isOwnedMatches={isOwnedMatches} isOwnedMatches={isOwnedMatches}
score={score}
/> />
) )
} }

@ -13,14 +13,15 @@ export const useFavouriteTeam = () => {
const [group1, setGroup1] = useState<Array<FavouriteTeams>>([]) const [group1, setGroup1] = useState<Array<FavouriteTeams>>([])
const [group2, setGroup2] = useState<Array<FavouriteTeams>>([]) const [group2, setGroup2] = useState<Array<FavouriteTeams>>([])
const sortTeam = (teams: Array<any>) => teams.sort((n1:FavouriteTeams, n2: FavouriteTeams) => { const sortTeam = (teams: Array<FavouriteTeams>) => (
if (n1.name_en > n2.name_en) { teams.sort((n1:FavouriteTeams, n2: FavouriteTeams) => {
return 1 if (n1.name_en > n2.name_en) {
} if (n1.name_en < n2.name_en) { return 1
return -1 } if (n1.name_en < n2.name_en) {
} return -1
return 0 }
}) return 0
}))
const changeActive = (team: FavouriteTeams) => { const changeActive = (team: FavouriteTeams) => {
setActiveId((prev) => (prev === team.id ? null : team.id)) setActiveId((prev) => (prev === team.id ? null : team.id))
} }

@ -1,5 +1,7 @@
import { useCallback } from 'react' import { useCallback } from 'react'
import { useQuery } from 'react-query'
import { format } from 'date-fns' import { format } from 'date-fns'
import includes from 'lodash/includes' import includes from 'lodash/includes'
@ -16,11 +18,16 @@ import { useMatchPageStore } from 'features/MatchPage/store'
import { parseDate } from 'helpers/parseDate' import { parseDate } from 'helpers/parseDate'
import { ProfileTypes } from 'config' import {
import { isMobileDevice } from 'config/userAgent' ProfileTypes,
querieKeys,
isMobileDevice,
} from 'config'
import { usePageParams } from 'hooks/usePageParams' import { usePageParams } from 'hooks/usePageParams'
import { getMatchScore } from 'requests'
import { import {
Description, Description,
DescriptionInnerBlock, DescriptionInnerBlock,
@ -33,7 +40,10 @@ import {
} from './styled' } from './styled'
export const MatchDescription = () => { export const MatchDescription = () => {
const { sportType } = usePageParams() const {
profileId,
sportType,
} = usePageParams()
const { user } = useAuthStore() const { user } = useAuthStore()
const { isScoreHidden } = useMatchSwitchesStore() const { isScoreHidden } = useMatchSwitchesStore()
const { suffix } = useLexicsStore() const { suffix } = useLexicsStore()
@ -45,6 +55,19 @@ export const MatchDescription = () => {
: <Name nameObj={team} /> : <Name nameObj={team} />
), [suffix]) ), [suffix])
const { data: queryScore } = useQuery({
queryFn: async () => {
if (profile?.live && !isScoreHidden) {
const score = await getMatchScore({ profileId, sportType })
return score
}
return null
},
queryKey: querieKeys.matchScore,
refetchInterval: 5000,
})
if (!profile) return <Description /> if (!profile) return <Description />
const { const {
@ -77,7 +100,8 @@ export const MatchDescription = () => {
{ {
isScoreHidden || isNil(team1.score) || isNil(team2.score) isScoreHidden || isNil(team1.score) || isNil(team2.score)
? '-' ? '-'
: `${team1.score} - ${team2.score}` : `${queryScore?.team1.score ?? team1.score} - ${queryScore?.team2.score ?? team2.score}`
} }
</Score> </Score>
<StyledLink <StyledLink

@ -1,14 +1,20 @@
import { memo, useEffect } from 'react' import { memo, useEffect } from 'react'
import { useRouteMatch } from 'react-router-dom' import { useRouteMatch } from 'react-router-dom'
import { useQuery } from 'react-query'
import { PAGES } from 'config/pages' import { PAGES } from 'config/pages'
import type { LiveScore } from 'requests'
import { getLiveScores } from 'requests'
import { MatchCard } from 'features/MatchCard' import { MatchCard } from 'features/MatchCard'
import { TournamentList } from 'features/TournamentList' import { TournamentList } from 'features/TournamentList'
import type { Match } from 'features/Matches' import type { Match } from 'features/Matches'
import { useHeaderFiltersStore } from 'features/HeaderFilters' import { useHeaderFiltersStore } from 'features/HeaderFilters'
import { Wrapper } from './styled' import { Wrapper } from './styled'
import { useMatchSwitchesStore } from '../MatchSwitches'
andrey.dekterev marked this conversation as resolved
import { querieKeys } from '../../config'
``` import { querieKeys } from '../../config' ```
import { querieKeys } from '../../config'
type MatchesGridProps = { type MatchesGridProps = {
matches: Array<Match>, matches: Array<Match>,
@ -16,6 +22,7 @@ type MatchesGridProps = {
export const MatchesGrid = memo(({ matches }: MatchesGridProps) => { export const MatchesGrid = memo(({ matches }: MatchesGridProps) => {
const isHomePage = useRouteMatch(PAGES.home)?.isExact const isHomePage = useRouteMatch(PAGES.home)?.isExact
const { isScoreHidden } = useMatchSwitchesStore()
const { const {
compareSport, compareSport,
@ -48,19 +55,39 @@ export const MatchesGrid = memo(({ matches }: MatchesGridProps) => {
return matches return matches
} }
const { data: liveMatchScores } = useQuery({
queryFn: async () => {
if (!isScoreHidden && matches.filter(({ live }) => live)?.length > 0) {
const scores = await getLiveScores()
return scores
}
return []
},
queryKey: querieKeys.liveMatchScores,
refetchInterval: 5000,
})
useEffect(() => { useEffect(() => {
if (!isHomePage) return if (!isHomePage) return
updateSportIds(matches) updateSportIds(matches)
// eslint-disable-next-line react-hooks/exhaustive-deps // eslint-disable-next-line react-hooks/exhaustive-deps
}, [selectedDate, matches]) }, [selectedDate, matches])
return ( return (
<Wrapper> <Wrapper>
{isHomePage && isShowTournament ? ( {isHomePage && isShowTournament ? (
<TournamentList matches={filteredMatches()} /> <TournamentList matches={filteredMatches()} />
) : ( ) : (
filteredMatches().map((match) => <MatchCard key={match.id} match={match} />) filteredMatches().map((match) => (
<MatchCard
key={match.id}
match={match}
score={liveMatchScores?.find(
({ match_id, sport_id }: LiveScore) => match_id === match.id
&& sport_id === match.sportType,
)}
/>
))
)} )}
</Wrapper> </Wrapper>
) )

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useMemo } from 'react' import { useMemo } from 'react'
import { secondsToHms } from 'helpers' import { secondsToHms } from 'helpers'

@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import styled from 'styled-components/macro' import styled from 'styled-components/macro'
import { useLexicsStore } from 'features/LexicsStore' import { useLexicsStore } from 'features/LexicsStore'

@ -19,7 +19,7 @@ type Props = {
onModalClose: () => void, onModalClose: () => void,
onSportClick: (sport: string) => void, onSportClick: (sport: string) => void,
selectedSport: Array<string>, selectedSport: Array<string>,
sportIds: Array<string>, sportIds: Array<number>,
sports: SportsType, sports: SportsType,
} }
export const SelectSportPopup = ({ export const SelectSportPopup = ({

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useMemo, RefObject } from 'react' import { useMemo, RefObject } from 'react'
import { secondsToHms } from 'helpers' import { secondsToHms } from 'helpers'

@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useRef } from 'react' import { useRef } from 'react'
import { useEventListener, useToggle } from 'hooks' import { useEventListener, useToggle } from 'hooks'

@ -1,6 +1,10 @@
import { useEffect, useState } from 'react' import { useEffect, useState } from 'react'
import { getUserSubscribes, Subscribe } from 'requests/getUserSubscribes' import {
getUserSubscribes,
Subscribe,
Subscribes,
} from 'requests/getUserSubscribes'
import { cancelSubscribe } from 'requests/cancelSubscribe' import { cancelSubscribe } from 'requests/cancelSubscribe'
import { useLexicsStore } from 'features/LexicsStore' import { useLexicsStore } from 'features/LexicsStore'
@ -10,7 +14,7 @@ export const useUserSubscribes = () => {
const { addLexicsConfig } = useLexicsStore() const { addLexicsConfig } = useLexicsStore()
const [selectedSubscribe, setSelectedSubscribe] = useState<Subscribe>({} as Subscribe) const [selectedSubscribe, setSelectedSubscribe] = useState<Subscribe>({} as Subscribe)
const [subscribes, setSubscribes] = useState<any>([]) const [subscribes, setSubscribes] = useState<Subscribes>([])
const [isCancelPopupOpen, setIsCancelPopupOpen] = useState(false) const [isCancelPopupOpen, setIsCancelPopupOpen] = useState(false)
const [changeCardPopupOpen, setChangeCardPopupOpen] = useState(false) const [changeCardPopupOpen, setChangeCardPopupOpen] = useState(false)
const [isSubCanceled, setSubCanceled] = useState(false) const [isSubCanceled, setSubCanceled] = useState(false)

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
export type RequestConfig = { export type RequestConfig = {
body?: any, body?: any,
headers?: Headers, headers?: Headers,

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { RefObject } from 'react' import type { RefObject } from 'react'
import { useEffect, useRef } from 'react' import { useEffect, useRef } from 'react'

@ -1,29 +0,0 @@
import { useState } from 'react'
export const useLocalStorage = (keyName: string, defaultValue?: any) => {
const [storedValue, setStoredValue] = useState(() => {
try {
const value = localStorage.getItem(keyName)
if (value) {
return JSON.parse(value)
}
localStorage.setItem(keyName, JSON.stringify(defaultValue))
return defaultValue
} catch (err) {
return defaultValue
}
})
const setValue = (newValue: any) => {
try {
localStorage.setItem(keyName, JSON.stringify(newValue))
} catch (err) {
/* eslint-disable-next-line */
console.log(err)
}
setStoredValue(newValue)
}
return [storedValue, setValue]
}

@ -1,3 +1,5 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import type { Dispatch } from 'react' import type { Dispatch } from 'react'
import { useCallback, useState } from 'react' import { useCallback, useState } from 'react'

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useState, useCallback } from 'react' import { useState, useCallback } from 'react'
/** /**

@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-explicit-any */
import { useState, useEffect } from 'react' import { useState, useEffect } from 'react'
import { queryParamStorage } from 'features/QueryParamsStorage' import { queryParamStorage } from 'features/QueryParamsStorage'

@ -123,7 +123,7 @@ export const useHighlightsForm = () => {
const { playerHighlight } = useUserFavoritesStore() const { playerHighlight } = useUserFavoritesStore()
const [sports, setSports] = useState<Array<SportTypeName>>([]) const [sports, setSports] = useState<Array<SportTypeName>>([])
const [sounds, setSounds] = useState<any>([]) const [sounds, setSounds] = useState<Array<Sound>>([])
const [isFetchingTeams, setIsFetchingTeams] = useState(false) const [isFetchingTeams, setIsFetchingTeams] = useState(false)
const [teams, setTeams] = useState<Array<TeamType>>([]) const [teams, setTeams] = useState<Array<TeamType>>([])
const [playersData, setPlayersData] = useState<Array<PlayerType>>([]) const [playersData, setPlayersData] = useState<Array<PlayerType>>([])
@ -301,6 +301,8 @@ export const useHighlightsForm = () => {
useEffect(() => { useEffect(() => {
if (playerHighlight?.sportType && playerHighlight?.profile) { if (playerHighlight?.sportType && playerHighlight?.profile) {
// TODO: исправить any
// eslint-disable-next-line
setFormState((state: any) => ({ setFormState((state: any) => ({
...state, ...state,
selectedPlayer: { selectedPlayer: {

@ -0,0 +1,28 @@
import { callApi } from 'helpers'
andrey.dekterev marked this conversation as resolved

в индекс

в индекс
import { API_ROOT } from 'config'
type ScoreTeam = {
id: number,
score: number | null,
}
export type LiveScore = {
match_id: number,
sport_id: number,
team1:ScoreTeam,
team2: ScoreTeam,
}
export const getLiveScores = (): Promise<Array<LiveScore>> => {
const url = `${API_ROOT}/v1/matches/live/scores`
const config = {
method: 'GET',
}
return callApi({
config,
url,
})
}

@ -19,6 +19,13 @@ export type Team = {
score: number, score: number,
} }
export type MatchTournament = {
id: number,
name_eng: string,
name_rus: string,
sportType: SportTypes,
}
export type VideoBound = { export type VideoBound = {
e: string, e: string,
h: string, h: string,
@ -42,12 +49,7 @@ export type MatchInfo = {
sub: boolean, sub: boolean,
team1: Team, team1: Team,
team2: Team, team2: Team,
tournament: { tournament: MatchTournament,
id: number,
name_eng: string,
name_rus: string,
sportType: SportTypes,
},
video_bounds?: VideoBounds, video_bounds?: VideoBounds,
youtube_link?: string, youtube_link?: string,
} | null } | null

@ -0,0 +1,33 @@
import { callApi } from 'helpers'
import { API_ROOT } from 'config'
import type { Team, MatchTournament } from 'requests/getMatchInfo'
type Params = {
profileId: number,
sportType: number,
}
type Response = {
match_date: string,
match_date_utc: string,
match_id: number,
sport_id: number,
team1: Team,
team2: Team,
tournament: MatchTournament,
}
export const getMatchScore = ({ profileId, sportType }: Params): Promise<Response> => {
const url = `${API_ROOT}/v1/matches/${sportType}/${profileId}/scores`
const config = {
method: 'GET',
}
return callApi({
config,
url,
})
}

@ -3,6 +3,8 @@ import { API_ROOT } from 'config'
type ResponseSound = { type ResponseSound = {
asset: string, asset: string,
id: number,
name: string,
} }
export const getSound = async (id: number | string): Promise<ResponseSound> => { export const getSound = async (id: number | string): Promise<ResponseSound> => {

@ -3,6 +3,7 @@ import { API_ROOT } from 'config'
type ResponseSound = { type ResponseSound = {
asset: string, asset: string,
id: number,
name: string, name: string,
} }

@ -35,7 +35,7 @@ type Team = {
name_ru: string, name_ru: string,
} }
type Subscribes = Array<Subscribe> export type Subscribes = Array<Subscribe>
export const getUserSubscribes = ( export const getUserSubscribes = (
_p_email: string, _p_email: string,

@ -27,3 +27,5 @@ export * from './buySubscription'
export * from './saveMatchStats' export * from './saveMatchStats'
export * from './getGeoInfo' export * from './getGeoInfo'
export * from './getTokenVirtualUser' export * from './getTokenVirtualUser'
export * from './getMatchScore'
export * from './getLiveScores'

@ -10,7 +10,7 @@
// To learn more about the benefits of this model and instructions on how to // To learn more about the benefits of this model and instructions on how to
// opt-in, read https://cra.link/PWA // opt-in, read https://cra.link/PWA
/* eslint-disable no-console */ /* eslint-disable no-console */
const isLocalhost = Boolean( export const isLocalhost = Boolean(
window.location.hostname === 'localhost' window.location.hostname === 'localhost'
// [::1] is the IPv6 localhost address. // [::1] is the IPv6 localhost address.
|| window.location.hostname === '[::1]' || window.location.hostname === '[::1]'

Loading…
Cancel
Save