Skip to content

Commit

Permalink
Merge pull request #4 from OrcaPracticas/develop
Browse files Browse the repository at this point in the history
ADD: Integrandi redux en el proyecto platzi video
  • Loading branch information
konami12 authored Dec 12, 2018
2 parents 04d90ee + 9ac7118 commit 1fd86ae
Show file tree
Hide file tree
Showing 7 changed files with 324 additions and 234 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"prop-types": "15.6.0",
"react": "16.1.1",
"react-dom": "16.1.1",
"redux": "^4.0.1"
"react-redux": "5.0.6",
"redux": "4.0.1"
}
}
277 changes: 138 additions & 139 deletions src/api.json
Original file line number Diff line number Diff line change
@@ -1,146 +1,145 @@
{
"categories": [
{
"id": 1,
"description": "Lo mejor de la semana",
"title": "Destacados",
"playlist": [
"categories": [
{
"title": "¿Qué es responsive Design?",
"author": "LeonidasEsteban",
"type": "video",
"cover": "./images/covers/responsive.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 1
"id": "1",
"description": "Lo mejor de la semana",
"title": "Destacados",
"playlist": [
{
"title": "¿Qué es responsive Design?",
"author": "LeonidasEsteban",
"type": "video",
"cover": "./images/covers/responsive.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "1"
},
{
"title": "Cómo optimzar la carga de un website",
"author": "LeonidasEsteban",
"type": "video",
"cover": "./images/covers/optimizar.jpg",
"src": "http://peach.themazzone.com/durian/movies/sintel-1024-surround.mp4",
"id": "2"
},
{
"title": "Qué es Bitcoin",
"author": "Yograterol",
"type": "video",
"cover": "./images/covers/bitcoin.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "3"
},
{
"title": "Que pasó con HTML5",
"author": "Freddier",
"type": "video",
"cover": "./images/covers/html5.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "4"
},
{
"title": "Lo mejor de Mejorando.la",
"author": "Cvander",
"type": "video",
"cover": "./images/covers/mejorandola.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "5"
}
]
},
{
"title": "Cómo optimzar la carga de un website",
"author": "LeonidasEsteban",
"type": "video",
"cover": "./images/covers/optimizar.jpg",
"src": "http://peach.themazzone.com/durian/movies/sintel-1024-surround.mp4",
"id": 2
"id": "2",
"description": "Lo mejor para concentrarte",
"title": "Para programar",
"playlist": [
{
"title": "One more time",
"author": "Daft Punk",
"type": "video",
"cover": "./images/covers/one-more-time.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "6"
},
{
"title": "Midnight City",
"author": "M83",
"type": "video",
"cover": "./images/covers/midnight.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "7"
},
{
"title": "Solar Sailer",
"author": "Daft Punk",
"type": "video",
"cover": "./images/covers/solar-sailer.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "8"
},
{
"title": "The social network",
"author": "The social network",
"type": "video",
"cover": "./images/covers/social.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "9"
},
{
"title": "No vaya a ser",
"author": "Pablo Alboran",
"type": "video",
"cover": "./images/covers/no-vaya-a-ser.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "10"
}
]
},
{
"title": "Qué es Bitcoin",
"author": "Yograterol",
"type": "video",
"cover": "./images/covers/bitcoin.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 3
},
{
"title": "Que pasó con HTML5",
"author": "Freddier",
"type": "video",
"cover": "./images/covers/html5.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 4
},
{
"title": "Lo mejor de Mejorando.la",
"author": "Cvander",
"type": "video",
"cover": "./images/covers/mejorandola.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 5
}
]
},
{
"id": 2,
"description": "Lo mejor para concentrarte",
"title": "Para programar",
"playlist": [
{
"title": "One more time",
"author": "Daft Punk",
"type": "video",
"cover": "./images/covers/one-more-time.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 1
},
{
"title": "Midnight City",
"author": "M83",
"type": "video",
"cover": "./images/covers/midnight.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 5
},
{
"title": "Solar Sailer",
"author": "Daft Punk",
"type": "video",
"cover": "./images/covers/solar-sailer.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 2
},
{
"title": "The social network",
"author": "The social network",
"type": "video",
"cover": "./images/covers/social.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 4
},
{
"title": "No vaya a ser",
"author": "Pablo Alboran",
"type": "video",
"cover": "./images/covers/no-vaya-a-ser.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 3
}
]
},
{
"id": 3,
"description": "Si no te queda de otra",
"title": "Regueton",
"playlist": [
{
"title": "Despacito",
"author": "Luis Fonsi",
"type": "video",
"cover": "./images/covers/despacito.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 1
},
{
"title": "Echame la culpa",
"author": "Luis fonsi",
"type": "video",
"cover": "./images/covers/echame-la-culpa.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 3
},
{
"title": "Mi Gente",
"author": "J Bavil",
"type": "video",
"cover": "./images/covers/mi-gente.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 2
},
{
"title": "Felices los 4",
"author": "Maluma",
"type": "video",
"cover": "./images/covers/felices.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 4
},
{
"title": "Me Rehúso",
"author": "Danny Ocean",
"type": "video",
"cover": "./images/covers/rehuso.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": 5
"id": "3",
"description": "Si no te queda de otra",
"title": "Regueton",
"playlist": [
{
"title": "Despacito",
"author": "Luis Fonsi",
"type": "video",
"cover": "./images/covers/despacito.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "11"
},
{
"title": "Echame la culpa",
"author": "Luis fonsi",
"type": "video",
"cover": "./images/covers/echame-la-culpa.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "12"
},
{
"title": "Mi Gente",
"author": "J Bavil",
"type": "video",
"cover": "./images/covers/mi-gente.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "13"
},
{
"title": "Felices los 4",
"author": "Maluma",
"type": "video",
"cover": "./images/covers/felices.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "14"
},
{
"title": "Me Rehúso",
"author": "Danny Ocean",
"type": "video",
"cover": "./images/covers/rehuso.jpg",
"src": "http://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4",
"id": "15"
}
]
}
]
}
]
}

]
}
44 changes: 23 additions & 21 deletions src/categories/components/categories.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,27 @@
import React from 'react';
import Category from './category';
import './categories.css';
import Search from '../../widgets/containers/search';
import React from "react";
import Category from "./category";
import "./categories.css";
import Search from "../../widgets/containers/search";
import Media from "../../playlist/components/media";

function Categories(props) {
return (
<div className="Categories">
<Search />
{
props.categories.map((item) =>{
return (
<Category
key={item.id}
{...item}
handleOpenModal={props.handleOpenModal}
/>
)
})
}
</div>
)
return (
<div className="Categories">
<Search />
{
props.search.map(item => <Media key={item.id} {...item} />)
}
{
props.categories.map(item => (
<Category
key={item.id}
{...item}
handleOpenModal={props.handleOpenModal}
/>
))
}
</div>
);
}

export default Categories
export default Categories;
35 changes: 25 additions & 10 deletions src/entries/home.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,28 @@
import React from 'react';
import { hydrate } from 'react-dom';
import Home from '../pages/containers/home';
// import Playlist from './src/playlist/components/playlist';
import data from '../api.json';
// console.log('Hola mundo!' )
import React from "react";
import { createStore } from "redux";
import { Provider } from "react-redux";
import { hydrate } from "react-dom";
import Home from "../pages/containers/home";
import data from "../api.json";
import reducer from "../reducers/data";

const homeContainer = document.getElementById('home-container')
/**
* Creando store
*/
const INITIAL_STATE = {
data,
search: [],
};

// ReactDOM.render(que voy a renderizar, donde lo haré);
// const holaMundo = <h1>hola Estudiante!</h1>;
hydrate( <Home data={data} />, homeContainer);
const STORE = createStore(
reducer,
INITIAL_STATE,
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
);

const homeContainer = document.getElementById("home-container");
hydrate(
<Provider store={STORE}>
<Home />
</Provider>, homeContainer,
);
Loading

0 comments on commit 1fd86ae

Please sign in to comment.