From 3f4c601428c64fa532af71c4382abcd74f4e0172 Mon Sep 17 00:00:00 2001 From: zeppi Date: Sun, 25 Jul 2021 18:03:48 -0400 Subject: [PATCH] logo component on embeds/embeds ended --- ui/component/fileViewerEmbeddedTitle/view.jsx | 6 ++-- ui/component/header/view.jsx | 5 +--- ui/component/logo/view.jsx | 29 +++++++++++++++---- .../fileViewerEmbeddedEnded/view.jsx | 6 ++-- 4 files changed, 32 insertions(+), 14 deletions(-) diff --git a/ui/component/fileViewerEmbeddedTitle/view.jsx b/ui/component/fileViewerEmbeddedTitle/view.jsx index e97b56e73..39dfe4d4c 100644 --- a/ui/component/fileViewerEmbeddedTitle/view.jsx +++ b/ui/component/fileViewerEmbeddedTitle/view.jsx @@ -5,7 +5,7 @@ import FilePrice from 'component/filePrice'; import { formatLbryUrlForWeb } from 'util/url'; import { withRouter } from 'react-router'; import { URL } from 'config'; -import * as ICONS from 'constants/icons'; +import Logo from 'component/logo'; type Props = { uri: string, @@ -36,7 +36,9 @@ function FileViewerEmbeddedTitle(props: Props) { {...contentLinkProps} />
- {isInApp && }
diff --git a/ui/component/header/view.jsx b/ui/component/header/view.jsx index 7b961664c..775d4a12f 100644 --- a/ui/component/header/view.jsx +++ b/ui/component/header/view.jsx @@ -1,5 +1,5 @@ // @flow -import { LOGO_TITLE, ENABLE_NO_SOURCE_CLAIMS, CHANNEL_STAKED_LEVEL_LIVESTREAM, ENABLE_UI_NOTIFICATIONS } from 'config'; +import { ENABLE_NO_SOURCE_CLAIMS, CHANNEL_STAKED_LEVEL_LIVESTREAM, ENABLE_UI_NOTIFICATIONS } from 'config'; import * as ICONS from 'constants/icons'; import { SETTINGS } from 'lbry-redux'; import * as PAGES from 'constants/pages'; @@ -256,9 +256,6 @@ const Header = (props: Props) => { // @if TARGET='app' label={'LBRY'} // @endif - // @if TARGET='web' - label={LOGO_TITLE} // eslint-disable-line - // @endif onClick={() => { if (history.location.pathname === '/') window.location.reload(); }} diff --git a/ui/component/logo/view.jsx b/ui/component/logo/view.jsx index 7d1ddd30a..21bfe28d9 100644 --- a/ui/component/logo/view.jsx +++ b/ui/component/logo/view.jsx @@ -1,8 +1,9 @@ // @flow import React from 'react'; import * as ICONS from 'constants/icons'; -import { LOGO, LOGO_TEXT_LIGHT, LOGO_TEXT_DARK } from 'config'; +import { LOGO_TITLE, LOGO, LOGO_TEXT_LIGHT, LOGO_TEXT_DARK } from 'config'; import Icon from 'component/common/icon'; +import { useIsMobile } from 'effects/use-screensize'; type Props = { type: string, @@ -11,19 +12,35 @@ type Props = { export default function Logo(props: Props) { const { type, currentTheme } = props; - if (type === 'small') { - return LOGO ? : ; + const isMobile = useIsMobile(); + const defaultWithLabel = ( + <> + + + + ); + + if (type === 'small' || (isMobile && type !== 'embed')) { + return LOGO ? : ; + } else if (type === 'embed') { + if (LOGO_TEXT_LIGHT) { + return ( + <> + + + ); + } else { + return defaultWithLabel; + } } else { if (LOGO_TEXT_LIGHT && LOGO_TEXT_DARK) { return ( <> - {/**/} ); } else { - return ; + return defaultWithLabel; } } } -//mobile-hidden diff --git a/web/component/fileViewerEmbeddedEnded/view.jsx b/web/component/fileViewerEmbeddedEnded/view.jsx index eaf70ee30..86bb1803f 100644 --- a/web/component/fileViewerEmbeddedEnded/view.jsx +++ b/web/component/fileViewerEmbeddedEnded/view.jsx @@ -4,7 +4,7 @@ import Button from 'component/button'; import { formatLbryUrlForWeb } from 'util/url'; import { withRouter } from 'react-router'; import { URL, SITE_NAME } from 'config'; -import * as ICONS from 'constants/icons'; +import Logo from 'component/logo'; type Props = { uri: string, @@ -37,7 +37,9 @@ function FileViewerEmbeddedEnded(props: Props) { return (
-
{prompt}