Merge pull request #94 from verdaccio/89-fix-incorrect-logos-style

fix: incorrect logos styles
This commit is contained in:
Juan Picado @jotadeveloper 2019-07-10 14:15:04 +02:00 committed by GitHub
commit 640e8ca5ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 10 deletions

View File

@ -1,6 +1,6 @@
import React from 'react';
import Logo from '../Logo';
import Logo, { Size } from '../Logo';
import Spinner from '../Spinner';
import { Wrapper, Badge } from './styles';
@ -8,7 +8,7 @@ import { Wrapper, Badge } from './styles';
const Loading: React.FC = () => (
<Wrapper>
<Badge>
<Logo />
<Logo size={Size.Big} />
</Badge>
<Spinner />
</Wrapper>

View File

@ -1,3 +1,3 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`<Loading /> component should render the component in default state 1`] = `"<div class=\\"css-1221txa eimgwje0\\"><div class=\\"css-bxochs eimgwje1\\"><div class=\\"css-1tnu3ib em793ed0\\"></div></div><div class=\\"css-vqrgi e1ag4h8b0\\"><div class=\\"MuiCircularProgress-root-1 MuiCircularProgress-colorPrimary-4 MuiCircularProgress-indeterminate-3 css-15gl0ho e1ag4h8b1\\" style=\\"width:50px;height:50px\\" role=\\"progressbar\\"><svg class=\\"MuiCircularProgress-svg-6\\" viewBox=\\"22 22 44 44\\"><circle class=\\"MuiCircularProgress-circle-7 MuiCircularProgress-circleIndeterminate-9\\" cx=\\"44\\" cy=\\"44\\" r=\\"20.2\\" fill=\\"none\\" stroke-width=\\"3.6\\"></circle></svg></div></div></div>"`;
exports[`<Loading /> component should render the component in default state 1`] = `"<div class=\\"css-1221txa eimgwje0\\"><div class=\\"css-bxochs eimgwje1\\"><div class=\\"css-kt1gx0 em793ed0\\"></div></div><div class=\\"css-vqrgi e1ag4h8b0\\"><div class=\\"MuiCircularProgress-root-1 MuiCircularProgress-colorPrimary-4 MuiCircularProgress-indeterminate-3 css-15gl0ho e1ag4h8b1\\" style=\\"width:50px;height:50px\\" role=\\"progressbar\\"><svg class=\\"MuiCircularProgress-svg-6\\" viewBox=\\"22 22 44 44\\"><circle class=\\"MuiCircularProgress-circle-7 MuiCircularProgress-circleIndeterminate-9\\" cx=\\"44\\" cy=\\"44\\" r=\\"20.2\\" fill=\\"none\\" stroke-width=\\"3.6\\"></circle></svg></div></div></div>"`;

View File

@ -3,7 +3,16 @@ import React from 'react';
import styled from 'react-emotion';
import logo from './img/logo.svg';
const StyledLogo = styled('div')`
export enum Size {
Small = '40px',
Big = '90px',
}
interface Props {
size?: Size;
}
const StyledLogo = styled('div')<Props>`
&& {
display: inline-block;
vertical-align: middle;
@ -12,11 +21,11 @@ const StyledLogo = styled('div')`
background-size: contain;
background-image: url(${logo});
background-repeat: no-repeat;
width: 40px;
height: 40px;`;
const Logo: React.FC = () => {
return <StyledLogo />;
width: ${({ size }) => size};
height: ${({ size }) => size};
`;
const Logo: React.FC<Props> = ({ size = Size.Small }) => {
return <StyledLogo size={size} />;
};
export default Logo;

View File

@ -1 +1 @@
export { default } from './Logo';
export { default, Size } from './Logo';