From bb0436d0ee0a60117864bae907865ee09bf52046 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 2 Jul 2019 00:22:13 -0400 Subject: [PATCH 01/16] fix: empty recent tx list styling --- src/ui/component/transactionList/view.jsx | 2 +- src/ui/scss/component/_main.scss | 4 ++-- src/ui/scss/component/_table.scss | 4 ++++ static/locales/en.json | 4 +--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/ui/component/transactionList/view.jsx b/src/ui/component/transactionList/view.jsx index ca3ba5172..06ce95e38 100644 --- a/src/ui/component/transactionList/view.jsx +++ b/src/ui/component/transactionList/view.jsx @@ -121,7 +121,7 @@ class TransactionList extends React.PureComponent { )} {!loading && !transactionList.length && ( -

{emptyMessage || __('No transactions.')}

+

{emptyMessage || __('No transactions.')}

)} {!!transactionList.length && ( diff --git a/src/ui/scss/component/_main.scss b/src/ui/scss/component/_main.scss index f996e5a0e..d0f1e476d 100644 --- a/src/ui/scss/component/_main.scss +++ b/src/ui/scss/component/_main.scss @@ -78,8 +78,8 @@ align-items: center; display: flex; flex-direction: column; - padding-top: 100px; - padding-bottom: 100px; + margin-top: 100px; + margin-bottom: 100px; text-align: center; } diff --git a/src/ui/scss/component/_table.scss b/src/ui/scss/component/_table.scss index df0dbab62..6e251accf 100644 --- a/src/ui/scss/component/_table.scss +++ b/src/ui/scss/component/_table.scss @@ -18,6 +18,10 @@ table, } } +.table--empty { + // padding: var(--spacing-large); +} + td { overflow: hidden; } diff --git a/static/locales/en.json b/static/locales/en.json index 1e077b038..8cbfde76f 100644 --- a/static/locales/en.json +++ b/static/locales/en.json @@ -473,8 +473,6 @@ "Editing": "Editing", "Edit Your Channel": "Edit Your Channel", "Editing Your Channel": "Editing Your Channel", - "We can explain... We know this page won't win any design awards, we have a cool idea for channel edits in the future. We just wanted to release a very very very basic version that just barely kinda works so people can use it.": "We can explain... We know this page won't win any design awards, we have a cool idea for channel edits in the future. We just wanted to release a very very very basic version that just barely kinda works so people can use it.", - "We can explain... \n\n We know this page won't win any design awards, we have a cool idea for channel edits in the future. We just wanted to release a very very very basic version that just barely kinda works so people can use it.": "We can explain... \n\n We know this page won't win any design awards, we have a cool idea for channel edits in the future. We just wanted to release a very very very basic version that just barely kinda works so people can use it.", "We can explain...": "We can explain...", "We know this page won't win any design awards, we have a cool idea for channel edits in the future. We just wanted to release a very very very basic version that just barely kinda works so people can use": "We know this page won't win any design awards, we have a cool idea for channel edits in the future. We just wanted to release a very very very basic version that just barely kinda works so people can use", "We know this page won't win any design awards, we just wanted to release a very very very basic version that just barely kinda works so people can use": "We know this page won't win any design awards, we just wanted to release a very very very basic version that just barely kinda works so people can use", @@ -484,4 +482,4 @@ "Filter": "Filter", "Rendering document.": "Rendering document.", "Sorry, looks like we can't load the document.": "Sorry, looks like we can't load the document." -} \ No newline at end of file +} From ce85c972b660c3a9197842bd84bad23e490659de Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 2 Jul 2019 00:29:39 -0400 Subject: [PATCH 02/16] add missing icons --- src/ui/component/claimPreview/view.jsx | 2 +- src/ui/component/common/icon-custom.jsx | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/ui/component/claimPreview/view.jsx b/src/ui/component/claimPreview/view.jsx index 839d79f27..851d914c2 100644 --- a/src/ui/component/claimPreview/view.jsx +++ b/src/ui/component/claimPreview/view.jsx @@ -59,7 +59,7 @@ function ClaimPreview(props: Props) { let shouldHide = abandoned || (!claimIsMine && obscureNsfw && nsfw); // This will be replaced once blocking is done at the wallet server level - if (claim && !shouldHide) { + if (claim && !shouldHide && blackListedOutpoints) { for (let i = 0; i < blackListedOutpoints.length; i += 1) { const outpoint = blackListedOutpoints[i]; if (outpoint.txid === claim.txid && outpoint.nout === claim.nout) { diff --git a/src/ui/component/common/icon-custom.jsx b/src/ui/component/common/icon-custom.jsx index 19a42c81e..059f51491 100644 --- a/src/ui/component/common/icon-custom.jsx +++ b/src/ui/component/common/icon-custom.jsx @@ -240,4 +240,17 @@ export const icons = { ), + [ICONS.ALERT]: buildIcon( + + + + + + ), + [ICONS.UNLOCK]: buildIcon( + + + + + ), }; From 21a2e4c55098bb6b4abaa45c1934ab35d1765459 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 2 Jul 2019 00:31:02 -0400 Subject: [PATCH 03/16] fix typo --- src/ui/component/tag/view.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ui/component/tag/view.jsx b/src/ui/component/tag/view.jsx index 77845330a..f16d52f9b 100644 --- a/src/ui/component/tag/view.jsx +++ b/src/ui/component/tag/view.jsx @@ -19,7 +19,7 @@ export default function Tag(props: Props) { if (!onClick) { title = __('View tag'); } else { - type === 'add' ? __('Add tag') : __('Remove tag'); + title = type === 'add' ? __('Add tag') : __('Remove tag'); } return ( From 9ca18433ffad66fe1d813eb704e99854a6c6c6e5 Mon Sep 17 00:00:00 2001 From: Sean Yesmunt Date: Tue, 2 Jul 2019 00:39:17 -0400 Subject: [PATCH 04/16] consistent language with follow/unfollow --- src/ui/component/subscribeButton/view.jsx | 21 +++------------------ src/ui/page/tags/view.jsx | 17 +++++++++-------- src/ui/util/use-hover.js | 23 +++++++++++++++++++++++ 3 files changed, 35 insertions(+), 26 deletions(-) create mode 100644 src/ui/util/use-hover.js diff --git a/src/ui/component/subscribeButton/view.jsx b/src/ui/component/subscribeButton/view.jsx index e9c0b266d..cdaea453a 100644 --- a/src/ui/component/subscribeButton/view.jsx +++ b/src/ui/component/subscribeButton/view.jsx @@ -1,9 +1,10 @@ // @flow import * as MODALS from 'constants/modal_types'; import * as ICONS from 'constants/icons'; -import React, { useState, useRef, useEffect } from 'react'; +import React, { useRef } from 'react'; import { parseURI } from 'lbry-redux'; import Button from 'component/button'; +import useHover from 'util/use-hover'; type SubscribtionArgs = { channelName: string, @@ -33,28 +34,12 @@ export default function SubscribeButton(props: Props) { doToast, } = props; const buttonRef = useRef(); - const [isHovering, setIsHovering] = useState(false); + const isHovering = useHover(buttonRef); const { claimName } = parseURI(uri); const subscriptionHandler = isSubscribed ? doChannelUnsubscribe : doChannelSubscribe; const subscriptionLabel = isSubscribed ? __('Following') : __('Follow'); const unfollowOverride = isSubscribed && isHovering && __('Unfollow'); - useEffect(() => { - function handleHover() { - setIsHovering(!isHovering); - } - - const button = buttonRef.current; - if (button) { - button.addEventListener('mouseover', handleHover); - button.addEventListener('mouseleave', handleHover); - return () => { - button.removeEventListener('mouseover', handleHover); - button.removeEventListener('mouseleave', handleHover); - }; - } - }, [buttonRef, isHovering]); - return (