File tree Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Expand file tree Collapse file tree 4 files changed +21
-2
lines changed Original file line number Diff line number Diff line change
1
+ import React from 'react' ;
2
+
3
+ import './styles.css'
4
+
5
+ function Repositorio ( { data } ) {
6
+ return (
7
+ < div >
8
+
9
+ </ div >
10
+ ) ;
11
+ } ;
12
+
13
+ export default Repositorio ;
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
2
3
- import { searchDevs } from '../../services/api' ;
3
+ import { searchDevs , getRepos } from '../../services/api' ;
4
4
import Dev from '../../components/Dev' ;
5
5
import './styles.css' ;
6
6
@@ -15,13 +15,14 @@ export default class Main extends Component {
15
15
this . setState ( { dev : [ ...this . state . dev , response ] } ) ;
16
16
}
17
17
18
+
19
+
18
20
render ( ) {
19
21
return (
20
22
< div >
21
23
< div id = "divBusca" >
22
24
< input type = "text" id = "txtBusca" placeholder = "Buscar..." />
23
25
< button id = "btnBusca" onClick = { this . getDev } > Buscar</ button >
24
- { console . log ( this . state . dev ) }
25
26
</ div >
26
27
{ this . state . dev ?
27
28
this . state . dev . map ( ( value ) => ( < Dev data = { value } /> ) ) : null }
Original file line number Diff line number Diff line change @@ -9,5 +9,10 @@ export async function searchDevs(){
9
9
10
10
return response . data ;
11
11
}
12
+ export async function getRepos ( devName ) {
13
+ let response = await api . get ( `/${ devName } /repos` ) ;
14
+
15
+ return response . data ;
16
+ }
12
17
13
18
export default api ;
You can’t perform that action at this time.
0 commit comments