File tree Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Expand file tree Collapse file tree 2 files changed +31
-1
lines changed Original file line number Diff line number Diff line change 1
- const Ninjas = ( ) => {
1
+ import styles from '../../styles/Jobs.module.css'
2
+
3
+ export const getStaticProps = async ( ) => {
4
+ const res = await fetch ( 'https://jsonplaceholder.typicode.com/users' ) ;
5
+ const data = await res . json ( ) ;
6
+
7
+ return {
8
+ props : { ninjas : data }
9
+ }
10
+ }
11
+
12
+ const Ninjas = ( { ninjas } ) => {
13
+ console . log ( ninjas )
14
+
2
15
return (
3
16
< div >
4
17
< h1 > All Ninjas</ h1 >
18
+ { ninjas . map ( ninja => (
19
+ < div key = { ninja . id } >
20
+ < a className = { styles . single } >
21
+ < h3 > { ninja . name } </ h3 >
22
+ </ a >
23
+ </ div >
24
+ ) ) }
5
25
</ div >
6
26
) ;
7
27
}
Original file line number Diff line number Diff line change
1
+ .single {
2
+ padding : 2px 16px ;
3
+ background : # fff ;
4
+ display : block;
5
+ margin : 20px 10px ;
6
+ border-left : 8px solid # fff ;
7
+ }
8
+ .single : hover {
9
+ border-left : 8px solid # 4979ff ;
10
+ }
You can’t perform that action at this time.
0 commit comments