lbry-desktop/ui/component/fileRender/index.js

31 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-06-11 08:41:25 +02:00
import { connect } from 'react-redux';
2019-08-02 08:28:14 +02:00
import {
makeSelectClaimForUri,
makeSelectThumbnailForUri,
makeSelectContentTypeForUri,
makeSelectStreamingUrlForUri,
makeSelectMediaTypeForUri,
makeSelectDownloadPathForUri,
makeSelectFileNameForUri,
} from 'lbry-redux';
2019-09-06 02:26:03 +02:00
import { THEME, AUTOPLAY } from 'constants/settings';
2018-06-11 08:41:25 +02:00
import { makeSelectClientSetting } from 'redux/selectors/settings';
2020-01-06 21:57:49 +01:00
import { makeSelectNextUnplayedRecommended, makeSelectIsText } from 'redux/selectors/content';
2018-06-11 08:41:25 +02:00
import FileRender from './view';
2019-08-02 08:28:14 +02:00
const select = (state, props) => ({
2018-06-11 08:41:25 +02:00
currentTheme: makeSelectClientSetting(THEME)(state),
2019-08-02 08:28:14 +02:00
claim: makeSelectClaimForUri(props.uri)(state),
mediaType: makeSelectMediaTypeForUri(props.uri)(state),
thumbnail: makeSelectThumbnailForUri(props.uri)(state),
contentType: makeSelectContentTypeForUri(props.uri)(state),
downloadPath: makeSelectDownloadPathForUri(props.uri)(state),
fileName: makeSelectFileNameForUri(props.uri)(state),
streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state),
2019-09-06 02:26:03 +02:00
autoplay: makeSelectClientSetting(AUTOPLAY)(state),
2019-09-09 19:31:00 +02:00
nextUnplayed: makeSelectNextUnplayedRecommended(props.uri)(state),
2020-01-06 21:57:49 +01:00
isText: makeSelectIsText(props.uri)(state),
2018-06-11 08:41:25 +02:00
});
export default connect(select)(FileRender);