diff --git a/package.json b/package.json index dbb36af77..968dbaa06 100644 --- a/package.json +++ b/package.json @@ -125,7 +125,7 @@ "json-loader": "^0.5.4", "lbry-format": "https://github.com/lbryio/lbry-format.git", "lbry-redux": "lbryio/lbry-redux#bb82aed61a5569e565daa784eb25fc1d639c0c22", - "lbryinc": "lbryio/lbryinc#a93596c51c8fb0a226cb84df04c26a6bb60a45fb", + "lbryinc": "lbryio/lbryinc#69f9562b016030b481375443f56147ff5e273c0e", "lint-staged": "^7.0.2", "localforage": "^1.7.1", "lodash-es": "^4.17.14", diff --git a/src/ui/analytics.js b/src/ui/analytics.js index a30af33c6..b8bf48261 100644 --- a/src/ui/analytics.js +++ b/src/ui/analytics.js @@ -14,7 +14,6 @@ type Analytics = { toggle: (boolean, ?boolean) => void, apiLogView: (string, string, string, ?number, ?() => void) => void, apiLogPublish: () => void, - tagFollowEvent: (string, boolean, string) => void, }; let analyticsEnabled: boolean = true; @@ -24,14 +23,12 @@ const analytics: Analytics = { ReactGA.pageview(path); } }, - setUser: userId => { - if (analyticsEnabled && userId) { - ReactGA.event({ - category: 'User', - action: 'userId', - value: userId, - }); - } + setUser: user => { + // Commented out because currently there is some delay before we know the user + // We should retrieve this server side so we have it immediately + // if (analyticsEnabled && user.id) { + // ReactGA.set('userId', user.id); + // } }, toggle: (enabled: boolean): void => { // Always collect analytics on lbry.tv @@ -81,15 +78,6 @@ const analytics: Analytics = { Lbryio.call('feedback', 'search', { query, vote }); } }, - tagFollowEvent: (tag, following, location) => { - if (analyticsEnabled) { - ReactGA.event({ - category: 'Tag', - action: following ? 'follow' : 'unfollow', - value: tag, - }); - } - }, }; // Initialize google analytics diff --git a/src/ui/component/app/view.jsx b/src/ui/component/app/view.jsx index fc28aa29c..0c82d2233 100644 --- a/src/ui/component/app/view.jsx +++ b/src/ui/component/app/view.jsx @@ -1,6 +1,5 @@ // @flow import React, { useEffect, useRef } from 'react'; -import analytics from 'analytics'; import Router from 'component/router/index'; import ModalRouter from 'modal/modalRouter'; import ReactModal from 'react-modal'; @@ -17,17 +16,15 @@ type Props = { pageTitle: ?string, language: string, theme: string, - user: ?{ id: string }, fetchRewards: () => void, fetchRewardedContent: () => void, fetchTransactions: () => void, }; function App(props: Props) { - const { theme, fetchRewards, fetchRewardedContent, fetchTransactions, user } = props; + const { theme, fetchRewards, fetchRewardedContent, fetchTransactions } = props; const appRef = useRef(); const isEnhancedLayout = useKonamiListener(); - const userId = user && user.id; useEffect(() => { ReactModal.setAppElement(appRef.current); @@ -44,12 +41,6 @@ function App(props: Props) { document.documentElement.setAttribute('data-mode', theme); }, [theme]); - useEffect(() => { - if (userId) { - analytics.setUser(userId); - } - }, [userId]); - return (
openContextMenu(e)}>
diff --git a/src/ui/component/comment/view.jsx b/src/ui/component/comment/view.jsx index 5ab76b8cb..096f35642 100644 --- a/src/ui/component/comment/view.jsx +++ b/src/ui/component/comment/view.jsx @@ -1,28 +1,25 @@ // @flow import React from 'react'; import relativeDate from 'tiny-relative-date'; -import Button from 'component/button'; type Props = { author: string, - authorUri: string, message: string, timePosted: number, }; function Comment(props: Props) { - const { author, authorUri, timePosted, message } = props; + const { author, timePosted, message } = props; return (
  • -
    - */} diff --git a/src/ui/component/commentsList/view.jsx b/src/ui/component/commentsList/view.jsx index 76fdfca23..bc4cfbaa7 100644 --- a/src/ui/component/commentsList/view.jsx +++ b/src/ui/component/commentsList/view.jsx @@ -21,7 +21,6 @@ function CommentList(props: Props) { comments.map(comment => { return ( tag.name).includes(tag.name); - const nowFollowing = !wasFollowing; - analytics.tagFollowEvent(tag.name, nowFollowing, 'tag-select'); } } diff --git a/src/ui/component/userVerify/view.jsx b/src/ui/component/userVerify/view.jsx index 83a010d41..013220818 100644 --- a/src/ui/component/userVerify/view.jsx +++ b/src/ui/component/userVerify/view.jsx @@ -30,8 +30,8 @@ class UserVerify extends React.PureComponent {

    {__('Final Human Proof')}

    - To start the rewards approval process, please complete one and only one of the options - below. This is optional, and can be skipped at the bottom of the page. + To be approved for rewards, please complete one and only one of the options below. This + is optional, and you can be skipped at the bottom.

    diff --git a/src/ui/component/walletSendTip/view.jsx b/src/ui/component/walletSendTip/view.jsx index ceb53242c..1aa2026f3 100644 --- a/src/ui/component/walletSendTip/view.jsx +++ b/src/ui/component/walletSendTip/view.jsx @@ -95,6 +95,7 @@ class WalletSendTip extends React.PureComponent { label={__('Send')} disabled={isPending || tipError || !tipAmount} onClick={this.handleSendButtonClicked} + type="submit" /> } helper={ diff --git a/src/ui/modal/modalConfirmTransaction/view.jsx b/src/ui/modal/modalConfirmTransaction/view.jsx index f22203f4f..72b9cee6d 100644 --- a/src/ui/modal/modalConfirmTransaction/view.jsx +++ b/src/ui/modal/modalConfirmTransaction/view.jsx @@ -1,5 +1,7 @@ // @flow import React from 'react'; +import Button from 'component/button'; +import { Form } from 'component/common/form'; import { Modal } from 'modal/modal'; type Props = { @@ -23,18 +25,20 @@ class ModalConfirmTransaction extends React.PureComponent { isOpen title={__('Send LBC')} contentLabel={__('Confirm Transaction')} - type="confirm" - confirmButtonLabel={__('Send')} - onConfirmed={() => this.onConfirmed()} + type="custom" onAborted={closeModal} > -
    +
    this.onConfirmed()}>

    {__('Sending: ')}

    {amount} LBC

    {__('To address: ')}

    {address}

    {__('Once the transaction is sent, it cannot be reversed.')}

    -
    +
    +
    + ); } diff --git a/src/ui/modal/modalRemoveFile/view.jsx b/src/ui/modal/modalRemoveFile/view.jsx index ffd3ab354..1a24d05c6 100644 --- a/src/ui/modal/modalRemoveFile/view.jsx +++ b/src/ui/modal/modalRemoveFile/view.jsx @@ -1,7 +1,8 @@ // @flow import React from 'react'; import { Modal } from 'modal/modal'; -import { FormField } from 'component/common/form'; +import { Form, FormField } from 'component/common/form'; +import Button from 'component/button'; import usePersistedState from 'util/use-persisted-state'; type Props = { @@ -23,22 +24,13 @@ function ModalRemoveFile(props: Props) { const outpoint = fileInfo ? fileInfo.outpoint : `${txid}:${nout}`; return ( - deleteFile(outpoint || '', deleteChecked, abandonChecked)} - onAborted={closeModal} - > +

    {__("Are you sure you'd like to remove")} {`"${title}"`} {__('from the LBRY app?')}

    -
    +
    deleteFile(outpoint || '', deleteChecked, abandonChecked)}> setAbandonChecked(!abandonChecked)} /> )} -
    +
    +
    +
    ); } diff --git a/src/ui/modal/modalWalletEncrypt/view.jsx b/src/ui/modal/modalWalletEncrypt/view.jsx index e4c2bd22a..935383de9 100644 --- a/src/ui/modal/modalWalletEncrypt/view.jsx +++ b/src/ui/modal/modalWalletEncrypt/view.jsx @@ -1,6 +1,6 @@ // @flow import React from 'react'; -import { Form, FormField } from 'component/common/form'; +import { Form, FormField, Submit } from 'component/common/form'; import { Modal } from 'modal/modal'; import Button from 'component/button'; @@ -94,9 +94,7 @@ class ModalWalletEncrypt extends React.PureComponent { isOpen title={__('Encrypt Wallet')} contentLabel={__('Encrypt Wallet')} - type="confirm" - confirmButtonLabel={__('Encrypt Wallet')} - abortButtonLabel={__('Cancel')} + type="custom" onConfirmed={() => this.submitEncryptForm()} onAborted={closeModal} > @@ -135,6 +133,7 @@ class ModalWalletEncrypt extends React.PureComponent { )}
    } error={understandError === true ? 'You must enter "I understand"' : false} label={__('Enter "I understand"')} placeholder={__('Dear computer, I understand')} @@ -144,6 +143,9 @@ class ModalWalletEncrypt extends React.PureComponent { /> {failMessage &&
    {__(failMessage)}
    } +
    +
    ); } diff --git a/src/ui/page/search/view.jsx b/src/ui/page/search/view.jsx index 186077f71..faeec7bd4 100644 --- a/src/ui/page/search/view.jsx +++ b/src/ui/page/search/view.jsx @@ -10,7 +10,6 @@ import Button from 'component/button'; type Props = { search: string => void, - isSearching: boolean, location: UrlLocation, uris: Array, onFeedbackNegative: string => void, @@ -18,7 +17,7 @@ type Props = { }; export default function SearchPage(props: Props) { - const { search, uris, onFeedbackPositive, onFeedbackNegative, location, isSearching } = props; + const { search, uris, onFeedbackPositive, onFeedbackNegative, location } = props; const urlParams = new URLSearchParams(location.search); const urlQuery = urlParams.get('q'); const isValid = isURIValid(urlQuery); @@ -51,7 +50,6 @@ export default function SearchPage(props: Props) {
    } headerAltControls={ diff --git a/src/ui/page/tags/view.jsx b/src/ui/page/tags/view.jsx index 91a4f1921..cbf9e8ea0 100644 --- a/src/ui/page/tags/view.jsx +++ b/src/ui/page/tags/view.jsx @@ -4,7 +4,6 @@ import Page from 'component/page'; import ClaimListDiscover from 'component/claimListDiscover'; import Button from 'component/button'; import useHover from 'util/use-hover'; -import analytics from 'analytics'; type Props = { location: { search: string }, @@ -34,18 +33,11 @@ function TagsPage(props: Props) { label = __('Unfollow'); } - function handleFollowClick() { - doToggleTagFollow(tag); - - const nowFollowing = !isFollowing; - analytics.tagFollowEvent(tag, nowFollowing, 'tag-page'); - } - return ( } + meta={