From fdad635072e10535810ced568672e15ba73b217a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Herrera=20Guzm=C3=A1n?= Date: Tue, 9 Jul 2019 18:45:35 +0200 Subject: [PATCH 1/3] fix: incorrect logos styles - Remove unnecessary quotes in Emotion css templated string - Revert md prop removed in #47 (with the size set before that) --- src/components/Header/Header.tsx | 2 +- .../Header/__snapshots__/Header.test.tsx.snap | 4 ++-- src/components/Loading/Loading.tsx | 2 +- .../Loading/__snapshots__/Loading.test.tsx.snap | 2 +- src/components/Login/Login.tsx | 2 +- .../Login/__snapshots__/Login.test.tsx.snap | 4 ++-- src/components/Logo/Logo.tsx | 16 ++++++++++------ 7 files changed, 18 insertions(+), 14 deletions(-) diff --git a/src/components/Header/Header.tsx b/src/components/Header/Header.tsx index 7c8d5b8..b0c2ff7 100644 --- a/src/components/Header/Header.tsx +++ b/src/components/Header/Header.tsx @@ -144,7 +144,7 @@ class Header extends Component { {this.renderLogo()} diff --git a/src/components/Header/__snapshots__/Header.test.tsx.snap b/src/components/Header/__snapshots__/Header.test.tsx.snap index 91511b7..547a7a4 100644 --- a/src/components/Header/__snapshots__/Header.test.tsx.snap +++ b/src/components/Header/__snapshots__/Header.test.tsx.snap @@ -1,5 +1,5 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`
component with logged in state should load the component in logged in state 1`] = `"
"`; +exports[`
component with logged in state should load the component in logged in state 1`] = `"
"`; -exports[`
component with logged out state should load the component in logged out state 1`] = `"
"`; +exports[`
component with logged out state should load the component in logged out state 1`] = `"
"`; diff --git a/src/components/Loading/Loading.tsx b/src/components/Loading/Loading.tsx index 17d23c1..b7877a3 100644 --- a/src/components/Loading/Loading.tsx +++ b/src/components/Loading/Loading.tsx @@ -8,7 +8,7 @@ import { Wrapper, Badge } from './styles'; const Loading: React.FC = () => ( - + diff --git a/src/components/Loading/__snapshots__/Loading.test.tsx.snap b/src/components/Loading/__snapshots__/Loading.test.tsx.snap index 680cd3a..5d29230 100644 --- a/src/components/Loading/__snapshots__/Loading.test.tsx.snap +++ b/src/components/Loading/__snapshots__/Loading.test.tsx.snap @@ -1,3 +1,3 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[` component should render the component in default state 1`] = `"
"`; +exports[` component should render the component in default state 1`] = `"
"`; diff --git a/src/components/Login/Login.tsx b/src/components/Login/Login.tsx index 0c3f8f4..66b4dc8 100644 --- a/src/components/Login/Login.tsx +++ b/src/components/Login/Login.tsx @@ -195,7 +195,7 @@ export default class LoginModal extends Component, Logi return ( should load the component in default state 1`] = `"

Login

"`; +exports[` should load the component in default state 1`] = `"

Login

"`; -exports[` should load the component with props 1`] = `"

Login

Error Title
Error Description
"`; +exports[` should load the component with props 1`] = `"

Login

Error Title
Error Description
"`; diff --git a/src/components/Logo/Logo.tsx b/src/components/Logo/Logo.tsx index 75c52ae..8a03b05 100644 --- a/src/components/Logo/Logo.tsx +++ b/src/components/Logo/Logo.tsx @@ -3,7 +3,11 @@ import React from 'react'; import styled from 'react-emotion'; import logo from './img/logo.svg'; -const StyledLogo = styled('div')` +interface Props { + md?: boolean; +} + +const StyledLogo = styled('div')` && { display: inline-block; vertical-align: middle; @@ -12,11 +16,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 ; + width: ${({ md }) => (md ? '90px' : '40px')}; + height: ${({ md }) => (md ? '90px' : '40px')}; +`; +const Logo: React.FC = ({ md = false }) => { + return ; }; export default Logo; From 0d00ab4490acbbe0203a59d888c06388a3a46d97 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20Herrera=20Guzm=C3=A1n?= Date: Wed, 10 Jul 2019 11:25:12 +0200 Subject: [PATCH 2/3] refactor: use an enum with Logo size --- src/components/Loading/Loading.tsx | 4 ++-- .../Login/__snapshots__/Login.test.tsx.snap | 2 +- src/components/Logo/Logo.tsx | 15 ++++++++++----- src/components/Logo/index.ts | 2 +- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/components/Loading/Loading.tsx b/src/components/Loading/Loading.tsx index b7877a3..8e32a4c 100644 --- a/src/components/Loading/Loading.tsx +++ b/src/components/Loading/Loading.tsx @@ -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 = () => ( - + diff --git a/src/components/Login/__snapshots__/Login.test.tsx.snap b/src/components/Login/__snapshots__/Login.test.tsx.snap index ac78a90..584c2ee 100644 --- a/src/components/Login/__snapshots__/Login.test.tsx.snap +++ b/src/components/Login/__snapshots__/Login.test.tsx.snap @@ -2,4 +2,4 @@ exports[` should load the component in default state 1`] = `"

