import React from 'react'; import styled from '@emotion/styled'; import { Theme } from '../../design-tokens/theme'; import defaultLogo from './img/logo.svg'; import blackAndWithLogo from './img/logo-black-and-white.svg'; export enum Size { Small = '40px', Big = '90px', } const logos = { light: defaultLogo, dark: blackAndWithLogo, }; const logo = window.VERDACCIO_LOGO; interface Props { size?: Size; } const Logo: React.FC = ({ size = Size.Small }) => { if (logo) { return ( logo ); } return ; }; export default Logo; const ImageLogo = styled('div')({ fontSize: 0, }); const StyledLogo = styled('div')(({ size, theme }) => ({ display: 'inline-block', verticalAlign: 'middle', boxSizing: 'border-box', backgroundPosition: 'center', backgroundSize: 'contain', backgroundImage: `url(${logos[theme?.palette.type]})`, backgroundRepeat: ' no-repeat', width: size, height: size, }));