2021-07-21 17:33:28 +02:00
|
|
|
// @flow
|
2021-12-20 15:00:22 +01:00
|
|
|
import { LOGO_TITLE, LOGO, LOGO_WHITE_TEXT, LOGO_DARK_TEXT } from 'config';
|
|
|
|
import { useIsMobile } from 'effects/use-screensize';
|
2021-07-21 17:33:28 +02:00
|
|
|
import * as ICONS from 'constants/icons';
|
|
|
|
import Icon from 'component/common/icon';
|
2021-12-20 15:00:22 +01:00
|
|
|
import React from 'react';
|
2021-07-21 17:33:28 +02:00
|
|
|
|
|
|
|
type Props = {
|
|
|
|
currentTheme: string,
|
2021-12-20 15:00:22 +01:00
|
|
|
type: string,
|
2021-07-21 17:33:28 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default function Logo(props: Props) {
|
2021-12-20 15:00:22 +01:00
|
|
|
const { currentTheme, type } = props;
|
|
|
|
|
2021-07-26 00:03:48 +02:00
|
|
|
const isMobile = useIsMobile();
|
2021-12-20 15:00:22 +01:00
|
|
|
const isLightTheme = currentTheme === 'light';
|
|
|
|
|
2021-07-26 00:03:48 +02:00
|
|
|
const defaultWithLabel = (
|
|
|
|
<>
|
|
|
|
<Icon icon={ICONS.LBRY} />
|
2021-12-20 15:00:22 +01:00
|
|
|
<div className="button__label">{LOGO_TITLE}</div>
|
2021-07-26 00:03:48 +02:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
|
2021-12-20 15:00:22 +01:00
|
|
|
if (LOGO_WHITE_TEXT && (type === 'embed' || type === 'embed-ended')) {
|
|
|
|
return <img className="embed__overlay-logo" src={LOGO_WHITE_TEXT} />;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (type === 'small' || isMobile) {
|
2021-12-20 15:02:26 +01:00
|
|
|
return <img className="header__navigation-logo" src={LOGO} height={200} width={200} />;
|
2021-07-21 17:33:28 +02:00
|
|
|
}
|
2021-12-20 15:00:22 +01:00
|
|
|
|
|
|
|
if (LOGO_WHITE_TEXT && LOGO_DARK_TEXT) {
|
2021-12-20 15:02:26 +01:00
|
|
|
return (
|
|
|
|
<img
|
|
|
|
className="header__navigation-logo"
|
|
|
|
height={300}
|
|
|
|
width={1000}
|
|
|
|
src={isLightTheme ? LOGO_DARK_TEXT : LOGO_WHITE_TEXT}
|
|
|
|
/>
|
|
|
|
);
|
2021-12-20 15:00:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return defaultWithLabel;
|
2021-07-21 17:33:28 +02:00
|
|
|
}
|