File tree Expand file tree Collapse file tree 1 file changed +43
-31
lines changed
Expand file tree Collapse file tree 1 file changed +43
-31
lines changed Original file line number Diff line number Diff line change 1- import React from 'react' ;
1+ import React , { useState , useEffect } from 'react' ;
22import Header from '../components/Header' ;
33import Search from '../components/Search' ;
44import Categories from '../components/Categories' ;
@@ -8,35 +8,47 @@ import Footer from '../components/Footer';
88
99import '../assets/styles/App.scss' ;
1010
11- const App = ( ) => (
12- < div className = "App" >
13- < Header />
14- < Search />
15-
16- < Categories title = "Mi Lista" >
17- < Carousel >
18- < CarouselItem />
19- < CarouselItem />
20- < CarouselItem />
21- < CarouselItem />
22- </ Carousel >
23- </ Categories >
24-
25- < Categories title = "Tendencias" >
26- < Carousel >
27- < CarouselItem />
28- < CarouselItem />
29- </ Carousel >
30- </ Categories >
31-
32- < Categories title = "Originales de Platzi Video" >
33- < Carousel >
34- < CarouselItem />
35- </ Carousel >
36- </ Categories >
37-
38- < Footer />
39- </ div >
40- ) ;
11+ const App = ( ) => {
12+ const [ videos , setVideos ] = useState ( [ ] ) ;
13+
14+ useEffect ( ( ) => {
15+ fetch ( 'http://localhost:3000/initalState' )
16+ . then ( response => response . json ( ) )
17+ . then ( data => setVideos ( data ) ) ;
18+ } , [ ] ) ;
19+
20+ console . log ( videos ) ;
21+
22+ return (
23+ < div className = "App" >
24+ < Header />
25+ < Search />
26+
27+ < Categories title = "Mi Lista" >
28+ < Carousel >
29+ < CarouselItem />
30+ < CarouselItem />
31+ < CarouselItem />
32+ < CarouselItem />
33+ </ Carousel >
34+ </ Categories >
35+
36+ < Categories title = "Tendencias" >
37+ < Carousel >
38+ < CarouselItem />
39+ < CarouselItem />
40+ </ Carousel >
41+ </ Categories >
42+
43+ < Categories title = "Originales de Platzi Video" >
44+ < Carousel >
45+ < CarouselItem />
46+ </ Carousel >
47+ </ Categories >
48+
49+ < Footer />
50+ </ div >
51+ ) ;
52+ }
4153
4254export default App ;
You can’t perform that action at this time.
0 commit comments