forked from CSGOWTF/csgowtf
load moar matches and save-scroll-state for player
This commit is contained in:
@@ -129,3 +129,16 @@ export const GetWeaponDmg = async (match_id) => {
|
||||
console.log(e)
|
||||
}
|
||||
}
|
||||
|
||||
export const LoadMoreMatchesExplore = async (date) => {
|
||||
try {
|
||||
const res = await axios.get(`${API_URL}/matches/next/${date}`)
|
||||
|
||||
if (res.status === 200) {
|
||||
return res.data
|
||||
}
|
||||
} catch (err) {
|
||||
// TODO: 400, 404
|
||||
console.log(err.response.status, err.response.statusText)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,3 +93,11 @@ export const CreatePlayersArray = (stats) => {
|
||||
}
|
||||
return arr
|
||||
}
|
||||
|
||||
export const scrollToPos = (pos = 0) => {
|
||||
window.scrollTo({
|
||||
top: pos,
|
||||
left: 0,
|
||||
behavior: 'smooth'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,20 +1,38 @@
|
||||
import {FormatDate, FormatDuration, FormatFullDate, FormatFullDuration, FormatVacDate, MatchNotParsedTime} from "./DateTime";
|
||||
import {
|
||||
FormatDate,
|
||||
FormatDuration,
|
||||
FormatFullDate,
|
||||
FormatFullDuration,
|
||||
FormatVacDate,
|
||||
MatchNotParsedTime
|
||||
} from "./DateTime";
|
||||
import {GoToLink, GoToMatch, GoToPlayer} from "./GoTo";
|
||||
import {SaveLastVisitedToLocalStorage} from "./LocalStorage";
|
||||
import {GetHLTV_1} from "./HLTV";
|
||||
import {DisplayRank, LoadImage} from "./Display";
|
||||
import {GetMatchDetails, GetPlayerMeta, GetPlayerValue, GetUser, LoadMoreMatches, TrackMe, GetWeaponDmg, GetMatches} from "./ApiRequests";
|
||||
import {
|
||||
GetMatchDetails,
|
||||
GetMatches,
|
||||
GetPlayerMeta,
|
||||
GetPlayerValue,
|
||||
GetUser,
|
||||
GetWeaponDmg,
|
||||
LoadMoreMatches,
|
||||
LoadMoreMatchesExplore,
|
||||
TrackMe
|
||||
} from "./ApiRequests";
|
||||
import {
|
||||
checkStatEmpty,
|
||||
closeNav,
|
||||
constructAvatarUrl,
|
||||
CreatePlayersArray,
|
||||
FixMapName,
|
||||
getPlayerArr,
|
||||
GetWinLoss,
|
||||
setTitle,
|
||||
truncate,
|
||||
sortObjectValue,
|
||||
CreatePlayersArray
|
||||
truncate,
|
||||
scrollToPos
|
||||
} from "./Utils";
|
||||
|
||||
export {
|
||||
@@ -48,5 +66,7 @@ export {
|
||||
sortObjectValue,
|
||||
GetWeaponDmg,
|
||||
CreatePlayersArray,
|
||||
GetMatches
|
||||
GetMatches,
|
||||
LoadMoreMatchesExplore,
|
||||
scrollToPos
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user