Add an imdb button component
This commit is contained in:
parent
e2445bc287
commit
cb7706b394
15
src/public/js/components/buttons/imdb.js
Normal file
15
src/public/js/components/buttons/imdb.js
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
import React from "react"
|
||||||
|
|
||||||
|
export default function ImdbLink(props) {
|
||||||
|
const link = `http://www.imdb.com/title/${props.imdbId}`;
|
||||||
|
let className = "btn btn-warning";
|
||||||
|
if (props.size) {
|
||||||
|
className += " btn-" + props.size;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<a type="button" className={className} href={link}>
|
||||||
|
<i className="fa fa-external-link"></i> IMDB
|
||||||
|
</a>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -8,6 +8,7 @@ import { addMovieToWishlist, deleteMovie, deleteMovieFromWishlist,
|
|||||||
|
|
||||||
import DownloadButton from "../buttons/download"
|
import DownloadButton from "../buttons/download"
|
||||||
import SubtitlesButton from "../buttons/subtitles"
|
import SubtitlesButton from "../buttons/subtitles"
|
||||||
|
import ImdbButton from "../buttons/imdb"
|
||||||
import TorrentsButton from "./torrents"
|
import TorrentsButton from "./torrents"
|
||||||
import ActionsButton from "./actions"
|
import ActionsButton from "./actions"
|
||||||
import ListPosters from "../list/posters"
|
import ListPosters from "../list/posters"
|
||||||
@ -29,7 +30,6 @@ const mapDispatchToProps = (dipatch) =>
|
|||||||
refreshSubtitles, updateFilter }, dipatch)
|
refreshSubtitles, updateFilter }, dipatch)
|
||||||
|
|
||||||
function MovieButtons(props) {
|
function MovieButtons(props) {
|
||||||
const imdbLink = `http://www.imdb.com/title/${props.movie.get("imdb_id")}`;
|
|
||||||
const hasMovie = (props.movie.get("polochon_url") !== "");
|
const hasMovie = (props.movie.get("polochon_url") !== "");
|
||||||
return (
|
return (
|
||||||
<div className="list-details-buttons btn-toolbar">
|
<div className="list-details-buttons btn-toolbar">
|
||||||
@ -66,9 +66,7 @@ function MovieButtons(props) {
|
|||||||
type="movie"
|
type="movie"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<a type="button" className="btn btn-warning btn-sm" href={imdbLink}>
|
<ImdbButton imdbId={props.movie.get("imdb_id")} size="sm"/>
|
||||||
<i className="fa fa-external-link"></i> IMDB
|
|
||||||
</a>
|
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -8,6 +8,7 @@ import { addShowToWishlist, deleteShowFromWishlist, getEpisodeDetails, updateSho
|
|||||||
import Loader from "../loader/loader"
|
import Loader from "../loader/loader"
|
||||||
import DownloadButton from "../buttons/download"
|
import DownloadButton from "../buttons/download"
|
||||||
import SubtitlesButton from "../buttons/subtitles"
|
import SubtitlesButton from "../buttons/subtitles"
|
||||||
|
import ImdbButton from "../buttons/imdb"
|
||||||
|
|
||||||
|
|
||||||
import { OverlayTrigger, Tooltip } from "react-bootstrap"
|
import { OverlayTrigger, Tooltip } from "react-bootstrap"
|
||||||
@ -76,7 +77,6 @@ function HeaderThumbnail(props){
|
|||||||
}
|
}
|
||||||
|
|
||||||
function HeaderDetails(props){
|
function HeaderDetails(props){
|
||||||
const imdbLink = `http://www.imdb.com/title/${props.data.get("imdb_id")}`;
|
|
||||||
return (
|
return (
|
||||||
<div className="col-xs-12 col-sm-10">
|
<div className="col-xs-12 col-sm-10">
|
||||||
<dl className="dl-horizontal">
|
<dl className="dl-horizontal">
|
||||||
@ -86,9 +86,7 @@ function HeaderDetails(props){
|
|||||||
<dd className="plot">{props.data.get("plot")}</dd>
|
<dd className="plot">{props.data.get("plot")}</dd>
|
||||||
<dt>IMDB</dt>
|
<dt>IMDB</dt>
|
||||||
<dd>
|
<dd>
|
||||||
<a type="button" className="btn btn-warning btn-xs" href={imdbLink}>
|
<ImdbButton imdbId={props.data.get("imdb_id")} size="xs"/>
|
||||||
<i className="fa fa-external-link"></i> Open in IMDB
|
|
||||||
</a>
|
|
||||||
</dd>
|
</dd>
|
||||||
<dt>Year</dt>
|
<dt>Year</dt>
|
||||||
<dd>{props.data.get("year")}</dd>
|
<dd>{props.data.get("year")}</dd>
|
||||||
|
@ -4,9 +4,9 @@ import { Link } from "react-router"
|
|||||||
import { DropdownButton } from "react-bootstrap"
|
import { DropdownButton } from "react-bootstrap"
|
||||||
|
|
||||||
import { WishlistButton, RefreshButton } from "../buttons/actions"
|
import { WishlistButton, RefreshButton } from "../buttons/actions"
|
||||||
|
import ImdbButton from "../buttons/imdb"
|
||||||
|
|
||||||
export default function ShowButtons(props) {
|
export default function ShowButtons(props) {
|
||||||
const imdbLink = `http://www.imdb.com/title/${props.show.get("imdb_id")}`;
|
|
||||||
return (
|
return (
|
||||||
<div className="list-details-buttons btn-toolbar">
|
<div className="list-details-buttons btn-toolbar">
|
||||||
<ActionsButton
|
<ActionsButton
|
||||||
@ -15,9 +15,7 @@ export default function ShowButtons(props) {
|
|||||||
deleteFromWishlist={props.deleteFromWishlist}
|
deleteFromWishlist={props.deleteFromWishlist}
|
||||||
getDetails={props.getDetails}
|
getDetails={props.getDetails}
|
||||||
/>
|
/>
|
||||||
<a type="button" className="btn btn-warning btn-sm" href={imdbLink}>
|
<ImdbButton imdbId={props.show.get("imdb_id")} size="sm"/>
|
||||||
<i className="fa fa-external-link"></i> IMDB
|
|
||||||
</a>
|
|
||||||
<Link type="button" className="btn btn-primary btn-sm" to={"/shows/details/" + props.show.get("imdb_id")}>
|
<Link type="button" className="btn btn-primary btn-sm" to={"/shows/details/" + props.show.get("imdb_id")}>
|
||||||
<i className="fa fa-external-link"></i> Details
|
<i className="fa fa-external-link"></i> Details
|
||||||
</Link>
|
</Link>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user