Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions app/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
In this application is used:
React, React-Router, Redux, React-Redux and React-Bootstrap. It is also used flexbox at some time.

About this app:
In this application of League shows the information of the players, you can choose the favorite teams, you can make purchases in the store and see a calendar of the matches that were played.
20 changes: 20 additions & 0 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "app",
"version": "0.1.0",
"private": true,
"dependencies": {
"react": "^16.2.0",
"react-bootstrap": "^0.32.1",
"react-dom": "^16.2.0",
"react-redux": "^5.0.7",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.1",
"redux": "^4.0.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"eject": "react-scripts eject"
}
}
11 changes: 11 additions & 0 deletions app/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
<title>League</title>
</head>
<body>
<div id="root"></div>
</body>
</html>
22 changes: 22 additions & 0 deletions app/src/Router.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React from 'react';
import { BrowserRouter, Route, Switch } from 'react-router-dom';

import Jugadores from './components/jugadores/Jugadores';
import FavoriteTeam from './components/favorite-team/FavoriteTeam';
import Shop from './components/shop/Shop';
import Calendario from './components/calendario/Calendario';
import NotFound from './components/common/not-found/NotFound';

const Router = () => (
<BrowserRouter>
<Switch>
<Route path='/jugadores' component={Jugadores} />
<Route path='/favorite-team' component={FavoriteTeam} />
<Route path='/shop' component={Shop} />
<Route path='/calendario' component={Calendario} />
<Route component={NotFound} />
</Switch>
</BrowserRouter>
)

export default Router;
15 changes: 15 additions & 0 deletions app/src/actionCreators.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
const addToCart = product => {
return {
type: "ADD_TO_CART",
product
}
}

const removeFromCart = product => {
return {
type: "REMOVE_FROM_CART",
product
}
}

export { addToCart, removeFromCart };
Binary file added app/src/assets/fotos/ernesto.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/fotos/hugo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/fotos/jose.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/fotos/juan.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/fotos/luis.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/fotos/manuel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/fotos/paco.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/fotos/sergio.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/logos/felinos.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/logos/piratas.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/logos/tiburones.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/src/assets/stadium.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions app/src/components/calendario/Calendario.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.calendarios {
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
}
60 changes: 60 additions & 0 deletions app/src/components/calendario/Calendario.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
import React, { Component } from 'react';
import { Grid, PageHeader } from 'react-bootstrap';

import './Calendario.css';

import Juego from './../common/juego/Juego';

import LogoFelinos from './../../assets/logos/felinos.png';
import LogoPiratas from './../../assets/logos/piratas.png';
import LogoTiburones from './../../assets/logos/tiburones.png';

class Calendario extends Component {
render() {
return (
<Grid>
<PageHeader>
Calendar <small>Results of all league matches</small>
</PageHeader>

<div className="calendarios">
<Juego
localNombre="Felinos"
localLogo={LogoFelinos}
localAnotaciones="2"
visitanteNombre="Piratas"
visitanteLogo={LogoPiratas}
visitanteAnotaciones="1"
estadio="Estadio Olímpico"
fecha="20-Abril-2018"
hora="8:00 pm"
/>
<Juego
localNombre="Piratas"
localLogo={LogoPiratas}
localAnotaciones="2"
visitanteNombre="Tiburones"
visitanteLogo={LogoTiburones}
visitanteAnotaciones="2"
estadio="Estadio Universitario"
fecha="24-Abril-2018"
hora="7:00 pm"
/>
<Juego
localNombre="Tiburones"
localLogo={LogoTiburones}
localAnotaciones="1"
visitanteNombre="Felinos"
visitanteLogo={LogoFelinos}
visitanteAnotaciones="4"
estadio="Estadio de la Ciudad"
fecha="26-Abril-2018"
hora="9:00 pm"
/>
</div>
</Grid>
);
}
}

