diff --git a/ui/component/webUploadList/internal/web-upload-item.jsx b/ui/component/webUploadList/internal/web-upload-item.jsx
index 5b5a1b1cd..b2ff9fa10 100644
--- a/ui/component/webUploadList/internal/web-upload-item.jsx
+++ b/ui/component/webUploadList/internal/web-upload-item.jsx
@@ -1,7 +1,7 @@
// @flow
import React from 'react';
import Button from 'component/button';
-import CardMedia from 'component/cardMedia';
+import FileThumbnail from 'component/fileThumbnail';
type Props = {
params: UpdatePublishFormData,
progress: string,
@@ -13,7 +13,7 @@ export default function WebUploadItem(props: Props) {
return (
-
+
{params.title}
diff --git a/ui/modal/walletReceive/view.jsx b/ui/modal/walletReceive/view.jsx
index 56829d5ad..85746bff8 100644
--- a/ui/modal/walletReceive/view.jsx
+++ b/ui/modal/walletReceive/view.jsx
@@ -1,6 +1,6 @@
import React from 'react';
-import WalletAddress from './node_modules/component/walletAddress';
-import Page from './node_modules/component/page';
+import WalletAddress from 'component/walletAddress';
+import Page from 'component/page';
const WalletAddressPage = () => (
diff --git a/ui/modal/walletSend/view.jsx b/ui/modal/walletSend/view.jsx
index 81f994e61..57bc0dacc 100644
--- a/ui/modal/walletSend/view.jsx
+++ b/ui/modal/walletSend/view.jsx
@@ -1,5 +1,5 @@
import React from 'react';
-import WalletSend from './node_modules/component/walletSend';
+import WalletSend from 'component/walletSend';
const WalletSendModal = () => (
diff --git a/ui/page/file/index.js b/ui/page/file/index.js
index f494a2598..f62bae852 100644
--- a/ui/page/file/index.js
+++ b/ui/page/file/index.js
@@ -1,32 +1,23 @@
import { connect } from 'react-redux';
-import * as settings from 'constants/settings';
import { doRemoveUnreadSubscription } from 'redux/actions/subscriptions';
-import { doSetClientSetting } from 'redux/actions/settings';
import { doSetContentHistoryItem } from 'redux/actions/content';
import {
doFetchFileInfo,
makeSelectClaimIsMine,
makeSelectFileInfoForUri,
makeSelectClaimForUri,
- makeSelectContentTypeForUri,
makeSelectMetadataForUri,
makeSelectChannelForClaimUri,
selectBalance,
- makeSelectTitleForUri,
- makeSelectThumbnailForUri,
- makeSelectClaimIsNsfw,
- doPrepareEdit,
+ makeSelectMediaTypeForUri,
} from 'lbry-redux';
-import { doFetchViewCount, makeSelectViewCountForUri, makeSelectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc';
-import { selectShowMatureContent, makeSelectClientSetting } from 'redux/selectors/settings';
+import { doFetchViewCount, makeSelectCostInfoForUri, doFetchCostInfoForUri } from 'lbryinc';
+import { selectShowMatureContent } from 'redux/selectors/settings';
import { makeSelectIsSubscribed } from 'redux/selectors/subscriptions';
-import { doOpenModal } from 'redux/actions/app';
-import fs from 'fs';
import FilePage from './view';
const select = (state, props) => ({
claim: makeSelectClaimForUri(props.uri)(state),
- contentType: makeSelectContentTypeForUri(props.uri)(state),
costInfo: makeSelectCostInfoForUri(props.uri)(state),
metadata: makeSelectMetadataForUri(props.uri)(state),
obscureNsfw: !selectShowMatureContent(state),
@@ -34,20 +25,13 @@ const select = (state, props) => ({
claimIsMine: makeSelectClaimIsMine(props.uri)(state),
isSubscribed: makeSelectIsSubscribed(props.uri)(state),
channelUri: makeSelectChannelForClaimUri(props.uri, true)(state),
- viewCount: makeSelectViewCountForUri(props.uri)(state),
balance: selectBalance(state),
- title: makeSelectTitleForUri(props.uri)(state),
- thumbnail: makeSelectThumbnailForUri(props.uri)(state),
- nsfw: makeSelectClaimIsNsfw(props.uri)(state),
- supportOption: makeSelectClientSetting(settings.SUPPORT_OPTION)(state),
+ mediaType: makeSelectMediaTypeForUri(props.uri)(state),
});
const perform = dispatch => ({
fetchFileInfo: uri => dispatch(doFetchFileInfo(uri)),
fetchCostInfo: uri => dispatch(doFetchCostInfoForUri(uri)),
- openModal: (modal, props) => dispatch(doOpenModal(modal, props)),
- prepareEdit: (publishData, uri, fileInfo) => dispatch(doPrepareEdit(publishData, uri, fileInfo, fs)),
- setClientSetting: (key, value) => dispatch(doSetClientSetting(key, value)),
setViewed: uri => dispatch(doSetContentHistoryItem(uri)),
markSubscriptionRead: (channel, uri) => dispatch(doRemoveUnreadSubscription(channel, uri)),
fetchViewCount: claimId => dispatch(doFetchViewCount(claimId)),
diff --git a/ui/page/file/view.jsx b/ui/page/file/view.jsx
index 745b531b2..d9c8740a6 100644
--- a/ui/page/file/view.jsx
+++ b/ui/page/file/view.jsx
@@ -1,31 +1,14 @@
// @flow
-import * as MODALS from 'constants/modal_types';
-import * as icons from 'constants/icons';
import * as React from 'react';
-import { buildURI, normalizeURI } from 'lbry-redux';
-import FileViewerInitiator from 'component/fileViewerInitiator';
-import FilePrice from 'component/filePrice';
-import FileDetails from 'component/fileDetails';
-import FileActions from 'component/fileActions';
-import DateTime from 'component/dateTime';
import Button from 'component/button';
import Page from 'component/page';
-import FileDownloadLink from 'component/fileDownloadLink';
-import RecommendedContent from 'component/recommendedContent';
-
-import CommentsList from 'component/commentsList';
-import CommentCreate from 'component/commentCreate';
-import ClaimUri from 'component/claimUri';
-import ClaimPreview from 'component/claimPreview';
-import HelpLink from 'component/common/help-link';
import I18nMessage from 'component/i18nMessage/view';
-
-export const FILE_WRAPPER_CLASS = 'grid-area--content';
+import LayoutWrapperFile from 'component/layoutWrapperFile';
+import LayoutWrapperText from 'component/layoutWrapperText';
type Props = {
claim: StreamClaim,
fileInfo: FileListItem,
- contentType: string,
uri: string,
claimIsMine: boolean,
costInfo: ?{ cost: number },
@@ -36,14 +19,10 @@ type Props = {
isSubscribed: boolean,
channelUri: string,
viewCount: number,
- prepareEdit: ({}, string, {}) => void,
- openModal: (id: string, { uri: string, claimIsMine?: boolean, isSupport?: boolean }) => void,
markSubscriptionRead: (string, string) => void,
fetchViewCount: string => void,
balance: number,
- title: string,
- nsfw: boolean,
- supportOption: boolean,
+ mediaType: string,
};
class FilePage extends React.Component {
@@ -96,160 +75,25 @@ class FilePage extends React.Component {
}
render() {
- const {
- claim,
- contentType,
- uri,
- openModal,
- claimIsMine,
- prepareEdit,
- costInfo,
- fileInfo,
- channelUri,
- viewCount,
- balance,
- title,
- nsfw,
- supportOption,
- } = this.props;
- // File info
- const { signing_channel: signingChannel } = claim;
- const channelName = signingChannel && signingChannel.name;
- const webShareable =
- costInfo && costInfo.cost === 0 && contentType && ['video', 'image', 'audio'].includes(contentType.split('/')[0]);
- // We want to use the short form uri for editing
- // This is what the user is used to seeing, they don't care about the claim id
- // We will select the claim id before they publish
- let editUri;
- if (claimIsMine) {
- const uriObject: { streamName: string, streamClaimId: string, channelName?: string } = {
- streamName: claim.name,
- streamClaimId: claim.claim_id,
- };
- if (channelName) {
- uriObject.channelName = channelName;
- }
-
- editUri = buildURI(uriObject);
- }
-
+ const { uri, claimIsMine, costInfo, fileInfo, balance, mediaType } = this.props;
const insufficientCredits = !claimIsMine && costInfo && costInfo.cost > balance;
return (
-
-
-
- {!fileInfo && insufficientCredits && (
-
- ,
- }}
- >
- The publisher has chosen to charge LBC to view this content. Your balance is currently too low to view
- it. Check out %reward_link% for free LBC or send more LBC to your wallet.
-
-
+ ,
+ }}
+ >
+ The publisher has chosen to charge LBC to view this content. Your balance is currently too low to view it.
+ Check out %reward_link% for free LBC or send more LBC to your wallet.
+