diff --git a/src/common/LibraryItemList/LibraryItemList.js b/src/common/LibraryItemList/LibraryItemList.js deleted file mode 100644 index eea2dfc49..000000000 --- a/src/common/LibraryItemList/LibraryItemList.js +++ /dev/null @@ -1,117 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import Icon from 'stremio-icons/dom'; -import styles from './styles'; - -const renderPoster = (play, poster) => { - if (poster.length === 0) { - return null; - } - - return ( -
-
- -
-
- ); -} - -const renderTitle = (title) => { - if (title.length === 0) { - return null; - } - - return ( - {title} - ); -} - -const renderType = (type) => { - if (type.length === 0) { - return null; - } - - return ( - {type} - ); -} - -const renderReleasedInfo = (releaseInfo) => { - if (isNaN(releaseInfo.getTime())) { - return null; - } - - return ( - {releaseInfo.getFullYear()} - ); -} - -const renderReleasedDate = (released) => { - if (isNaN(released.getTime())) { - return null; - } - - return ( - {released.getDate() + '.' + released.getMonth() + '.' + released.getFullYear()} - ); -} - -const renderLastViewed = (lastViewed) => { - if (isNaN(lastViewed.getTime())) { - return null; - } - - return ( - {lastViewed.getDate() + '.' + lastViewed.getMonth() + '.' + lastViewed.getFullYear()} - ); -} - -const LibraryItemList = (props) => { - return ( -
- {renderPoster(props.play, props.poster)} - {renderTitle(props.title)} - {renderType(props.type)} - {renderReleasedInfo(props.releaseInfo)} - {renderReleasedDate(props.released)} - {props.views} - {props.hours} - {renderLastViewed(props.lastViewed)} -
- -
Trailer
-
-
- -
Add to Library
-
-
- ); -} - -LibraryItemList.propTypes = { - poster: PropTypes.string.isRequired, - title: PropTypes.string.isRequired, - type: PropTypes.string.isRequired, - releaseInfo: PropTypes.instanceOf(Date).isRequired, - released: PropTypes.instanceOf(Date).isRequired, - views: PropTypes.number.isRequired, - hours: PropTypes.number.isRequired, - lastViewed: PropTypes.instanceOf(Date).isRequired, - play: PropTypes.func, - watchTrailer: PropTypes.func, - addToLibrary: PropTypes.func -}; -LibraryItemList.defaultProps = { - poster: '', - title: '', - type: '', - releaseInfo: new Date(''), - released: new Date(''), //Invalid Date - views: 0, - hours: 0, - lastViewed: new Date('') -}; - -export default LibraryItemList; \ No newline at end of file diff --git a/src/common/LibraryItemList/index.js b/src/common/LibraryItemList/index.js deleted file mode 100644 index d622d92a3..000000000 --- a/src/common/LibraryItemList/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import LibraryItemList from './LibraryItemList'; - -export default LibraryItemList; diff --git a/src/common/LibraryItemList/styles.less b/src/common/LibraryItemList/styles.less deleted file mode 100644 index 1e4ab0804..000000000 --- a/src/common/LibraryItemList/styles.less +++ /dev/null @@ -1,78 +0,0 @@ -.library-item { - width: 90%; - display: flex; - padding: 8px; - align-items: center; - color: var(--color-surfacelighter60); - border-top: 1px solid var(--color-surfacelighter20); - .poster { - width: 75px; - display: flex; - height: 110px; - margin-right: 20px; - background-size: cover; - background-position: center; - .play-container { - width: 52px; - height: 52px; - margin: auto; - cursor: pointer; - border-radius: 50%; - padding: 16px 19px; - .play { - width: 20px; - height: 20px; - fill: transparent; - } - } - } - .title { - width: 170px; - color: var(--color-surfacelighter); - } - .type, .year, .views, .hours { - width: 100px; - } - .date-added, .last-viewed { - width: 130px; - } - .icon-container { - width: 100px; - height: 100px; - fill: var(--color-primarydark); - color: var(--color-primarydark); - padding-top: 24px; - text-align: center; - visibility: hidden; - .trailer-icon { - width: 22px; - } - .addlib-icon { - width: 34px; - } - } - &:hover, &:focus { - color: var(--color-backgrounddarker); - background-color: var(--color-surfacelighter); - .play-container { - background-color: var(--color-surfacelighter); - .play { - fill: var(--color-primary); - } - } - .title { - color: var(--color-backgrounddarker); - } - .icon-container { - cursor: pointer; - visibility: visible; - &:hover, &:focus { - background-color: var(--color-backgrounddarker20); - .trailer-icon, .addlib-icon, .trailer, .addlib { - fill: var(--color-primarydarker); - color: var(--color-primarydarker); - } - } - } - } -} \ No newline at end of file diff --git a/src/common/MetadataItem/MetadataItem.js b/src/common/MetadataItem/MetadataItem.js deleted file mode 100644 index cd9dfd39b..000000000 --- a/src/common/MetadataItem/MetadataItem.js +++ /dev/null @@ -1,118 +0,0 @@ -import React, { PureComponent } from 'react'; -import PropTypes from 'prop-types'; -import Icon, { dataUrl as iconDataUrl } from 'stremio-icons/dom'; -import colors from 'stremio-colors'; -import { RELATIVE_POSTER_SIZE } from './constants'; -import styles from './styles'; - -class MetadataItem extends PureComponent { - getPosterSize = () => { - switch (this.props.posterShape) { - case 'poster': - return { - width: RELATIVE_POSTER_SIZE, - height: RELATIVE_POSTER_SIZE * 1.464 - }; - case 'landscape': - return { - width: RELATIVE_POSTER_SIZE / 0.5625, - height: RELATIVE_POSTER_SIZE - }; - default: - return { - width: RELATIVE_POSTER_SIZE, - height: RELATIVE_POSTER_SIZE - }; - } - } - - getPlaceholderIcon = () => { - switch (this.props.type) { - case 'tv': - return 'ic_tv'; - case 'series': - return 'ic_series'; - case 'channel': - return 'ic_channels'; - default: - return 'ic_movies'; - } - } - - renderInCinemaLabel() { - if (!this.props.isInCinema) { - return null; - } - - return ( -
- - IN CINEMA -
- ); - } - - renderName() { - if (this.props.name.length === 0) { - return null; - } - - return ( - {this.props.name} - ); - } - - renderYear() { - if (this.props.year.length === 0) { - return null; - } - - return ( - {this.props.year} - ); - } - - render() { - const posterSize = this.getPosterSize(); - const contentContainerStyle = { - width: posterSize.width - }; - const placeholderIcon = this.getPlaceholderIcon(); - const placeholderIconUrl = iconDataUrl({ icon: placeholderIcon, fill: colors.accent, width: Math.round(RELATIVE_POSTER_SIZE / 2.2) }); - const imageStyle = { - height: posterSize.height, - backgroundImage: `url(${this.props.posterUrl}), url('${placeholderIconUrl}')` - }; - - return ( -
-
-
- {this.renderInCinemaLabel()} -
- {this.renderName()} - {this.renderYear()} -
-
- ); - } -} - -MetadataItem.propTypes = { - type: PropTypes.oneOf(['movie', 'series', 'channel', 'tv', 'other']).isRequired, - name: PropTypes.string.isRequired, - posterUrl: PropTypes.string.isRequired, - posterShape: PropTypes.oneOf(['poster', 'landscape', 'square']).isRequired, - isInCinema: PropTypes.bool.isRequired, - year: PropTypes.string.isRequired -}; -MetadataItem.defaultProps = { - type: 'other', - name: '', - posterUrl: '', - posterShape: 'poster', - isInCinema: false, - year: '' -}; - -export default MetadataItem; diff --git a/src/common/MetadataItem/constants.json b/src/common/MetadataItem/constants.json deleted file mode 100644 index b477ccb3d..000000000 --- a/src/common/MetadataItem/constants.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "RELATIVE_POSTER_SIZE": 138 -} \ No newline at end of file diff --git a/src/common/MetadataItem/index.js b/src/common/MetadataItem/index.js deleted file mode 100644 index aac1d12c5..000000000 --- a/src/common/MetadataItem/index.js +++ /dev/null @@ -1,3 +0,0 @@ -import MetadataItem from './MetadataItem'; - -export default MetadataItem; diff --git a/src/common/MetadataItem/styles.less b/src/common/MetadataItem/styles.less deleted file mode 100644 index 2342c3a76..000000000 --- a/src/common/MetadataItem/styles.less +++ /dev/null @@ -1,63 +0,0 @@ - -.root-container { - padding: 1px; - display: inline-block; - .content-container { - display: flex; - flex-direction: column; - cursor: pointer; - .poster { - width: 100%; - display: flex; - align-items: flex-end; - background-size: cover, auto; - background-repeat: no-repeat; - background-position: center; - background-origin: border-box; - background-color: var(--color-backgrounddark); - .in-cinema-container { - width: 100%; - height: 26px; - display: flex; - align-items: center; - justify-content: center; - background-color: var(--color-primary); - .in-cinema-icon { - height: 100%; - width: 12px; - fill: var(--color-surfacelighter); - margin-right: 6px; - } - .in-cinema-label { - font-size: 13px; - text-transform: uppercase; - color: var(--color-surfacelighter); - } - } - } - .name, .year { - width: 100%; - display: inline-block; - white-space: nowrap; - overflow: hidden; - text-overflow: ellipsis; - } - .name { - font-size: 12px; - color: var(--color-surfacelighter); - } - .year { - font-size: 11px; - color: var(--color-surfacelighter80); - } - } - &:hover { - background: var(--color-surfacelighter); - .name { - color: var(--color-backgrounddarker); - } - .year { - color: var(--color-surface); - } - } -} \ No newline at end of file diff --git a/src/common/index.js b/src/common/index.js index 19f511a77..3a135f8db 100644 --- a/src/common/index.js +++ b/src/common/index.js @@ -7,8 +7,6 @@ import { Modal, ModalsContainerContext, withModalsContainer } from './Modal'; import Popup from './Popup'; import Router from './Router'; import NavBar from './NavBar'; -import MetadataItem from './MetadataItem'; -import LibraryItemList from './LibraryItemList'; import MetaItem from './MetaItem'; import ShareAddon from './ShareAddon'; import UserPanel from './UserPanel'; @@ -21,9 +19,7 @@ export { ModalsContainerContext, Modal, withModalsContainer, - MetadataItem, Router, - LibraryItemList, MetaItem, ShareAddon, UserPanel,