logo component on embeds/embeds ended

This commit is contained in:
zeppi 2021-07-25 18:03:48 -04:00 committed by jessopb
parent 19f8b0adac
commit 3f4c601428
4 changed files with 32 additions and 14 deletions

View file

@ -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}
/>
<div className="file-viewer__embedded-info">
<Button className="file-viewer__overlay-logo" icon={ICONS.LBRY} aria-label={__('Home')} {...lbryLinkProps} />
<Button className="file-viewer__overlay-logo" aria-label={__('Home')} {...lbryLinkProps}>
<Logo type={'embed'} />
</Button>
{isInApp && <FilePrice uri={uri} />}
</div>
</div>

View file

@ -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();
}}

View file

@ -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 ? <img src={LOGO} /> : <Icon icon={ICONS.LBRY} />;
const isMobile = useIsMobile();
const defaultWithLabel = (
<>
<label>{LOGO_TITLE}</label>
<Icon icon={ICONS.LBRY} />
</>
);
if (type === 'small' || (isMobile && type !== 'embed')) {
return LOGO ? <img className="header__odysee" src={LOGO} /> : <Icon icon={ICONS.LBRY} />;
} else if (type === 'embed') {
if (LOGO_TEXT_LIGHT) {
return (
<>
<img src={LOGO_TEXT_LIGHT} className="header__odysee" />
</>
);
} else {
return defaultWithLabel;
}
} else {
if (LOGO_TEXT_LIGHT && LOGO_TEXT_DARK) {
return (
<>
{/*<img src={LOGO} className="mobile-only header__odysee" />*/}
<img src={currentTheme === 'light' ? LOGO_TEXT_DARK : LOGO_TEXT_LIGHT} className="header__odysee" />
</>
);
} else {
return <Icon icon={ICONS.LBRY} />;
return defaultWithLabel;
}
}
}
//mobile-hidden

View file

@ -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 (
<div className="file-viewer__overlay">
<div className="file-viewer__overlay-secondary">
<Button className="file-viewer__overlay-logo" label="LBRY" icon={ICONS.LBRY} href={URL} />
<Button className="file-viewer__overlay-logo" href={URL}>
<Logo type={'embed'} />
</Button>
</div>
<div className="file-viewer__overlay-title">{prompt}</div>
<div className="file-viewer__overlay-actions">