From 5028ad81845308f3b1954dcc1fde664077fa0fa9 Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 21 Apr 2017 12:30:57 -0400 Subject: scaffolding --- client/client.js | 16 ++++++++++++++++ client/components/App.jsx | 12 ++++++++++++ client/index.js | 15 --------------- client/index.jsx | 15 +++++++++++++++ 4 files changed, 43 insertions(+), 15 deletions(-) create mode 100644 client/client.js delete mode 100644 client/index.js create mode 100644 client/index.jsx (limited to 'client') diff --git a/client/client.js b/client/client.js new file mode 100644 index 0000000..7bc5c51 --- /dev/null +++ b/client/client.js @@ -0,0 +1,16 @@ + +import request from 'superagent' + +function fetch (api) { + return new Promise(function (resolve, reject){ + request + .api(api) + .set('Accept', 'application/json') + .end(function(err, res){ + console.log(res) + resolve(res) + }) + }) +} + +export default { fetch } diff --git a/client/components/App.jsx b/client/components/App.jsx index e69de29..26af681 100644 --- a/client/components/App.jsx +++ b/client/components/App.jsx @@ -0,0 +1,12 @@ +import React from 'react' + +export default class App extends React.Component { + constructor() { + super() + } + render() { + return ( +
Loading...
+ ) + } +} \ No newline at end of file diff --git a/client/index.js b/client/index.js deleted file mode 100644 index 61e61ad..0000000 --- a/client/index.js +++ /dev/null @@ -1,15 +0,0 @@ - -import React from 'react' -import ReactDOM from 'react-dom'; -import App from './components/App.jsx'; - -const isIphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) -const isIpad = (navigator.userAgent.match(/iPad/i)) -const isAndroid = (navigator.userAgent.match(/Android/i)) -const isMobile = isIphone || isIpad || isAndroid -const isDesktop = ! isMobile - -document.body.classList.add(isDesktop ? 'desktop' : 'mobile') - -ReactDOM.render(, document.getElementById('container')); - diff --git a/client/index.jsx b/client/index.jsx new file mode 100644 index 0000000..f64a984 --- /dev/null +++ b/client/index.jsx @@ -0,0 +1,15 @@ + +import React from 'react' +import ReactDOM from 'react-dom'; +import App from './components/App.jsx'; + +const isIphone = (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)) +const isIpad = (navigator.userAgent.match(/iPad/i)) +const isAndroid = (navigator.userAgent.match(/Android/i)) +const isMobile = isIphone || isIpad || isAndroid +const isDesktop = ! isMobile + +document.body.classList.add(isDesktop ? 'desktop' : 'mobile'); + +ReactDOM.render(, document.getElementById('container')); + -- cgit v1.2.3-70-g09d2