diff --git a/src/ui/constants/modal_types.js b/src/ui/constants/modal_types.js index 8cd8ee674..4af98531f 100644 --- a/src/ui/constants/modal_types.js +++ b/src/ui/constants/modal_types.js @@ -22,6 +22,7 @@ export const FIRST_SUBSCRIPTION = 'firstSubscription'; export const SEND_TIP = 'send_tip'; export const SOCIAL_SHARE = 'social_share'; export const PUBLISH = 'publish'; +export const PUBLISH_UPDATE = 'publish_update'; export const SEARCH = 'search'; export const CONFIRM_TRANSACTION = 'confirm_transaction'; export const CONFIRM_THUMBNAIL_UPLOAD = 'confirm_thumbnail_upload'; diff --git a/src/ui/modal/modalPublish/index.js b/src/ui/modal/modalPublish/index.js index ccb125053..f6c26449d 100644 --- a/src/ui/modal/modalPublish/index.js +++ b/src/ui/modal/modalPublish/index.js @@ -1,6 +1,6 @@ import { connect } from 'react-redux'; import { doHideModal } from 'redux/actions/app'; -import ModalSendTip from './view'; +import ModalPublishSuccess from './view'; import { doClearPublish } from 'redux/actions/publish'; import { push } from 'connected-react-router'; @@ -13,4 +13,4 @@ const perform = dispatch => ({ export default connect( null, perform -)(ModalSendTip); +)(ModalPublishSuccess); diff --git a/src/ui/modal/modalPublishUpdate/index.js b/src/ui/modal/modalPublishUpdate/index.js new file mode 100644 index 000000000..fe00d8727 --- /dev/null +++ b/src/ui/modal/modalPublishUpdate/index.js @@ -0,0 +1,16 @@ +import { connect } from 'react-redux'; +import { doHideModal } from 'redux/actions/app'; +import ModalPublishUpdateSuccess from './view'; +import { doClearPublish } from 'redux/actions/publish'; +import { push } from 'connected-react-router'; + +const perform = dispatch => ({ + closeModal: () => dispatch(doHideModal()), + clearPublish: () => dispatch(doClearPublish()), + navigate: path => dispatch(push(path)), +}); + +export default connect( + null, + perform +)(ModalPublishUpdateSuccess); diff --git a/src/ui/modal/modalPublishUpdate/view.jsx b/src/ui/modal/modalPublishUpdate/view.jsx new file mode 100644 index 000000000..f4efc9cac --- /dev/null +++ b/src/ui/modal/modalPublishUpdate/view.jsx @@ -0,0 +1,41 @@ +// @flow +import React from 'react'; +import { Modal } from 'modal/modal'; + +type Props = { + closeModal: () => void, + clearPublish: () => void, + navigate: string => void, + uri: string, +}; + +class ModalPublishUpdateSuccess extends React.PureComponent { + render() { + const { closeModal, clearPublish, navigate, uri } = this.props; + + return ( + { + clearPublish(); + navigate('/$/published'); + closeModal(); + }} + > +
+

{__('Your updates have been published to LBRY at the address')}

+
{uri}
+

+ {__( + '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.' + )} +

+
+
+ ); + } +} + +export default ModalPublishUpdateSuccess; diff --git a/src/ui/modal/modalRouter/view.jsx b/src/ui/modal/modalRouter/view.jsx index af910c611..4d2ad8b83 100644 --- a/src/ui/modal/modalRouter/view.jsx +++ b/src/ui/modal/modalRouter/view.jsx @@ -22,6 +22,7 @@ import ModalConfirmTransaction from 'modal/modalConfirmTransaction'; import ModalSocialShare from 'modal/modalSocialShare'; import ModalSendTip from 'modal/modalSendTip'; import ModalPublish from 'modal/modalPublish'; +import ModalPublishUpdate from 'modal/modalPublishUpdate'; import ModalOpenExternalResource from 'modal/modalOpenExternalResource'; import ModalConfirmThumbnailUpload from 'modal/modalConfirmThumbnailUpload'; import ModalWalletEncrypt from 'modal/modalWalletEncrypt'; @@ -88,6 +89,8 @@ function ModalRouter(props: Props) { return ; case MODALS.PUBLISH: return ; + case MODALS.PUBLISH_UPDATE: + return ; case MODALS.CONFIRM_EXTERNAL_RESOURCE: return ; case MODALS.CONFIRM_TRANSACTION: diff --git a/src/ui/redux/actions/publish.js b/src/ui/redux/actions/publish.js index b525c9632..67887e6f2 100644 --- a/src/ui/redux/actions/publish.js +++ b/src/ui/redux/actions/publish.js @@ -303,13 +303,16 @@ export const doPublish = (params: PublishParams) => (dispatch: Dispatch, getStat type: ACTIONS.PUBLISH_SUCCESS, }); - actions.push(doOpenModal(MODALS.PUBLISH, { uri })); - // We have to fake a temp claim until the new pending one is returned by claim_list_mine // We can't rely on claim_list_mine because there might be some delay before the new claims are returned // Doing this allows us to show the pending claim immediately, it will get overwritten by the real one const isMatch = claim => claim.claim_id === pendingClaim.claim_id; const isEdit = myClaims.some(isMatch); + + const publishModal = isEdit ? MODALS.PUBLISH_UPDATE : MODALS.PUBLISH; + + actions.push(doOpenModal(publishModal, { uri })); + const myNewClaims = isEdit ? myClaims.map(claim => (isMatch(claim) ? pendingClaim : claim)) : myClaims.concat(pendingClaim); diff --git a/static/locales/en.json b/static/locales/en.json index 770d0e5b5..40dc113a2 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -284,5 +284,22 @@ "Connecting...": "Connecting...", "Downloading stream... not long left now!": "Downloading stream... not long left now!", "Downloading: ": "Downloading: ", - "% complete": "% complete" + "% complete": "% complete", + "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.", + "Clear": "Clear", + "You are currently editing a claim.": "You are currently editing a claim.", + "If you don't choose a file, the file from your existing claim": "If you don't choose a file, the file from your existing claim", + "will be used.": "will be used.", + "You should reselect your file to choose a thumbnail": "You should reselect your file to choose a thumbnail", + "You are currently editing this claim. If you change the URL, you will need to reselect a file.": "You are currently editing this claim. If you change the URL, you will need to reselect a file.", + "Checking the winning claim amount...": "Checking the winning claim amount...", + "If you bid more than": "If you bid more than", + "when someone navigates to": "when someone navigates to", + "it will load your published content": "it will load your published content", + "However, you can get a longer version of this URL for any bid": "However, you can get a longer version of this URL for any bid", + "Take a snapshot from your video": "Take a snapshot from your video", + "Editing...": "Editing...", + "Success": "Success" } \ No newline at end of file