Introduce config and fix minor issues

Previously, basic config like URLs were hard-coded in the code
itself. Now they reside in the `config.js` file.
Also fixes #17

Signed-off-by: Sudhanshu Gautam <me@sudhanshug.com>
This commit is contained in:
Sudhanshu Gautam 2019-10-06 23:54:13 +05:30
parent 8988781d26
commit b21e082518
3 changed files with 13 additions and 11 deletions

View file

@ -34,6 +34,7 @@ import './home.scss';
import { withTranslation } from 'react-i18next';
import FuzzySet from 'fuzzyset.js';
import config from '../../config';
import DataService from '../../services/data';
import AlertDialog from '../../components/alert-dialog';
@ -58,10 +59,7 @@ TabContainer.propTypes = {
};
const sleep = m => new Promise(r => setTimeout(r, m));
const CORSbyPass = 'https://cors-anywhere.herokuapp.com/';
const asu = 'https://aparcar.stephen304.com';
const asu_vanilla =
'https://aparcar.stephen304.com/download/json-demo/openwrt/';
const { CORSbyPass, asu, asu_vanilla } = config;
class Home extends React.Component {
state = {
@ -552,7 +550,7 @@ class Home extends React.Component {
</ExpansionPanelDetails>
</ExpansionPanel>
</Grid>
<Grid item xs>
<Grid item xs className="downloads">
<b>{this.props.t('Downloads')}: </b>
{this.state.builtImages.map(image => (
<div key={image.url}>