Login

"`; -exports[` should load the component with props 1`] = `"

Login

Error Title
Error Description
"`; +exports[` should load the component with props 1`] = `"

Login

Error Title
Error Description
"`; diff --git a/src/components/Logo/Logo.tsx b/src/components/Logo/Logo.tsx index 8a03b05..b8abe82 100644 --- a/src/components/Logo/Logo.tsx +++ b/src/components/Logo/Logo.tsx @@ -3,8 +3,13 @@ import React from 'react'; import styled from 'react-emotion'; import logo from './img/logo.svg'; +export enum Size { + Small = '40px', + Big = '90px', +} + interface Props { - md?: boolean; + size?: Size; } const StyledLogo = styled('div')` @@ -16,11 +21,11 @@ const StyledLogo = styled('div')` background-size: contain; background-image: url(${logo}); background-repeat: no-repeat; - width: ${({ md }) => (md ? '90px' : '40px')}; - height: ${({ md }) => (md ? '90px' : '40px')}; + width: ${({ size }) => size}; + height: ${({ size }) => size}; `; -const Logo: React.FC = ({ md = false }) => { - return ; +const Logo: React.FC = ({ size = Size.Small }) => { + return ; }; export default Logo; diff --git a/src/components/Logo/index.ts b/src/components/Logo/index.ts index a5be778..de10cb2 100644 --- a/src/components/Logo/index.ts +++ b/src/components/Logo/index.ts @@ -1 +1 @@ -export { default } from './Logo'; +export { default, Size } from './Logo'; From c6c164de50554b8ce742f097eec10407d4e5f9eb Mon Sep 17 00:00:00 2001 From: "Juan Picado @jotadeveloper" Date: Wed, 10 Jul 2019 14:18:10 +0200 Subject: [PATCH 3/3] chore(release): 0.2.1 --- CHANGELOG.md | 29 +++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3ba4aa7..4fea2f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,35 @@ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +## [0.2.1](https://github.com/verdaccio/ui/compare/v0.2.0...v0.2.1) (2019-07-10) + + +### Bug Fixes + +* [@typescript-eslint](https://github.com/typescript-eslint)/explicit-function-return-type ([31c11f2](https://github.com/verdaccio/ui/commit/31c11f2)) +* [@typescript-eslint](https://github.com/typescript-eslint)/explicit-member-accessibility ([55f50e9](https://github.com/verdaccio/ui/commit/55f50e9)) +* [@typescript-eslint](https://github.com/typescript-eslint)/no-explicit-any ([2f28ade](https://github.com/verdaccio/ui/commit/2f28ade)) +* [@typescript-eslint](https://github.com/typescript-eslint)/no-explicit-any ([6eec4f4](https://github.com/verdaccio/ui/commit/6eec4f4)) +* [@typescript-eslint](https://github.com/typescript-eslint)/no-explicit-any ([ec8ed12](https://github.com/verdaccio/ui/commit/ec8ed12)) +* [@typescript-eslint](https://github.com/typescript-eslint)/no-explicit-any for file-size.ts ([b683b68](https://github.com/verdaccio/ui/commit/b683b68)) +* add missing global font-family ([c57f9dd](https://github.com/verdaccio/ui/commit/c57f9dd)) +* added packageMeta type ([3c54b11](https://github.com/verdaccio/ui/commit/3c54b11)) +* container breakpoint ([60b7161](https://github.com/verdaccio/ui/commit/60b7161)) +* incorrect logos styles ([fdad635](https://github.com/verdaccio/ui/commit/fdad635)), closes [#47](https://github.com/verdaccio/ui/issues/47) +* logo component styled ([210bcf3](https://github.com/verdaccio/ui/commit/210bcf3)) +* remove any types and added additional component state interfaces ([116055c](https://github.com/verdaccio/ui/commit/116055c)) +* remove token from AppState ([78b4c3f](https://github.com/verdaccio/ui/commit/78b4c3f)) +* remove undefined error ([d1ed3e7](https://github.com/verdaccio/ui/commit/d1ed3e7)) +* support deprecated license object properties ([b2e420d](https://github.com/verdaccio/ui/commit/b2e420d)) +* type lint for login ([91e603e](https://github.com/verdaccio/ui/commit/91e603e)) +* typescript warnings - prefer-rest-params ([e33570b](https://github.com/verdaccio/ui/commit/e33570b)) +* update snapshot for verdaccio/jsx-no-style ([e7d145f](https://github.com/verdaccio/ui/commit/e7d145f)) +* updated type to fix unit test ([7cab3f2](https://github.com/verdaccio/ui/commit/7cab3f2)) +* verdaccio/jsx-no-style ([55b1402](https://github.com/verdaccio/ui/commit/55b1402)) + + + # [0.2.0](https://github.com/verdaccio/ui/compare/v0.1.11...v0.2.0) (2019-06-20) diff --git a/package.json b/package.json index f953f66..d05c834 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@verdaccio/ui-theme", - "version": "0.2.0", + "version": "0.2.1", "description": "Verdaccio User Interface", "author": { "name": "Verdaccio Core Team"