2021-07-21 17:33:28 +02:00
|
|
|
// @flow
|
2021-12-20 15:00:22 +01:00
|
|
|
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-12-21 19:46:32 +01:00
|
|
|
if (type === 'embed' || type === 'embed-ended') {
|
|
|
|
return <Icon className="embed__overlay-logo" icon={ICONS.ODYSEE_WHITE_TEXT} />;
|
2021-12-20 15:00:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (type === 'small' || isMobile) {
|
2021-12-21 19:46:32 +01:00
|
|
|
return <Icon className="header__logo" icon={ICONS.ODYSEE_LOGO} />;
|
2021-12-20 15:00:22 +01:00
|
|
|
}
|
|
|
|
|
2021-12-21 19:46:32 +01:00
|
|
|
return <Icon className="header__logo" icon={isLightTheme ? ICONS.ODYSEE_DARK_TEXT : ICONS.ODYSEE_WHITE_TEXT} />;
|
2021-07-21 17:33:28 +02:00
|
|
|
}
|