diff --git a/public/models/Games.js b/public/models/Games.js new file mode 100644 index 0000000..afbe6a9 --- /dev/null +++ b/public/models/Games.js @@ -0,0 +1,60 @@ +let games = {//Games MODEL + + "winCon":"winCondition", + "played":"boolean", + "playerA": + { + "_id":"id", + "champ":"champName", + "champSkin":"champskin", + "rank":"playerRank", + "winner":"boolean", + "summoners": + { + "s1":"spellName", + "s2":"spellName" + }, + "runes":{},//Runes + "score":"", + "creepScore":"" + }, + "playerB": + { + "_id": "id", + "champ": "champName", + "champSkin": "champskin", + "rank": "playerRank", + "winner": "boolean", + "summoners": + { + "s1": "spellName", + "s2": "spellName" + }, + "runes": {}, //Runes + "score": "", + "creepScore":"" + } +} + +const mongoose = require('mongoose'); +const Schema = mongoose.Schema; + +let Game = +new Schema( + { + winCon: {type: String, required: false, max: 100}, + played: {type:Boolean, required: true,}, + playerA: {type:Object, required:true}, + playerA: {type:Object, required:true}, + playerB: {type:Object, required:true} + } +); + + + + +const G= module.exports = mongoose.model('user', Game); +module.exports.get = (callback, limit)=> +{ + G.find(callback).limit(limit); +} \ No newline at end of file diff --git a/public/models/Leagues.js b/public/models/Leagues.js new file mode 100644 index 0000000..6548eb7 --- /dev/null +++ b/public/models/Leagues.js @@ -0,0 +1,47 @@ +let leaguesModel = {//Leagues[0] + "name":"Legendary", + "players": + [ + { + "name":"String", + "points":10, + "playedMatches":10 + }, + { + "name":"String", + "points":10, + "playedMatches":10 + } + ], + "games": + [ + { + "_id":"String" + }, + { + "_id": "String" + } + ] + } + + + const mongoose = require('mongoose'); +const Schema = mongoose.Schema; + +let League = +new Schema( + { + name: {type: String, required: false, max: 100}, + players: {type:Array, required: true,}, + games: {type:Array, required:true} + } +); + + + + +const L = module.exports = mongoose.model('user', League); +module.exports.get = (callback, limit)=> +{ + L.find(callback).limit(limit); +} \ No newline at end of file diff --git a/src/Components/Controls.js b/src/Components/Controls.jsx similarity index 100% rename from src/Components/Controls.js rename to src/Components/Controls.jsx diff --git a/src/Components/LeagueTable.css b/src/Components/LeagueTable.css new file mode 100644 index 0000000..e69de29 diff --git a/src/Components/LeagueTable.jsx b/src/Components/LeagueTable.jsx new file mode 100644 index 0000000..9854bbc --- /dev/null +++ b/src/Components/LeagueTable.jsx @@ -0,0 +1,74 @@ +import './LeagueTable.css' + +import React from 'react' + + + +class LeagueTable extends React.Component +{ + constructor() + { + super() + // this.league = this.props.league; + this.league = {//Leagues[0] + "name":"Legendary League", + "players": + [ + { + "name":"hc12", + "points":10, + "playedMatches":10 + }, + { + "name":"DashPT5", + "points":10, + "playedMatches":10 + } + ], + "games": + [ + { + "_id":"String" + }, + { + "_id": "String" + } + ] + } + } + tableHeaders() + { + return( +