forked from oliverjam/minimal-react-setup
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from facn5/getData
Get data
- Loading branch information
Showing
12 changed files
with
100 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
button { | ||
color: red; | ||
height: 30px; | ||
width:80px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
.gInfo{ | ||
border-radius: 10px; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
body{ | ||
background-color:cyan; | ||
} | ||
input{ | ||
|
||
} | ||
.cards-container{ | ||
display:flex; | ||
flex-direction: row; | ||
justify-content:space-evenly; | ||
} | ||
.inputs-container{ | ||
display:flex; | ||
flex-direction: row; | ||
justify-content:space-evenly; | ||
} | ||
#table { | ||
border-collapse: collapse; | ||
width: 100%; | ||
} | ||
|
||
#table td, #table th { | ||
border: 1px solid #ddd; | ||
padding: 8px; | ||
} | ||
|
||
|
||
#table tr:hover {background-color: #ddd;} | ||
|
||
#table th { | ||
padding-top: 12px; | ||
padding-bottom: 12px; | ||
text-align: left; | ||
background-color: #4CAF50; | ||
color: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// import { accessToken } from "../../token"; | ||
export const accessToken = "6953b440ab762a5d9de0112d3be3f6a179533e0e"; | ||
export const API_BASE = "https://api.github.com"; | ||
|
||
const checkResponse = response => { | ||
if (response.status !== 200) { | ||
return(`Error with the request! ${response.status}`); | ||
|
||
} | ||
return response.json(); | ||
}; | ||
|
||
export const getData = url => { | ||
return fetch(`${url}?access_token=${accessToken}`) | ||
.then(checkResponse) | ||
.catch(err => { | ||
throw new Error(`fetch getUserData failed ${err}`); | ||
}); | ||
}; |