diff --git a/src/public/js/components/movies/actions.js b/src/public/js/components/movies/actions.js new file mode 100644 index 0000000..3af81d9 --- /dev/null +++ b/src/public/js/components/movies/actions.js @@ -0,0 +1,45 @@ +import React from 'react' + +import { DropdownButton, MenuItem } from 'react-bootstrap' + +export default function ActionsButton(props) { + return ( + + + + ); +} + +class RefreshButton extends React.Component { + constructor(props) { + super(props); + this.handleClick = this.handleClick.bind(this); + } + handleClick(e) { + e.preventDefault(); + if (this.props.fetching) { + return + } + this.props.getDetails(this.props.movieId); + } + render() { + return ( + + {this.props.fetching || + + Refresh + + } + {this.props.fetching && + + Refreshing + + } + + ); + } +} diff --git a/src/public/js/components/movies/list.js b/src/public/js/components/movies/list.js index a2aa0f2..1834b7f 100644 --- a/src/public/js/components/movies/list.js +++ b/src/public/js/components/movies/list.js @@ -1,57 +1,39 @@ import React from 'react' import TorrentsButton from './torrents' +import ActionsButton from './actions' import ListPosters from '../list/posters' import ListDetails from '../list/details' import Loader from '../loader/loader' -class MovieButtons extends React.Component { - constructor(props) { - super(props); - this.handleClick = this.handleClick.bind(this); - } - handleClick(e) { - e.preventDefault(); - if (this.props.fetching) { - return - } - this.props.getMovieDetails(this.props.movie.imdb_id); - } - render() { - const imdb_link = `http://www.imdb.com/title/${this.props.movie.imdb_id}`; - return ( -
- - {this.props.fetching || - - Refresh - - } - {this.props.fetching && - - Refreshing - - } +function MovieButtons(props) { + const imdb_link = `http://www.imdb.com/title/${props.movie.imdb_id}`; + return ( +
+ {props.movie.polochon_url !== "" && + + Download - {this.props.movie.polochon_url !== "" && - - Download - - } + } - {this.props.movie.torrents && - - } + {props.movie.torrents && + + } - - IMDB - -
- ); - } + + + + IMDB + +
+ ); } export default class MovieList extends React.Component {