diff --git a/client/app/components/buttons/InfoButton.jsx b/client/app/components/buttons/InfoButton.jsx new file mode 100644 index 0000000..fa8f4f4 --- /dev/null +++ b/client/app/components/buttons/InfoButton.jsx @@ -0,0 +1,52 @@ +import React, { Component } from 'react'; +import Interactive from 'react-interactive'; + +import buttonsCSS from '../styles/buttons.jsx'; + + +class InfoButton extends Component { + constructor(props) { + super(props); + + if (props) { + this.state = { + id: props.id, + type: props.type, + } + } + } + + componentWillReceiveProps(props) { + this.setState({ + id: props.id, + type: props.type, + }) + } + + getTMDBLink() { + const id = this.state.id; + const type = this.state.type; + + if (type === 'movie') + return 'https://www.themoviedb.org/movie/' + id + else if (type === 'show') + return 'https://www.themoviedb.org/tv/' + id + } + + render() { + return ( + + + + More info + + + ); + } +} + +export default InfoButton; \ No newline at end of file