move typsecript libs to dev deps

This commit is contained in:
Elijah Steres 2021-01-08 11:03:11 -05:00
parent 2cad62eda4
commit 013d1e0585
3 changed files with 15 additions and 13 deletions

View File

@ -4,6 +4,17 @@
"private": true, "private": true,
"proxy": "http://localhost:5000", "proxy": "http://localhost:5000",
"dependencies": { "dependencies": {
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
"socket.io-client": "^3.0.5",
"twemoji": "^13.0.1",
"typescript": "^4.1.3",
"web-vitals": "^0.2.4"
},
"devDependencies" : {
"@testing-library/jest-dom": "^5.11.8", "@testing-library/jest-dom": "^5.11.8",
"@testing-library/react": "^11.2.2", "@testing-library/react": "^11.2.2",
"@testing-library/user-event": "^12.6.0", "@testing-library/user-event": "^12.6.0",
@ -14,16 +25,7 @@
"@types/react-router": "^5.1.10", "@types/react-router": "^5.1.10",
"@types/react-router-dom": "^5.1.7", "@types/react-router-dom": "^5.1.7",
"@types/socket.io-client": "^1.4.34", "@types/socket.io-client": "^1.4.34",
"@types/twemoji": "^12.1.1", "@types/twemoji": "^12.1.1"
"react": "^17.0.1",
"react-dom": "^17.0.1",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.1",
"socket.io-client": "^3.0.5",
"twemoji": "^13.0.1",
"typescript": "^4.1.3",
"web-vitals": "^0.2.4"
}, },
"scripts": { "scripts": {
"start": "react-scripts start", "start": "react-scripts start",

View File

@ -7,7 +7,7 @@ function GamePage() {
let searchparams = new URLSearchParams(window.location.search); let searchparams = new URLSearchParams(window.location.search);
let gameId = searchparams.get('id'); let gameId = searchparams.get('id');
let [games, setGames] = useState(new Array<[string, GameState]>()); let [games, setGames] = useState<[string, GameState][]>([]);
useListener((newGames) => setGames(newGames)); useListener((newGames) => setGames(newGames));
let game = games.find((game) => game[0] === gameId) let game = games.find((game) => game[0] === gameId)

View File

@ -13,14 +13,14 @@ function GamesPage() {
let searchparams = new URLSearchParams(search); let searchparams = new URLSearchParams(search);
let filter = searchparams.get('league') ?? "" let filter = searchparams.get('league') ?? ""
let [games, setGames] = useState(new Array<[string, GameState]>()); let [games, setGames] = useState<[string, GameState][]>([]);
useListener(setGames); useListener(setGames);
let filters = useRef(filter !== "" ? [filter] : []); let filters = useRef(filter !== "" ? [filter] : []);
games.forEach((game) => { if (game[1].is_league && !filters.current.includes(game[1].leagueoruser)) { filters.current.push(game[1].leagueoruser) }}); games.forEach((game) => { if (game[1].is_league && !filters.current.includes(game[1].leagueoruser)) { filters.current.push(game[1].leagueoruser) }});
filters.current = filters.current.filter((f) => games.find((game) => game && game[1].is_league && game[1].leagueoruser === f) || f === filter); filters.current = filters.current.filter((f) => games.find((game) => game && game[1].is_league && game[1].leagueoruser === f) || f === filter);
let gameList = useRef(new Array<(string | null)>()); let gameList = useRef<(string | null)[]>([]);
let filterGames = games.filter((game, i) => filter === "" || game[1].leagueoruser === filter); let filterGames = games.filter((game, i) => filter === "" || game[1].leagueoruser === filter);
updateList(gameList.current, filterGames, searchparams.get('game')); updateList(gameList.current, filterGames, searchparams.get('game'));