export default Calendario;
17 changes: 17 additions & 0 deletions app/src/components/common/equipo/Equipo.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
.team-logo {
width: 150px;
filter: drop-shadow(5px 5px 5px #222);
}

.like {
font-size: 25px;
cursor: pointer;
filter: drop-shadow(1px 1px #222);
}

.like_selected {
font-size: 25px;
cursor: pointer;
filter: drop-shadow(1px 1px #222);
color: red;
}
51 changes: 51 additions & 0 deletions app/src/components/common/equipo/Equipo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import React, { Component } from 'react';
import { Glyphicon } from 'react-bootstrap';

import './Equipo.css';

class Equipo extends Component {
state = {
equipos: [],
fav: { value: 'like' }
}

// When you give "like ♥" to a team, it stays saved even if you restart the browser

componentDidMount() {
const localFavs = localStorage.getItem(this.props.nombre);

if (localFavs) {
this.setState({
fav: JSON.parse(localFavs)
})
}
}

setFav() {
const fav = { ...this.state.fav };
fav.value = fav.value === 'like' ? 'like_selected' : 'like';

this.setState({
fav
});
}

componentDidUpdate() {
localStorage.setItem(this.props.nombre, JSON.stringify(this.state.fav));
}

render() {
return (
<div>
<img
className="team-logo"
src={this.props.logo}
alt={this.props.nombre}
/>
<p onClick={this.setFav.bind(this)} className={this.state.fav.value}><Glyphicon glyph="glyphicon glyphicon-heart" /></p>
</div>
);
}
}

export default Equipo;
35 changes: 35 additions & 0 deletions app/src/components/common/header/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { Component } from 'react';
import { Navbar, Nav, NavItem, Glyphicon } from 'react-bootstrap';

class Header extends Component {
render() {
return (
<Navbar>
<Navbar.Header>
<Navbar.Brand>
League
</Navbar.Brand>
<Navbar.Toggle />
</Navbar.Header>
<Navbar.Collapse>
<Nav pullRight>
<NavItem href="/jugadores">
<Glyphicon glyph="glyphicon glyphicon-user"/> Players
</NavItem>
<NavItem href="../../favorite-team">
<Glyphicon glyph="glyphicon glyphicon-star"/> Vote favorite Team
</NavItem>
<NavItem href="../../shop">
<Glyphicon glyph="glyphicon glyphicon-shopping-cart"/> Shop
</NavItem>
<NavItem href="/calendario">
<Glyphicon glyph="glyphicon glyphicon-calendar"/> Calendar
</NavItem>
</Nav>
</Navbar.Collapse>
</Navbar>
);
}
}

export default Header;
27 changes: 27 additions & 0 deletions app/src/components/common/juego/Juego.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
.juegos {
display: flex;
}

.card-game {
width: 200px;
margin: 20px;
}

.logo-score {
display: flex;
justify-content: center;
align-items: center;
}

.score-game {
font-size: 40px;
}

.info-game {
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
text-align: center;
font-size: 12px;
}
45 changes: 45 additions & 0 deletions app/src/components/common/juego/Juego.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import React, { Component } from 'react';
import { Image } from 'react-bootstrap';

import Equipo from './../equipo/Equipo';
import Stadium from './../../../assets/stadium.png';

import './Juego.css';

class Juego extends Component {
render() {
return (
<div className="juegos text-center">
{/* Equipo local */}
<div className="card-game">
<div className="logo-score">
<Equipo nombre={this.props.localNombre} logo={this.props.localLogo} />
<div className="score-game">
{this.props.localAnotaciones}
</div>
</div>
</div>

<div className="info-game">
<Image src={Stadium} alt={this.props.estadio} />
<p>{this.props.estadio}<br />
{this.props.fecha}<br />
{this.props.hora}
</p>
</div>

{/* Equipo visitante */}
<div className="card-game">
<div className="logo-score">
<div className="score-game">
{this.props.visitanteAnotaciones}
</div>
<Equipo nombre={this.props.visitanteNombre} logo={this.props.visitanteLogo} />
</div>
</div>
</div>
);
}
}

export default Juego;
8 changes: 8 additions & 0 deletions app/src/components/common/jugador/Jugador.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.picture {
width: 150px;
filter: drop-shadow(5px 5px 5px #222);
}

.name {
font-size: 22px;
}
48 changes: 48 additions & 0 deletions app/src/components/common/jugador/Jugador.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import React, { Component } from 'react';
import { Grid, Button, Glyphicon, Collapse, Well } from 'react-bootstrap';

import './Jugador.css';

class Jugador extends Component {

constructor(props, context) {
super(props, context);

this.state = {
open: false
};
}

render() {
return (
<Grid>
<img
className="picture"
src={this.props.foto}
alt={this.props.nombre}
/>
<div>
<p className="name">{this.props.nombre}</p>
</div>
<div>
<Button onClick={() => this.setState({ open: !this.state.open })}>
<Glyphicon glyph="glyphicon glyphicon-list-alt" /> More info
</Button>
<Collapse in={this.state.open}>
<div>
<Well>
<p><Glyphicon glyph="glyphicon glyphicon-minus" /> Age: {this.props.edad}<br />
<Glyphicon glyph="glyphicon glyphicon-minus" /> Nick: {this.props.apodo}<br />
<Glyphicon glyph="glyphicon glyphicon-minus" /> Position: {this.props.posicion}
</p>
</Well>
</div>
</Collapse>
</div>
<br />
</Grid>
);
}
}

export default Jugador;
3 changes: 3 additions & 0 deletions app/src/components/common/not-found/NotFound.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.error-404 {
font-size: 30px;
}
Loading