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

25 lines
1.2 KiB
JavaScript
Raw Normal View History

2018-06-11 08:41:25 +02:00
import { connect } from 'react-redux';
import { makeSelectDownloadPathForUri, makeSelectStreamingUrlForUri } from 'redux/selectors/file_info';
import { makeSelectClaimForUri, selectThumbnailForUri, makeSelectContentTypeForUri } from 'redux/selectors/claims';
import * as SETTINGS from 'constants/settings';
import { selectClientSetting } from 'redux/selectors/settings';
2020-05-21 17:38:28 +02:00
import { makeSelectFileRenderModeForUri, makeSelectFileExtensionForUri } from 'redux/selectors/content';
2018-06-11 08:41:25 +02:00
import FileRender from './view';
2020-01-31 16:46:50 +01:00
const select = (state, props) => {
const autoplay = props.embedded ? false : selectClientSetting(state, SETTINGS.AUTOPLAY_MEDIA);
2020-01-31 16:46:50 +01:00
return {
currentTheme: selectClientSetting(state, SETTINGS.THEME),
2020-01-31 16:46:50 +01:00
claim: makeSelectClaimForUri(props.uri)(state),
thumbnail: selectThumbnailForUri(state, props.uri),
2020-01-31 16:46:50 +01:00
contentType: makeSelectContentTypeForUri(props.uri)(state),
downloadPath: makeSelectDownloadPathForUri(props.uri)(state),
fileExtension: makeSelectFileExtensionForUri(props.uri)(state),
2020-05-21 17:38:28 +02:00
streamingUrl: makeSelectStreamingUrlForUri(props.uri)(state),
renderMode: makeSelectFileRenderModeForUri(props.uri)(state),
2020-01-31 16:46:50 +01:00
autoplay: autoplay,
};
};
2018-06-11 08:41:25 +02:00
export default connect(select)(FileRender);