Skip to content

Commit

Permalink
Small fixes (#184)
Browse files Browse the repository at this point in the history
* Small InlineMessage fixes

* Dont apply margin to body inside InlineMessage

* Fix Snyk

* Add missing font

* Bump version
  • Loading branch information
FrederikBolding authored Jan 19, 2022
1 parent b4dcbff commit 1966d64
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mycrypto/ui",
"version": "1.10.1",
"version": "1.10.2",
"description": "The shared UI component library used across all MyCrypto products.",
"repository": "MyCryptoHQ/ui",
"keywords": [
Expand Down
12 changes: 6 additions & 6 deletions src/molecules/InlineMessage.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import type { FunctionComponent } from 'react';
import type { DefaultTheme } from 'styled-components';
import type { SpaceProps } from 'styled-system';

import type { IconType } from '../atoms';
import type { IconType, TextProps } from '../atoms';
import { Body, Flex, Icon } from '../atoms';
import { omitMarginProps } from '../utils';

export type InlineMessageType = keyof DefaultTheme['colors']['banner'];

export interface InlineMessageProps extends SpaceProps {
export interface InlineMessageProps {
type: InlineMessageType;
}

Expand All @@ -19,14 +19,14 @@ const icons: { [key in InlineMessageType]: IconType } = {
error: 'alert'
};

export const InlineMessage: FunctionComponent<InlineMessageProps> = ({
export const InlineMessage: FunctionComponent<InlineMessageProps & TextProps> = ({
type,
children,
...props
}) => (
<Flex display="inline-flex" {...props}>
<Icon type={icons[type]} fill={`banner.${type}`} mr="1" />
<Body color={`banner.${type}`} as="span" verticalAlign="middle" {...props}>
<Icon type={icons[type]} fill={`banner.${type}`} mr="1" minWidth="15px" />
<Body color={`banner.${type}`} as="span" verticalAlign="middle" {...omitMarginProps(props)}>
{children}
</Body>
</Flex>
Expand Down
2 changes: 2 additions & 0 deletions src/theme.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export const theme = {
boxShadow: 'input',
borderRadius: 'input',
input: {
fontFamily: 'body',
color: 'text.primary',
background: 'white',
'&:focus': {
Expand All @@ -384,6 +385,7 @@ export const theme = {
},
simple: {
input: {
fontFamily: 'body',
backgroundColor: 'background.muted',
borderRadius: '4px',
padding: '15px 18px',
Expand Down
26 changes: 23 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10341,9 +10341,11 @@ node-fetch@^1.0.1:
is-stream "^1.0.1"

node-fetch@^2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
version "2.6.7"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.7.tgz#24de9fba827e3b4ae44dc8b20256a379160052ad"
integrity sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==
dependencies:
whatwg-url "^5.0.0"

node-int64@^0.4.0:
version "0.4.0"
Expand Down Expand Up @@ -13473,6 +13475,11 @@ tr46@^2.0.2:
dependencies:
punycode "^2.1.1"

tr46@~0.0.3:
version "0.0.3"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
integrity sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=

trim-right@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
Expand Down Expand Up @@ -14061,6 +14068,11 @@ web-namespaces@^1.0.0:
resolved "https://registry.yarnpkg.com/web-namespaces/-/web-namespaces-1.1.4.tgz#bc98a3de60dadd7faefc403d1076d529f5e030ec"
integrity sha512-wYxSGajtmoP4WxfejAPIr4l0fVh+jeMXZb08wNc0tMg6xsfZXj3cECqIK0G7ZAqUq0PP8WlMDtaOGVBTAWztNw==

webidl-conversions@^3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
integrity sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=

webidl-conversions@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-5.0.0.tgz#ae59c8a00b121543a2acc65c0434f57b0fc11aff"
Expand Down Expand Up @@ -14220,6 +14232,14 @@ whatwg-mimetype@^2.3.0:
resolved "https://registry.yarnpkg.com/whatwg-mimetype/-/whatwg-mimetype-2.3.0.tgz#3d4b1e0312d2079879f826aff18dbeeca5960fbf"
integrity sha512-M4yMwr6mAnQz76TbJm914+gPpB/nCwvZbJU28cUD6dR004SAxDLOOSUaB1JDRqLtaOV/vi0IC5lEAGFgrjGv/g==

whatwg-url@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-5.0.0.tgz#966454e8765462e37644d3626f6742ce8b70965d"
integrity sha1-lmRU6HZUYuN2RNNib2dCzotwll0=
dependencies:
tr46 "~0.0.3"
webidl-conversions "^3.0.0"

whatwg-url@^8.0.0, whatwg-url@^8.5.0:
version "8.5.0"
resolved "https://registry.yarnpkg.com/whatwg-url/-/whatwg-url-8.5.0.tgz#7752b8464fc0903fec89aa9846fc9efe07351fd3"
Expand Down

0 comments on commit 1966d64

Please sign in to comment.