From 49b8806a341fad8081738316c801dff7504adb30 Mon Sep 17 00:00:00 2001 From: Brian Holt Date: Tue, 15 Nov 2016 10:13:07 -0800 Subject: [PATCH 01/10] Prepare start branch for v2 --- .babelrc | 14 --- .editorconfig | 9 -- .eslintrc.json | 3 - .gitignore | 8 -- index.html | 13 --- js/App.js | 38 ------- js/AsyncRoute.js | 29 ----- js/ClientApp.js | 6 -- js/Details.js | 57 ---------- js/Header.js | 48 --------- js/Landing.js | 43 -------- js/MyTitle.js | 19 ---- js/Search.js | 41 ------- js/Search.spec.js | 29 ----- js/ShowCard.js | 29 ----- js/__snapshots__/Search.spec.js.snap | 156 --------------------------- js/actionCreators.js | 5 - js/actions.js | 1 - js/reducers.js | 22 ---- js/reducers.spec.js | 14 --- js/store.js | 8 -- server.js | 31 ------ webpack.config.js | 54 ---------- 23 files changed, 677 deletions(-) delete mode 100644 .babelrc delete mode 100644 .editorconfig delete mode 100644 .eslintrc.json delete mode 100644 .gitignore delete mode 100644 index.html delete mode 100644 js/App.js delete mode 100644 js/AsyncRoute.js delete mode 100644 js/ClientApp.js delete mode 100644 js/Details.js delete mode 100644 js/Header.js delete mode 100644 js/Landing.js delete mode 100644 js/MyTitle.js delete mode 100644 js/Search.js delete mode 100644 js/Search.spec.js delete mode 100644 js/ShowCard.js delete mode 100644 js/__snapshots__/Search.spec.js.snap delete mode 100644 js/actionCreators.js delete mode 100644 js/actions.js delete mode 100644 js/reducers.js delete mode 100644 js/reducers.spec.js delete mode 100644 js/store.js delete mode 100644 server.js delete mode 100644 webpack.config.js diff --git a/.babelrc b/.babelrc deleted file mode 100644 index 604127005..000000000 --- a/.babelrc +++ /dev/null @@ -1,14 +0,0 @@ -{ - "presets": [ - "react", - ["es2015", {modules: false, loose: true}] - ], - "env": { - "server": { - "plugins": ["transform-es2015-modules-commonjs"] - }, - "test": { - "plugins": ["transform-es2015-modules-commonjs"] - } - } -} diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index fe38df095..000000000 --- a/.editorconfig +++ /dev/null @@ -1,9 +0,0 @@ -# editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -insert_final_newline = true diff --git a/.eslintrc.json b/.eslintrc.json deleted file mode 100644 index 9aa861b35..000000000 --- a/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["standard", "standard-react"] -} \ No newline at end of file diff --git a/.gitignore b/.gitignore deleted file mode 100644 index e8b258fef..000000000 --- a/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -public/bundle.js -node_modules/ -.eslintcache -coverage -.nyc_output -.DS_Store -*.map -*.bundle.js diff --git a/index.html b/index.html deleted file mode 100644 index 37eb362cb..000000000 --- a/index.html +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Vidflix - - - - -
<%= body %>
- - - diff --git a/js/App.js b/js/App.js deleted file mode 100644 index e736b8ab3..000000000 --- a/js/App.js +++ /dev/null @@ -1,38 +0,0 @@ -import React from 'react' -import { Match } from 'react-router' -import { Provider } from 'react-redux' -import store from './store' -import AsyncRoute from './AsyncRoute' -import preload from '../public/data.json' -if (global) { - global.System = { import () {} } -} - -const App = () => { - return ( - -
- } - /> - { - return - }} - /> - { - const show = preload.shows.filter((show) => props.params.id === show.imdbID) - return - }} - /> -
-
- ) -} - -export default App diff --git a/js/AsyncRoute.js b/js/AsyncRoute.js deleted file mode 100644 index 2a256b33e..000000000 --- a/js/AsyncRoute.js +++ /dev/null @@ -1,29 +0,0 @@ -import React from 'react' -const { object } = React.PropTypes - -const AsyncRoute = React.createClass({ - propTypes: { - props: object, - loadingPromise: object - }, - getInitialState () { - return { - loaded: false - } - }, - componentDidMount () { - this.props.loadingPromise.then((module) => { - this.component = module.default - this.setState({loaded: true}) - }) - }, - render () { - if (this.state.loaded) { - return - } else { - return

loading...

- } - } -}) - -export default AsyncRoute diff --git a/js/ClientApp.js b/js/ClientApp.js deleted file mode 100644 index 2aca765e1..000000000 --- a/js/ClientApp.js +++ /dev/null @@ -1,6 +0,0 @@ -import React from 'react' -import { render } from 'react-dom' -import { BrowserRouter } from 'react-router' -import App from './App' - -render(, document.getElementById('app')) diff --git a/js/Details.js b/js/Details.js deleted file mode 100644 index 1a0f8c4eb..000000000 --- a/js/Details.js +++ /dev/null @@ -1,57 +0,0 @@ -import React from 'react' -import axios from 'axios' -import Header from './Header' -const { shape, string } = React.PropTypes - -const Details = React.createClass({ - propTypes: { - show: shape({ - title: string, - year: string, - poster: string, - trailer: string, - imdbID: string - }) - }, - getInitialState () { - return { - omdbData: {} - } - }, - componentDidMount () { - axios.get(`http://www.omdbapi.com/?i=${this.props.show.imdbID}`) - .then((response) => { - console.log('response', response) - this.setState({omdbData: response.data}) - }) - .catch((error) => { - console.error('axios error', error) - }) - }, - render () { - const { title, description, year, poster, trailer } = this.props.show - let rating - if (this.state.omdbData.imdbRating) { - rating =

{this.state.omdbData.imdbRating}

- } else { - rating = loading indicator - } - return ( -
-
-
-

{title}

-

({year})

- {rating} - -

{description}

-
-
-