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 index fe38df095..b5217a1a7 100644 --- a/.editorconfig +++ b/.editorconfig @@ -7,3 +7,4 @@ indent_size = 2 end_of_line = lf charset = utf-8 insert_final_newline = true +trim_trailing_whitespace = 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 index e8b258fef..01810a27c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,13 @@ public/bundle.js node_modules/ .eslintcache -coverage +coverage/ .nyc_output .DS_Store +public/*bundle* *.map *.bundle.js +_site/ +.sass-cache/ +*.iml +.idea/ diff --git a/data.json b/data.json new file mode 100644 index 000000000..10647744e --- /dev/null +++ b/data.json @@ -0,0 +1,124 @@ +{ + "shows": [ + { + "title": "Atlanta", + "year": "2008–2013", + "description": "Two cousins, with different views on art versus commerce, on their way up through the Atlanta rap scene; \"Earnest 'Earn' Marks,\" an ambitious college drop-out and his estranged cousin, who suddenly becomes a star.", + "poster": "a.jpg", + "imdbID": "tt4288182", + "trailer": "MpEdJ-mmTlY" + }, + { + "title": "Billions", + "year": "2016–", + "description": "U.S. Attorney Chuck Rhoades goes after hedge fund king, Bobby \"Axe\" Axelrod in a battle between two powerful New York figures.", + "poster": "b.jpg", + "imdbID": "tt4270492", + "trailer": "_raEUMLL-ZI" + }, + { + "title": "Black Mirror", + "year": "2011–", + "description": "A television anthology series that shows the dark side of life and technology.", + "poster": "bm.jpg", + "imdbID": "tt2085059", + "trailer": "jDiYGjp5iFg" + }, + { + "title": "Breaking Bad", + "year": "2008–2013", + "description": "A high school chemistry teacher diagnosed with inoperable lung cancer turns to manufacturing and selling methamphetamine in order to secure his family's future.", + "poster": "bb.jpg", + "imdbID": "tt0903747", + "trailer": "XZ8daibM3AE" + }, + { + "title": "Game of Thrones", + "year": "2011–", + "description": "Nine noble families fight for control over the mythical lands of Westeros, while a forgotten race returns after being dormant for thousands of years.", + "poster": "got.jpg", + "imdbID": "tt0944947", + "trailer": "giYeaKsXnsI" + }, + { + "title": "Homeland", + "year": "2011–", + "description": "A bipolar CIA operative becomes convinced a prisoner of war has been turned by al-Qaeda and is planning to carry out a terrorist attack on American soil.", + "poster": "h.jpg", + "imdbID": "tt1796960", + "trailer": "KyFmS3wRPCQ" + }, + { + "title": "House of Cards", + "year": "2013–", + "description": "A Congressman works with his equally conniving wife to exact revenge on the people who betrayed him.", + "poster": "hoc.jpg", + "imdbID": "tt1856010", + "trailer": "NTzycsqxYJ0" + }, + { + "title": "Master of None", + "year": "2015–", + "description": "The personal and professional life of Dev, a 30-year-old actor in New York.", + "poster": "mon.jpg", + "imdbID": "tt4635276", + "trailer": "6bFvb3WKISk" + }, + { + "title": "Narcos", + "year": "2015–", + "description": "A chronicled look at the criminal exploits of Colombian drug lord Pablo Escobar.", + "poster": "n.jpg", + "imdbID": "tt2707408", + "trailer": "U7elNhHwgBU" + }, + { + "title": "Orange Is the New Black", + "year": "2013–", + "description": "The story of Piper Chapman, a woman in her thirties who is sentenced to fifteen months in prison after being convicted of a decade-old crime of transporting money for her drug-dealing girlfriend.", + "poster": "oitnb.jpg", + "imdbID": "tt2372162", + "trailer": "th8WT_pxGqg" + }, + { + "title": "Silicon Valley", + "year": "2014–", + "description": "Follows the struggle of Richard Hendricks, a silicon valley engineer trying to build his own company called Pied Piper.", + "poster": "sv.jpg", + "imdbID": "tt2575988", + "trailer": "69V__a49xtw" + }, + { + "title": "Stranger Things", + "year": "2016–", + "description": "When a young boy disappears, his mother, a police chief, and his friends must confront terrifying forces in order to get him back.", + "poster": "st.jpg", + "imdbID": "tt4574334", + "trailer": "9Egf5U8xLo8" + }, + { + "title": "The Americans", + "year": "2013–", + "description": "Two Soviet intelligence agents pose as a married couple to spy on the American government.", + "poster": "ta.jpg", + "imdbID": "tt2149175", + "trailer": "HjuUkbhsI24" + }, + { + "title": "Veep", + "year": "2012–", + "description": "Former Senator Selina Meyer finds that being Vice President of the United States is nothing like she hoped and everything that everyone ever warned her about.", + "poster": "v.jpg", + "imdbID": "tt1759761", + "trailer": "I2HoCG_iyhU" + }, + { + "title": "Westworld", + "year": "2016–", + "description": "Set at the intersection of the near future and the reimagined past, explore a world in which every human appetite, no matter how noble or depraved, can be indulged without consequence.", + "poster": "ww.jpg", + "imdbID": "tt0475784", + "trailer": "eX3u0IlBBO4" + } + ] +} diff --git a/index.html b/index.html index 37eb362cb..cc4d75b0b 100644 --- a/index.html +++ b/index.html @@ -1,13 +1,37 @@ - - Vidflix - - + + svideo -
<%= 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/ClientApp.jsx b/js/ClientApp.jsx new file mode 100644 index 000000000..08bd015d0 --- /dev/null +++ b/js/ClientApp.jsx @@ -0,0 +1,18 @@ +const ce = React.createElement; + +const MyTitle = function(props) { + return ce('div', null, ce('h1', { style: { color: props.color } }, props.title)); +}; + +const MyFirstComponent = function() { + return ce( + 'div', + { id: 'my-first-component' }, + ce(MyTitle, { title: 'Game of Thrones', color: 'YellowGreen' }), + ce(MyTitle, { title: 'Stranger Things', color: 'GreenYellow' }), + ce(MyTitle, { title: 'Rick and Morty', color: 'LimeGreen' }), + ce(MyTitle, { title: 'Silicon Valley', color: 'peru' }) + ); +}; + +ReactDOM.render(ce(MyFirstComponent), 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}

-
-
-