diff --git a/src/ui/component/commentCreate/view.jsx b/src/ui/component/commentCreate/view.jsx index aa9dd76aa..bf2d51cc7 100644 --- a/src/ui/component/commentCreate/view.jsx +++ b/src/ui/component/commentCreate/view.jsx @@ -3,8 +3,7 @@ import React from 'react'; import { FormField, Form } from 'component/common/form'; import Button from 'component/button'; import ChannelSection from 'component/selectChannel'; -import { COMMENT_ACKNOWLEDGED, COMMENT_ACKNOWLEDGED_TRUE } from 'constants/settings'; -import { usePersistedState } from 'util/use-persisted-state'; +import usePersistedState from 'util/use-persisted-state'; // props: type Props = { @@ -14,10 +13,11 @@ type Props = { }; export function CommentCreate(props: Props) { + const COMMENT_ACKNOWLEDGED = 'COMMENT_ACKNOWLEDGED'; const { createComment, claim } = props; const { claim_id: claimId } = claim; const [commentValue, setCommentValue] = usePersistedState(`comment-${claimId}`, ''); - const [commentAck, setCommentAck] = usePersistedState(COMMENT_ACKNOWLEDGED, 'no'); + const [commentAck, setCommentAck] = usePersistedState(COMMENT_ACKNOWLEDGED, false); const [channel, setChannel] = usePersistedState('COMMENT_CHANNEL', 'anonymous'); function handleCommentChange(event) { @@ -29,7 +29,7 @@ export function CommentCreate(props: Props) { } function handleCommentAck(event) { - setCommentAck(COMMENT_ACKNOWLEDGED_TRUE); + setCommentAck(true); } function handleSubmit() { if (channel !== 'new' && commentValue.length) createComment(commentValue, claimId, channel); @@ -38,7 +38,7 @@ export function CommentCreate(props: Props) { return ( - {commentAck !== COMMENT_ACKNOWLEDGED_TRUE && ( + {commentAck !== true && (
About comments..
@@ -51,7 +51,7 @@ export function CommentCreate(props: Props) {
)} - {commentAck === COMMENT_ACKNOWLEDGED_TRUE && ( + {commentAck === true && (
diff --git a/src/ui/component/fileDetails/index.js b/src/ui/component/fileDetails/index.js index bf68f32b1..12fa77f9e 100644 --- a/src/ui/component/fileDetails/index.js +++ b/src/ui/component/fileDetails/index.js @@ -4,12 +4,9 @@ import { makeSelectContentTypeForUri, makeSelectMetadataForUri, makeSelectFileInfoForUri, - doToast, } from 'lbry-redux'; import { selectUser } from 'lbryinc'; import { doOpenFileInFolder } from 'redux/actions/file'; -import { selectHasClickedComment } from 'redux/selectors/app'; -import { doClickCommentButton } from 'redux/actions/app'; import FileDetails from './view'; const select = (state, props) => ({ @@ -17,14 +14,11 @@ const select = (state, props) => ({ contentType: makeSelectContentTypeForUri(props.uri)(state), fileInfo: makeSelectFileInfoForUri(props.uri)(state), metadata: makeSelectMetadataForUri(props.uri)(state), - hasClickedComment: selectHasClickedComment(state), user: selectUser(state), }); const perform = dispatch => ({ openFolder: path => dispatch(doOpenFileInFolder(path)), - showSnackBar: message => dispatch(doToast({ message })), - clickCommentButton: () => dispatch(doClickCommentButton()), }); export default connect( diff --git a/src/ui/component/fileDetails/view.jsx b/src/ui/component/fileDetails/view.jsx index cbeebfc3e..38e4a46e0 100644 --- a/src/ui/component/fileDetails/view.jsx +++ b/src/ui/component/fileDetails/view.jsx @@ -1,6 +1,5 @@ // @flow import React, { Fragment, PureComponent } from 'react'; -import { Lbryio } from 'lbryinc'; import MarkdownPreview from 'component/common/markdown-preview'; import Button from 'component/button'; import Expandable from 'component/expandable'; @@ -12,31 +11,10 @@ type Props = { metadata: StreamMetadata, openFolder: string => void, contentType: string, - clickCommentButton: () => void, - showSnackBar: React$Node => void, - hasClickedComment: boolean, user: ?any, }; class FileDetails extends PureComponent { - constructor() { - super(); - (this: any).handleCommentClick = this.handleCommentClick.bind(this); - } - - handleCommentClick() { - const { clickCommentButton, showSnackBar } = this.props; - - clickCommentButton(); - Lbryio.call('user_tag', 'edit', { add: 'comments-waitlist' }); - showSnackBar( - - {__('Your Comment Has Been Posted')} - TM - - ); - } - render() { const { claim, contentType, fileInfo, metadata, openFolder } = this.props; diff --git a/src/ui/component/fileRender/view.jsx b/src/ui/component/fileRender/view.jsx index bff166e27..f8e688d40 100644 --- a/src/ui/component/fileRender/view.jsx +++ b/src/ui/component/fileRender/view.jsx @@ -1,43 +1,57 @@ // @flow import { remote } from 'electron'; -import React, { Suspense } from 'react'; +import React from 'react'; import LoadingScreen from 'component/common/loading-screen'; import VideoViewer from 'component/viewers/videoViewer'; const AudioViewer = React.lazy<*>(() => - import(/* webpackChunkName: "audioViewer" */ - 'component/viewers/audioViewer') + import( + /* webpackChunkName: "audioViewer" */ + 'component/viewers/audioViewer' + ) ); const DocumentViewer = React.lazy<*>(() => - import(/* webpackChunkName: "documentViewer" */ - 'component/viewers/documentViewer') + import( + /* webpackChunkName: "documentViewer" */ + 'component/viewers/documentViewer' + ) ); const DocxViewer = React.lazy<*>(() => - import(/* webpackChunkName: "docxViewer" */ - 'component/viewers/docxViewer') + import( + /* webpackChunkName: "docxViewer" */ + 'component/viewers/docxViewer' + ) ); const HtmlViewer = React.lazy<*>(() => - import(/* webpackChunkName: "htmlViewer" */ - 'component/viewers/htmlViewer') + import( + /* webpackChunkName: "htmlViewer" */ + 'component/viewers/htmlViewer' + ) ); const PdfViewer = React.lazy<*>(() => - import(/* webpackChunkName: "pdfViewer" */ - 'component/viewers/pdfViewer') + import( + /* webpackChunkName: "pdfViewer" */ + 'component/viewers/pdfViewer' + ) ); // @if TARGET='app' const ComicBookViewer = React.lazy<*>(() => - import(/* webpackChunkName: "comicBookViewer" */ - 'component/viewers/comicBookViewer') + import( + /* webpackChunkName: "comicBookViewer" */ + 'component/viewers/comicBookViewer' + ) ); const ThreeViewer = React.lazy<*>(() => - import(/* webpackChunkName: "threeViewer" */ - 'component/viewers/threeViewer') + import( + /* webpackChunkName: "threeViewer" */ + 'component/viewers/threeViewer' + ) ); // @endif @@ -174,7 +188,7 @@ class FileRender extends React.PureComponent { // @if TARGET='web' // temp workaround to disabled paid content on web - if (claim && claim.value.fee && claim.value.fee.amount > 0) { + if (claim && claim.value.fee && Number(claim.value.fee.amount) > 0) { const paidMessage = __( 'Currently, only free content is available on lbry.tv. Try viewing it in the desktop app.' ); diff --git a/src/ui/component/viewers/videoViewer.jsx b/src/ui/component/viewers/videoViewer.jsx index 9787e7f6d..eaf7b479f 100644 --- a/src/ui/component/viewers/videoViewer.jsx +++ b/src/ui/component/viewers/videoViewer.jsx @@ -1,10 +1,12 @@ // @flow -import React, { Suspense } from 'react'; +import React from 'react'; import { stopContextMenu } from 'util/context-menu'; import analytics from 'analytics'; -import(/* webpackChunkName: "videojs" */ -/* webpackPreload: true */ -'video.js/dist/video-js.css'); +import( + /* webpackChunkName: "videojs" */ + /* webpackPreload: true */ + 'video.js/dist/video-js.css' +); type Props = { source: { @@ -23,7 +25,7 @@ class AudioVideoViewer extends React.PureComponent { componentDidMount() { const { contentType, poster, claim } = this.props; const { name, claim_id: claimId, txid, nout } = claim; - + // Quick fix to get file view events on lbry.tv // Will need to be changed to include time to start analytics.apiLogView(`${name}#${claimId}`, `${txid}:${nout}`, claimId); @@ -44,10 +46,12 @@ class AudioVideoViewer extends React.PureComponent { sources, }; - import(/* webpackChunkName: "videojs" */ - /* webpackMode: "lazy" */ - /* webpackPreload: true */ - 'video.js').then(videojs => { + import( + /* webpackChunkName: "videojs" */ + /* webpackMode: "lazy" */ + /* webpackPreload: true */ + 'video.js' + ).then(videojs => { if (videojs.__esModule) { videojs = videojs.default; this.player = videojs(this.videoNode, videoJsOptions, () => {}); diff --git a/src/ui/constants/settings.js b/src/ui/constants/settings.js index 7547f3e2e..a29721171 100644 --- a/src/ui/constants/settings.js +++ b/src/ui/constants/settings.js @@ -16,5 +16,3 @@ export const AUTOPLAY = 'autoplay'; export const RESULT_COUNT = 'resultCount'; export const OS_NOTIFICATIONS_ENABLED = 'osNotificationsEnabled'; export const AUTO_DOWNLOAD = 'autoDownload'; -export const COMMENT_ACKNOWLEDGED = 'comment_acknowledged'; -export const COMMENT_ACKNOWLEDGED_TRUE = 'comment_acknowledged_true'; diff --git a/src/ui/redux/selectors/app.js b/src/ui/redux/selectors/app.js index 86d683e0e..276c0496f 100644 --- a/src/ui/redux/selectors/app.js +++ b/src/ui/redux/selectors/app.js @@ -23,7 +23,6 @@ export const selectUpdateUrl = createSelector( } ); -// HERE export const selectHasClickedComment = createSelector( selectState, state => state.hasClickedComment diff --git a/static/locales/en.json b/static/locales/en.json index bceb5f02d..d884dab65 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -285,7 +285,32 @@ "Downloading stream... not long left now!": "Downloading stream... not long left now!", "Downloading: ": "Downloading: ", "% complete": "% complete", +<<<<<<< HEAD "Updates published": "Updates published", "Your updates have been published to LBRY at the address": "Your updates have been published to LBRY at the address", "The updates will take a few minutes to appear for other LBRY users. Until then your file will be listed as \"pending\" under your published files.": "The updates will take a few minutes to appear for other LBRY users. Until then your file will be listed as \"pending\" under your published files." } +======= + "Incompatible Daemon": "Incompatible Daemon", + "Incompatible daemon running": "Incompatible daemon running", + "Close App and LBRY Processes": "Close App and LBRY Processes", + "Continue Anyway": "Continue Anyway", + "This app is running with an incompatible version of the LBRY protocol. You can still use it, but there may be issues. Re-run the installation package for best results.": "This app is running with an incompatible version of the LBRY protocol. You can still use it, but there may be issues. Re-run the installation package for best results.", + "Update ready to install": "Update ready to install", + "Install now": "Install now", + "Upgrade available": "Upgrade available", + "LBRY Leveled Up": "LBRY Leveled Up", + "Upgrade": "Upgrade", + "Skip": "Skip", + "An updated version of LBRY is now available.": "An updated version of LBRY is now available.", + "Your version is out of date and may be unreliable or insecure.": "Your version is out of date and may be unreliable or insecure.", + "Want to know what has changed?": "Want to know what has changed?", + "release notes": "release notes", + "Your comment": "Your comment", + "Post": "Post", + "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.": "Uh oh. The flux in our Retro Encabulator must be out of whack. Try refreshing to fix it.", + "If you still have issues, your anti-virus software or firewall may be preventing startup.": "If you still have issues, your anti-virus software or firewall may be preventing startup.", + "Reach out to hello@lbry.com for help, or check out": "Reach out to hello@lbry.com for help, or check out", + "Got it!": "Got it!" +} +>>>>>>> comments cleanup