Skip to content

Instantly share code, notes, and snippets.

View mauricedb's full-sized avatar

Maurice de Beijer mauricedb

View GitHub Profile
import React, { PropTypes } from 'react';
const Header = ({ user }) => (
<nav className="navbar navbar-default">
<div className="container-fluid">
<div className="navbar-header">
<a className="navbar-brand" href="/">
Nitflex Movies
</a>
</div>
[{
"poster_path": "/9O7gLzmreU0nGkIB6K3BsJbzvNv.jpg",
"overview": "Framed in the 1940s for the double murder of his wife and her lover, upstanding banker Andy Dufresne begins a new life at the Shawshank prison, where he puts his accounting skills to work for an amoral warden. During his long stretch in prison, Dufresne comes to be admired by the other inmates -- including an older prisoner named Red -- for his integrity and unquenchable sense of hope.",
"release_date": "1994-09-10",
"id": 278,
"title": "The Shawshank Redemption",
"backdrop_path": "/xBKGJQsAIeweesB79KC89FpBrVr.jpg",
"popularity": 7.911657,
"vote_count": 5448,
"vote_average": 8.33,
import React, { Component } from 'react';
import AppPresentation from './app-presentation';
class AppContainer extends Component {
constructor(props) {
super(props);
this.state = {
user: null,
movies: null,
import React from 'react';
import './ajax-loading.css';
const AjaxLoading = () => (
<div>
<i className="glyphicon glyphicon-refresh spinning" />
&nbsp;Loading...
</div>
);
.glyphicon.spinning {
animation: spin 1s infinite linear;
}
@keyframes spin {
from { transform: scale(1) rotate(0deg); }
to { transform: scale(1) rotate(360deg); }
}
import React, { Component } from 'react';
import AppPresentation from './app-presentation';
class AppContainer extends Component {
constructor(props) {
super(props);
this.state = {
user: null,
movies: null,
import React, { PropTypes } from 'react';
const Billboard = ({ movie }) => (
<div className="row">
<div className="title">
{movie.title}
</div>
<img
className="img-responsive"
alt={movie.title}
import React, { PropTypes } from 'react';
import GenreRow from './genre-row';
const GenreList = ({ movies, startPlaying }) => {
const allGenres = {};
movies.forEach((movie) => {
movie.genre.forEach((genre) => {
if (allGenres[genre]) {
allGenres[genre].push(movie);
import React, { Component, PropTypes } from 'react';
import GenreRowMovie from './genre-row-movie';
import './genre-row.css';
class GenreRow extends Component {
render() {
const { genre, movies, startPlaying } = this.props;
return (
<div className="row genre-row">
.genre-row .genre-row-movie {
padding: 0;
}
.genre-row .genre-row-movie .title {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}