From 2e7323d8adeaaaeeb8a4040708ad7ad8eb62befb Mon Sep 17 00:00:00 2001 From: NikolaBorislavovHristov Date: Thu, 30 May 2019 17:43:13 +0300 Subject: [PATCH] MetaPreview propTypes added --- src/common/MetaPreview/MetaPreview.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/common/MetaPreview/MetaPreview.js b/src/common/MetaPreview/MetaPreview.js index 8b4bfbaa4..a4169b63e 100644 --- a/src/common/MetaPreview/MetaPreview.js +++ b/src/common/MetaPreview/MetaPreview.js @@ -1,4 +1,5 @@ const React = require('react'); +const PropTypes = require('prop-types'); const classnames = require('classnames'); const Icon = require('stremio-icons/dom'); const { Input, Modal } = require('stremio-navigation'); @@ -37,7 +38,7 @@ const ActionButton = ({ icon, label, ...props }) => { ); }; -const MetaPreview = ({ className, compact, id, type, name, logo = '', background = '', duration = '', releaseInfo = '', released = '', description = '', genres = [], writers = [], directors = [], cast = [], imdbId = '', imdbRating = '', inLibrary = false, trailer = '', share = '', toggleIsInLibrary }) => { +const MetaPreview = ({ className, compact, id, type, name, logo, background, duration, releaseInfo, released, description, genres, writers, directors, cast, imdbId, imdbRating, inLibrary, trailer, share, toggleIsInLibrary }) => { const [shareModalOpen, openShareModal, closeShareModal] = useBinaryState(false); const releaseInfoText = React.useMemo(() => { const releasedDate = new Date(released); @@ -204,4 +205,28 @@ const MetaPreview = ({ className, compact, id, type, name, logo = '', background ); }; +MetaPreview.propTypes = { + className: PropTypes.string, + compact: PropTypes.bool, + id: PropTypes.string, + type: PropTypes.string, + name: PropTypes.string, + logo: PropTypes.string, + background: PropTypes.string, + duration: PropTypes.string, + releaseInfo: PropTypes.string, + released: PropTypes.string, + description: PropTypes.string, + genres: PropTypes.arrayOf(PropTypes.string), + writers: PropTypes.arrayOf(PropTypes.string), + directors: PropTypes.arrayOf(PropTypes.string), + cast: PropTypes.arrayOf(PropTypes.string), + imdbId: PropTypes.string, + imdbRating: PropTypes.string, + inLibrary: PropTypes.bool, + trailer: PropTypes.string, + share: PropTypes.string, + toggleIsInLibrary: PropTypes.func +}; + module.exports = MetaPreview;