optimizedImage
This commit is contained in:
parent
71d9b0d973
commit
ef77a5cd00
1 changed files with 4 additions and 3 deletions
|
@ -4,6 +4,7 @@ import * as ICONS from 'constants/icons';
|
||||||
import { LOGO_TITLE, 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 Icon from 'component/common/icon';
|
||||||
import { useIsMobile } from 'effects/use-screensize';
|
import { useIsMobile } from 'effects/use-screensize';
|
||||||
|
import OptimizedImage from 'component/optimizedImage';
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
type: string,
|
type: string,
|
||||||
|
@ -21,12 +22,12 @@ export default function Logo(props: Props) {
|
||||||
);
|
);
|
||||||
|
|
||||||
if (type === 'small' || (isMobile && type !== 'embed')) {
|
if (type === 'small' || (isMobile && type !== 'embed')) {
|
||||||
return LOGO ? <img className="header__odysee" src={LOGO} /> : <Icon icon={ICONS.LBRY} />;
|
return LOGO ? <OptimizedImage src={LOGO} /> : <Icon icon={ICONS.LBRY} />;
|
||||||
} else if (type === 'embed') {
|
} else if (type === 'embed') {
|
||||||
if (LOGO_TEXT_LIGHT) {
|
if (LOGO_TEXT_LIGHT) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<img src={LOGO_TEXT_LIGHT} className="header__odysee" />
|
<OptimizedImage src={LOGO_TEXT_LIGHT} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@ -36,7 +37,7 @@ export default function Logo(props: Props) {
|
||||||
if (LOGO_TEXT_LIGHT && LOGO_TEXT_DARK) {
|
if (LOGO_TEXT_LIGHT && LOGO_TEXT_DARK) {
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<img src={currentTheme === 'light' ? LOGO_TEXT_DARK : LOGO_TEXT_LIGHT} className="header__odysee" />
|
<OptimizedImage src={currentTheme === 'light' ? LOGO_TEXT_DARK : LOGO_TEXT_LIGHT} />
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue