-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
20cbcc0
commit 3e0316f
Showing
11 changed files
with
12,850 additions
and
7 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 |
---|---|---|
|
@@ -17,6 +17,7 @@ | |
.env.development.local | ||
.env.test.local | ||
.env.production.local | ||
.env | ||
|
||
npm-debug.log* | ||
yarn-debug.log* | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
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,46 @@ | ||
import React from "react"; | ||
require('dotenv').config() | ||
console.log(process.env) | ||
|
||
|
||
export default class Quote extends React.Component { | ||
constructor() { | ||
super(); | ||
this.state = { | ||
quote: [] | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
const myHeadersOne = new Headers(); | ||
myHeadersOne.append( | ||
"X-RapidAPI-Host", "andruxnet-random-famous-quotes.p.rapidapi.com" | ||
); | ||
myHeadersOne.append( | ||
"X-RapidAPI-Key", process.env.REACT_APP_API_RAPID | ||
); | ||
|
||
const myInit = { method: "GET", headers: myHeadersOne }; | ||
|
||
const myRequestOne = new Request( | ||
"https://andruxnet-random-famous-quotes.p.rapidapi.com/?cat=famous&count=1", | ||
myInit | ||
); | ||
|
||
fetch(myRequestOne) | ||
.then(res => res.json()) | ||
.then(data => | ||
this.setState({ | ||
quote: data[0].quote | ||
}) | ||
); | ||
} | ||
|
||
render() { | ||
return ( | ||
<div className="container"> | ||
<h2>{this.state.quote}</h2> | ||
</div> | ||
); | ||
} | ||
} |
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,53 @@ | ||
import React from "react"; | ||
require('dotenv').config() | ||
|
||
|
||
export default class SkyScanner extends React.Component { | ||
constructor() { | ||
super(); | ||
this.state = { | ||
minPrice: [], | ||
departure: '', | ||
arrival: '' | ||
}; | ||
} | ||
|
||
componentDidMount() { | ||
const myHeadersOne = new Headers(); | ||
myHeadersOne.append( | ||
"X-RapidAPI-Host", "skyscanner-skyscanner-flight-search-v1.p.rapidapi.com" | ||
); | ||
myHeadersOne.append( | ||
"X-RapidAPI-Key", process.env.REACT_APP_API_RAPID | ||
); | ||
|
||
const myInit = { method: "GET", headers: myHeadersOne }; | ||
|
||
const myRequestOne = new Request( | ||
"https://skyscanner-skyscanner-flight-search-v1.p.rapidapi.com/apiservices/browsequotes/v1.0/US/USD/en-US/SFO-sky/JFK-sky/2019-10-01?inboundpartialdate=2019-09-01", | ||
myInit | ||
); | ||
|
||
fetch(myRequestOne) | ||
.then(res => res.json()) | ||
.then(data => | ||
this.setState({ | ||
minPrice: data.Quotes[0].MinPrice, | ||
departure: data.Places[0].Name, | ||
arrival: data.Places[1].Name | ||
}) | ||
); | ||
|
||
} | ||
|
||
render() { | ||
return ( | ||
<div className="container"> | ||
|
||
<h2>{this.state.departure} to {this.state.arrival}- £{this.state.minPrice}</h2> | ||
</div> | ||
); | ||
} | ||
} | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
|
@@ -3475,6 +3475,11 @@ [email protected]: | |
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-6.2.0.tgz#941c0410535d942c8becf28d3f357dbd9d476064" | ||
integrity sha512-HygQCKUBSFl8wKQZBSemMywRWcEDNidvNbjGVyZu3nbZ8qq9ubiPoGLMdRDpfSrpkkm9BXYFkpKxxFX38o/76w== | ||
|
||
dotenv@^8.0.0: | ||
version "8.0.0" | ||
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.0.0.tgz#ed310c165b4e8a97bb745b0a9d99c31bda566440" | ||
integrity sha512-30xVGqjLjiUOArT4+M5q9sYdvuR4riM6yK9wMcas9Vbp6zZa+ocC9dp6QoftuhTPhFAiLK/0C5Ni2nou/Bk8lg== | ||
|
||
duplexer3@^0.1.4: | ||
version "0.1.4" | ||
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" | ||
|