File tree 1 file changed +27
-5
lines changed
1 file changed +27
-5
lines changed Original file line number Diff line number Diff line change 1
1
import React , { useEffect , useState } from "react" ;
2
+ import { Carousel } from 'primereact/carousel' ;
2
3
import { fetchSocksByTag } from "./Tag" ;
3
4
import { Link } from "react-router-dom" ;
4
5
import { Tags } from "../components/Tags" ;
@@ -10,14 +11,35 @@ export function Home() {
10
11
} , [ ] ) ;
11
12
return < div className = "p-grid p-dir-rev" >
12
13
< div className = "p-col-10" >
13
- < h2 > Spring Socks</ h2 >
14
- < ul >
15
- { socks . map ( sock => < li key = { sock . id } > < Link
16
- to = { `/details/${ sock . id } ` } > { sock . name } </ Link > </ li > ) }
17
- </ ul >
14
+ < h2 > WE LOVE SOCKS!</ h2 >
15
+ < p >
16
+ 100% SATISFACTION GUARANTEED< br />
17
+ < img src = { '/img/spring_socks_1.jpg' } alt = { "Spring Socks" }
18
+ style = { {
19
+ height : '430px' ,
20
+ display : 'flex' ,
21
+ alignItems : 'center' ,
22
+ } }
23
+ /> < br />
24
+ Socks were invented by woolly mammoths to keep warm. They died out because
25
+ stupid humans had to cut their legs off to get their socks
26
+ </ p >
27
+ < h2 > Featured Socks</ h2 >
28
+ < Carousel value = { socks } itemTemplate = { itemTemplate } numVisible = { 3 }
29
+ numScroll = { 1 }
30
+ autoplayInterval = { 3000 } > </ Carousel >
18
31
</ div >
19
32
< div className = "p-col-2" >
20
33
< Tags />
21
34
</ div >
22
35
</ div > ;
36
+ }
37
+
38
+ function itemTemplate ( sock ) {
39
+ return < p >
40
+ < Link to = { `/details/${ sock . id } ` } >
41
+ < img alt = { sock . name } src = { sock . imageUrl && sock . imageUrl [ 0 ] }
42
+ height = { '270px' } /> < br />
43
+ { sock . name } </ Link >
44
+ </ p > ;
23
45
}
You can’t perform that action at this time.
0 commit comments