commit
4aee87e4d9
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -357,3 +357,4 @@ Pipfile
|
|||
env
|
||||
/data/leagues
|
||||
/simmadome/build
|
||||
/simmadome/.eslintcache
|
||||
|
|
|
@ -93,7 +93,7 @@ def create_league():
|
|||
new_league = league_structure(config['name'])
|
||||
new_league.setup(
|
||||
league_dic,
|
||||
division_games=config['division_series'], # need to add a check that makes sure these values are ok
|
||||
division_games=config['division_series'],
|
||||
inter_division_games=config['inter_division_series'],
|
||||
inter_league_games=config['inter_league_series'],
|
||||
)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
[{"/Users/elijah/Documents/Projects/matteo/simmadome/src/index.tsx":"1","/Users/elijah/Documents/Projects/matteo/simmadome/src/reportWebVitals.ts":"2","/Users/elijah/Documents/Projects/matteo/simmadome/src/GamesPage.tsx":"3","/Users/elijah/Documents/Projects/matteo/simmadome/src/GamePage.tsx":"4","/Users/elijah/Documents/Projects/matteo/simmadome/src/CreateLeague.tsx":"5","/Users/elijah/Documents/Projects/matteo/simmadome/src/GamesUtil.tsx":"6","/Users/elijah/Documents/Projects/matteo/simmadome/src/util.tsx":"7","/Users/elijah/Documents/Projects/matteo/simmadome/src/Game.tsx":"8"},{"size":2368,"mtime":1610663769654,"results":"9","hashOfConfig":"10"},{"size":425,"mtime":1610566206674,"results":"11","hashOfConfig":"10"},{"size":4725,"mtime":1610664926203,"results":"12","hashOfConfig":"10"},{"size":1836,"mtime":1610677519051,"results":"13","hashOfConfig":"10"},{"size":18825,"mtime":1610778204901,"results":"14","hashOfConfig":"10"},{"size":1116,"mtime":1610677473305,"results":"15","hashOfConfig":"10"},{"size":961,"mtime":1610694553519,"results":"16","hashOfConfig":"10"},{"size":3089,"mtime":1610572714752,"results":"17","hashOfConfig":"10"},{"filePath":"18","messages":"19","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1bvn6qu",{"filePath":"20","messages":"21","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"22","messages":"23","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"24","messages":"25","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"26","messages":"27","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"28","messages":"29","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"30","messages":"31","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},{"filePath":"32","messages":"33","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/elijah/Documents/Projects/matteo/simmadome/src/index.tsx",[],"/Users/elijah/Documents/Projects/matteo/simmadome/src/reportWebVitals.ts",[],"/Users/elijah/Documents/Projects/matteo/simmadome/src/GamesPage.tsx",[],"/Users/elijah/Documents/Projects/matteo/simmadome/src/GamePage.tsx",[],"/Users/elijah/Documents/Projects/matteo/simmadome/src/CreateLeague.tsx",[],"/Users/elijah/Documents/Projects/matteo/simmadome/src/GamesUtil.tsx",[],"/Users/elijah/Documents/Projects/matteo/simmadome/src/util.tsx",[],"/Users/elijah/Documents/Projects/matteo/simmadome/src/Game.tsx",[]]
|
|
@ -16,15 +16,5 @@
|
|||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<!--
|
||||
This HTML file is a template.
|
||||
If you open it directly in the browser, you will see an empty page.
|
||||
|
||||
You can add webfonts, meta tags, or analytics to this file.
|
||||
The build step will place the bundled scripts into the <body> tag.
|
||||
|
||||
To begin the development, run `npm start` or `yarn start`.
|
||||
To create a production bundle, use `npm run build` or `yarn build`.
|
||||
-->
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -171,6 +171,8 @@
|
|||
|
||||
.update_text {
|
||||
text-align: start;
|
||||
margin-top: 0.2rem;
|
||||
margin-bottom: 0.2rem;
|
||||
}
|
||||
|
||||
.field {
|
||||
|
|
|
@ -70,10 +70,5 @@
|
|||
|
||||
@media only screen and (max-device-width: 800px) {
|
||||
.container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(1, minmax(700px, 90%));
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
transform: translate(-50%, 0);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -5,23 +5,29 @@ import './GamesPage.css';
|
|||
import Game from './Game';
|
||||
|
||||
function GamesPage() {
|
||||
let gameList = useRef<(string | null)[]>([]);
|
||||
|
||||
let [search, setSearch] = useState(window.location.search);
|
||||
useEffect(() => {
|
||||
setSearch(window.location.search);
|
||||
gameList.current = [];
|
||||
//eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [window.location.search])
|
||||
|
||||
// get filter term
|
||||
let searchparams = new URLSearchParams(search);
|
||||
let filter = searchparams.get('league') ?? ""
|
||||
|
||||
// set up socket listener
|
||||
let [games, setGames] = useState<[string, GameState][]>([]);
|
||||
useListener(setGames);
|
||||
|
||||
// build filter list
|
||||
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) }});
|
||||
filters.current = filters.current.filter((f) => games.find((game) => game && game[1].is_league && game[1].leagueoruser === f) || f === filter);
|
||||
|
||||
let gameList = useRef<(string | null)[]>([]);
|
||||
// update game list
|
||||
let filterGames = games.filter((game, i) => filter === "" || game[1].leagueoruser === filter);
|
||||
updateList(gameList.current, filterGames, searchparams.get('game'));
|
||||
|
||||
|
|
|
@ -55,6 +55,12 @@ h2 {
|
|||
margin: auto;
|
||||
}
|
||||
|
||||
#links {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
#link_div {
|
||||
text-align: right;
|
||||
position: absolute;
|
||||
|
@ -63,6 +69,12 @@ h2 {
|
|||
display: flex;
|
||||
}
|
||||
|
||||
#nav_links {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
left: 2rem;
|
||||
}
|
||||
|
||||
.github_logo, .twitter_logo, .patreon_container {
|
||||
height: 2rem;
|
||||
width: 2rem;
|
||||
|
@ -97,15 +109,18 @@ a:hover {
|
|||
color: white;
|
||||
}
|
||||
|
||||
#utility_links {
|
||||
position: absolute;
|
||||
top: 1rem;
|
||||
left: 2rem;
|
||||
}
|
||||
|
||||
img.emoji {
|
||||
height: 1em;
|
||||
width: 1em;
|
||||
margin: 0 .05em 0 .1em;
|
||||
vertical-align: -0.1em;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 800px) {
|
||||
#link_div, #nav_links {
|
||||
position: static;
|
||||
margin-top: 0.5rem;
|
||||
margin-left: 2rem;
|
||||
margin-right: 2rem;
|
||||
}
|
||||
}
|
|
@ -29,6 +29,10 @@ ReactDOM.render(
|
|||
function Header() {
|
||||
return (
|
||||
<div id="header">
|
||||
<div id="links">
|
||||
<div id="nav_links">
|
||||
<Link to="/create_league">Create a League</Link>
|
||||
</div>
|
||||
<div id="link_div">
|
||||
<a href="https://www.patreon.com/sixteen" className="patreon_link" target="_blank" rel="noopener noreferrer">
|
||||
<div className="patreon_container">
|
||||
|
@ -42,11 +46,9 @@ function Header() {
|
|||
<img className="twitter_logo" src={twitterLogo} alt="Twitter"/>
|
||||
</a>
|
||||
</div>
|
||||
<div id="utility_links">
|
||||
<Link to="/create_league">Create a League</Link>
|
||||
</div>
|
||||
<a href="/" className="page_header"><h2 className="page_header" style={{fontSize:"50px"} as React.CSSProperties}>THE SIMMADOME</h2></a>
|
||||
<h2 className="page_header">Join SIBR on <a href="https://discord.gg/UhAajY2NCW" className="link"><img src={discordlogo} alt="" height="30"/></a> to start your own games!</h2>
|
||||
</div>
|
||||
<a href="/" className="page_header"><h2 className="page_header" style={{fontSize:"50px"} as React.CSSProperties}>THE SIMMADOME</h2></a>
|
||||
<h2 className="page_header">Join SIBR on <a href="https://discord.gg/UhAajY2NCW" className="link"><img src={discordlogo} alt="" height="30"/></a> to start your own games!</h2>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue