From e8bac9f63a499bd8b5435b808b3938c6f7755dc1 Mon Sep 17 00:00:00 2001 From: Brian Date: Mon, 29 May 2017 09:42:10 -0700 Subject: [PATCH 1/6] Clearing out code to make v3 commit easier --- .babelrc | 14 - .eslintrc.json | 3 - index.html | 13 - js/App.js | 38 - js/AsyncRoute.js | 29 - js/ClientApp.js | 6 - js/Details.js | 59 - 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 | 22 - js/actions.js | 2 - js/reducers.js | 33 - js/reducers.spec.js | 14 - js/store.js | 10 - package.json | 78 - public/data.json | 150 - public/normalize.css | 424 --- public/style.css | 260 -- server.js | 31 - webpack.config.js | 62 - yarn.lock | 5152 -------------------------- 26 files changed, 6765 deletions(-) delete mode 100644 .babelrc delete mode 100644 .eslintrc.json 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 package.json delete mode 100644 public/data.json delete mode 100644 public/normalize.css delete mode 100644 public/style.css delete mode 100644 server.js delete mode 100644 webpack.config.js delete mode 100644 yarn.lock 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/.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/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 0606a1ded..000000000 --- a/js/Details.js +++ /dev/null @@ -1,59 +0,0 @@ -import React from 'react' -import { connect } from 'react-redux' -import { getOMDBDetails } from './actionCreators' -import Header from './Header' -const { shape, string, func } = React.PropTypes - -const Details = React.createClass({ - propTypes: { - show: shape({ - title: string, - year: string, - poster: string, - trailer: string, - imdbID: string - }), - omdbData: shape({ - imdbID: string - }), - dispatch: func - }, - componentDidMount () { - if (!this.props.omdbData.imdbRating) { - this.props.dispatch(getOMDBDetails(this.props.show.imdbID)) - } - }, - render () { - const { title, description, year, poster, trailer } = this.props.show - let rating - if (this.props.omdbData.imdbRating) { - rating =

{this.props.omdbData.imdbRating}

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

{title}

-

({year})

- {rating} - -

{description}

-
-
-