antcalatayud / ReactCoin (public) (License: GPLv3) (since 2018-04-24) (hash sha1)
As seen on this course: https://udilia.com/courses/learn-react-by-building-a-web-app
List of commits:
Subject Hash Author Date (UTC)
Add AJAX request to list component 3dd5f784d209cc1cfeb22bbc93aaf2c871e2c69b antcalatayud 2018-04-24 12:29:22
Start creating list componet c8bc3d6bb9b4980e1305d401be2fe67c8933a7f8 antcalatayud 2018-04-24 10:31:23
Add logo eed8364675e78cfa795550bff03682d49a8ed115 antcalatayud 2018-04-24 10:23:07
Add styling 866cbbbc94ce81e8b8b6b88da9f86d2d4153e509 antcalatayud 2018-04-24 10:18:43
Create fist component and render App b713ed055b8691a0fd89792d136e0ef9ed86f07c antcalatayud 2018-04-24 10:11:22
Add init files d81df9e3d230bcb49f0bb31c43cffad97532d321 antcalatayud 2018-04-24 09:51:04
Initial commit 3c3626d89f221374c92ee04aed1eaa8616f3977e Antonio Calatayud 2018-04-24 09:03:03
Commit 3dd5f784d209cc1cfeb22bbc93aaf2c871e2c69b - Add AJAX request to list component
Author: antcalatayud
Author date (UTC): 2018-04-24 12:29
Committer name: antcalatayud
Committer date (UTC): 2018-04-24 12:29
Parent(s): c8bc3d6bb9b4980e1305d401be2fe67c8933a7f8
Signing key:
Tree: ce039a96713e88f715f13b72ea4e75141105b9b3
File Lines added Lines deleted
src/components/list/List.js 23 0
File src/components/list/List.js changed (mode: 100644) (index 3ea5979..eb63e0f)
... ... class List extends React.Component {
11 11 }; };
12 12 } }
13 13
14 componentDidMount(){
15 this.setState({ loading: true });
16
17 fetch('https://api.udilia.com/coins/v1/cryptocurrencies?page=1&perPage=20')
18 .then(response => {
19 return response.json().then(json => {
20 return response.ok ? json : Promise.reject(json);
21 });
22 })
23 .then((data) => {
24 this.setState({
25 loading: false,
26 currencies: data.currencies
27 });
28 })
29 .catch((error) => {
30 this.setState({
31 loading: false,
32 error: error.errorMessage
33 });
34 });
35 }
36
14 37 render() { render() {
15 38 if (this.state.loading) { if (this.state.loading) {
16 39 return <div>Loading...</div> return <div>Loading...</div>
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/antcalatayud/ReactCoin

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/antcalatayud/ReactCoin

Clone this repository using git:
git clone git://git.rocketgit.com/user/antcalatayud/ReactCoin

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main