extracted closeNav function to Utils

This commit is contained in:
cnachtigall1991
2021-10-20 18:04:38 +02:00
parent ac1c5eb470
commit ebe2f1d3cc
3 changed files with 14 additions and 15 deletions

View File

@@ -2,6 +2,12 @@ export const setTitle = (title) => {
document.title = `${title} | csgoWTF`
}
export const closeNav = (navSelector) => {
const nav = document.querySelector(navSelector)
if (nav.classList.contains('show'))
nav.classList.remove('show')
}
export const GetWinLoss = (matchResult, teamId) => {
if (matchResult === teamId) {
return 'win'

View File

@@ -4,7 +4,7 @@ import {SaveLastVisitedToLocalStorage} from "./LocalStorage";
import {GetHLTV_1} from "./HLTV";
import {DisplayRank, LoadImage} from "./Display";
import {GetUser, TrackMe, getPlayerValue} from "./ApiRequests";
import {setTitle, GetWinLoss, truncate, checkStatEmpty, getPlayerArr, constructAvatarUrl, GetAvgRank, FixMapName} from "./Utils";
import {setTitle, GetWinLoss, truncate, checkStatEmpty, getPlayerArr, constructAvatarUrl, GetAvgRank, FixMapName, closeNav} from "./Utils";
export {
FormatDate, FormatFullDuration, FormatFullDate, FormatDuration,
@@ -13,5 +13,5 @@ export {
GetHLTV_1,
DisplayRank, LoadImage,
GetUser, TrackMe, getPlayerValue,
setTitle, GetWinLoss, truncate, checkStatEmpty, getPlayerArr, constructAvatarUrl, GetAvgRank, FixMapName
setTitle, GetWinLoss, truncate, checkStatEmpty, getPlayerArr, constructAvatarUrl, GetAvgRank, FixMapName, closeNav
}