From d7d8b2f39a64fe3988b988bfdcbc9cb46f9a7172 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Fri, 6 Dec 2019 16:04:53 -0500 Subject: [PATCH] Revert "move upgrade prompt to a " This reverts commit 0c125ed2b92f6de1869a25502134eb09d1395a29. --- static/app-strings.json | 3 +-- ui/component/app/view.jsx | 14 ++++++++++++-- ui/component/common/nag.jsx | 28 --------------------------- ui/component/openInAppLink/view.jsx | 25 +++++++++++++++++++----- ui/modal/modalYoutubeWelcome/view.jsx | 4 ++-- ui/scss/component/_card.scss | 4 ++++ ui/util/url.js | 16 --------------- 7 files changed, 39 insertions(+), 55 deletions(-) delete mode 100644 ui/component/common/nag.jsx diff --git a/static/app-strings.json b/static/app-strings.json index 0baca0e92..e789d9d08 100644 --- a/static/app-strings.json +++ b/static/app-strings.json @@ -903,6 +903,5 @@ "Error Starting Up": "Error Starting Up", "Reach out to hello@lbry.com for help, or check out %help_link%.": "Reach out to hello@lbry.com for help, or check out %help_link%.", "You're not following any tags. Smash that %customize% button!": "You're not following any tags. Smash that %customize% button!", - "customize": "customize", - "An upgrade is available.": "An upgrade is available." + "customize": "customize" } diff --git a/ui/component/app/view.jsx b/ui/component/app/view.jsx index f37b97beb..335dbc57d 100644 --- a/ui/component/app/view.jsx +++ b/ui/component/app/view.jsx @@ -1,4 +1,5 @@ // @flow +import * as ICONS from 'constants/icons'; import * as PAGES from 'constants/pages'; import React, { useEffect, useRef, useState } from 'react'; import classnames from 'classnames'; @@ -13,7 +14,7 @@ import Yrbl from 'component/yrbl'; import FileViewer from 'component/fileViewer'; import { withRouter } from 'react-router'; import usePrevious from 'effects/use-previous'; -import Nag from 'component/common/nag'; +import Button from 'component/button'; // @if TARGET='web' import OpenInAppLink from 'component/openInAppLink'; import YoutubeWelcome from 'component/youtubeWelcome'; @@ -204,7 +205,16 @@ function App(props: Props) { {/* @if TARGET='app' */} {showUpgradeButton && ( - +
+ {__('Upgrade is ready')} +
)} {/* @endif */} {isEnhancedLayout && } diff --git a/ui/component/common/nag.jsx b/ui/component/common/nag.jsx deleted file mode 100644 index ed2d8f7b5..000000000 --- a/ui/component/common/nag.jsx +++ /dev/null @@ -1,28 +0,0 @@ -// @flow -import * as ICONS from 'constants/icons'; -import React from 'react'; -import Button from 'component/button'; - -type Props = { - message: string, - actionText: string, - href?: string, - onClick?: () => void, - onClose?: () => void, -}; - -export default function Nag(props: Props) { - const { message, actionText, href, onClick, onClose } = props; - - const buttonProps = onClick ? { onClick } : { href }; - - return ( -
- {message} - - {onClose &&
- ); -} diff --git a/ui/component/openInAppLink/view.jsx b/ui/component/openInAppLink/view.jsx index 9a4499edf..68508e2cf 100644 --- a/ui/component/openInAppLink/view.jsx +++ b/ui/component/openInAppLink/view.jsx @@ -1,16 +1,17 @@ // @flow +import * as ICONS from 'constants/icons'; +import * as PAGES from 'constants/pages'; import React from 'react'; +import Button from 'component/button'; import { withRouter } from 'react-router'; import userPersistedState from 'effects/use-persisted-state'; -import { formatWebUrlIntoLbryUrl } from 'util/url'; -import Nag from 'component/common/nag'; const userAgent = navigator.userAgent.toLowerCase(); const isAndroid = userAgent.includes('android'); const isDesktop = typeof window.orientation === 'undefined'; type Props = { - history: { replace: string => void, push: string => void }, + history: { replace: string => void }, location: { search: string, pathname: string }, uri: string, user: ?User, @@ -34,7 +35,15 @@ function OpenInAppLink(props: Props) { let appLink = uri; if (!appLink) { - appLink = formatWebUrlIntoLbryUrl(pathname, search); + // If there is no uri, the user is on an internal page + // pathname will either be "/" or "/$/{page}" + const path = pathname.startsWith('/$/') ? pathname.slice(3) : pathname.slice(1); + appLink = `lbry://?${path || PAGES.DISCOVER}`; + + if (search) { + // We already have a leading "?" for the query param on internal pages + appLink += search.replace('?', '&'); + } } function handleClose() { @@ -59,7 +68,13 @@ function OpenInAppLink(props: Props) { } return ( - +
+ {__('The app is like, better.')} + +
); } diff --git a/ui/modal/modalYoutubeWelcome/view.jsx b/ui/modal/modalYoutubeWelcome/view.jsx index e722bc31b..17312358a 100644 --- a/ui/modal/modalYoutubeWelcome/view.jsx +++ b/ui/modal/modalYoutubeWelcome/view.jsx @@ -29,7 +29,7 @@ const YoutubeWelcome = (props: Props) => { } actions={ -
+
+ } /> diff --git a/ui/scss/component/_card.scss b/ui/scss/component/_card.scss index ed03010dd..1c61d3896 100644 --- a/ui/scss/component/_card.scss +++ b/ui/scss/component/_card.scss @@ -160,6 +160,10 @@ padding-bottom: 0; margin-bottom: var(--spacing-large); border-top: 1px solid var(--color-border); + + .button + .button { + margin-left: var(--spacing-medium); + } } .card__body--with-icon, diff --git a/ui/util/url.js b/ui/util/url.js index a9feb63e7..61579aa2f 100644 --- a/ui/util/url.js +++ b/ui/util/url.js @@ -1,5 +1,3 @@ -const PAGES = require('constants/pages'); - exports.formatLbryUrlForWeb = uri => { return uri.replace('lbry://', '/').replace(/#/g, ':'); }; @@ -43,17 +41,3 @@ exports.formatInAppUrl = path => { // Regular claim url return path; }; - -exports.formatWebUrlIntoLbryUrl = (pathname, search) => { - // If there is no uri, the user is on an internal page - // pathname will either be "/" or "/$/{page}" - const path = pathname.startsWith('/$/') ? pathname.slice(3) : pathname.slice(1); - let appLink = `lbry://?${path || PAGES.DISCOVER}`; - - if (search) { - // We already have a leading "?" for the query param on internal pages - appLink += search.replace('?', '&'); - } - - return appLink; -};