From df6e2cb070bfb3a6ee736a3b99ce688dbc6e8481 Mon Sep 17 00:00:00 2001 From: Tom Kirkpatrick Date: Tue, 30 Oct 2018 08:50:09 +0100 Subject: [PATCH] chore(deps): update react and react components --- app/components/GlobalError/GlobalError.js | 38 +- app/components/LoadingBolt/LoadingBolt.js | 44 ++- app/components/UI/Notification.js | 1 + package.json | 46 +-- .../UI/__snapshots__/Menu.spec.js.snap | 2 - .../__snapshots__/Notification.spec.js.snap | 1 + yarn.lock | 367 ++++++++++-------- 7 files changed, 278 insertions(+), 221 deletions(-) diff --git a/app/components/GlobalError/GlobalError.js b/app/components/GlobalError/GlobalError.js index 33656853..185d9eac 100644 --- a/app/components/GlobalError/GlobalError.js +++ b/app/components/GlobalError/GlobalError.js @@ -1,11 +1,16 @@ import React from 'react' import PropTypes from 'prop-types' -import { Transition, animated } from 'react-spring' +import { animated, Transition } from 'react-spring' +import { Box } from 'rebass' import errorToUserFriendly from 'lib/utils/userFriendlyErrors' import Notification from 'components/UI/Notification' -import { Box } from 'rebass' class GlobalError extends React.Component { + static propTypes = { + error: PropTypes.string, + clearError: PropTypes.func.isRequired + } + componentDidUpdate(prevProps) { const { clearError, error } = this.props if (!prevProps.error && error) { @@ -17,33 +22,28 @@ class GlobalError extends React.Component { const { error, clearError } = this.props return ( - - {error && + + {show => + show && (springStyles => ( - + {errorToUserFriendly(error)} - ))} + )) + } ) } } -GlobalError.propTypes = { - error: PropTypes.string, - clearError: PropTypes.func.isRequired -} - export default GlobalError diff --git a/app/components/LoadingBolt/LoadingBolt.js b/app/components/LoadingBolt/LoadingBolt.js index 3c8503f7..672237a8 100644 --- a/app/components/LoadingBolt/LoadingBolt.js +++ b/app/components/LoadingBolt/LoadingBolt.js @@ -1,38 +1,42 @@ import React from 'react' import PropTypes from 'prop-types' -import { Transition, animated } from 'react-spring' +import { animated, Transition } from 'react-spring' import CloudLightning from 'components/Icon/CloudLightning' - import { FormattedMessage } from 'react-intl' import messages from './messages' - import styles from './LoadingBolt.scss' -class LoadingBolt extends React.Component { +class LoadingBolt extends React.PureComponent { static propTypes = { isLoading: PropTypes.bool.isRequired, theme: PropTypes.object.isRequired } render() { - const { theme, isLoading = true } = this.props + const { theme, isLoading } = this.props return ( -
- - {isLoading && - (springStyles => ( - -
- -

- -

-
-
- ))} -
-
+ + {show => + show && + (springStyles => ( + +
+ +

+ +

+
+
+ )) + } +
) } } diff --git a/app/components/UI/Notification.js b/app/components/UI/Notification.js index fb098c01..35130e5e 100644 --- a/app/components/UI/Notification.js +++ b/app/components/UI/Notification.js @@ -50,6 +50,7 @@ class Notification extends React.Component { px={3} py={3} borderRadius="5px" + boxShadow="0 3px 4px 0 rgba(30, 30, 30, 0.5)" css={{ cursor: 'pointer' }} {...this.props} onMouseEnter={this.hoverOn} diff --git a/package.json b/package.json index bbeb581e..67e4696f 100644 --- a/package.json +++ b/package.json @@ -211,17 +211,17 @@ "@babel/register": "^7.0.0", "@commitlint/cli": "^7.2.1", "@commitlint/config-conventional": "^7.1.2", - "@storybook/addon-actions": "^4.0.0", + "@storybook/addon-actions": "^4.0.2", "@storybook/addon-console": "^1.1.0", - "@storybook/addon-info": "^4.0.0", - "@storybook/addon-knobs": "^4.0.0", - "@storybook/addon-links": "^4.0.0", - "@storybook/addon-options": "^4.0.0", - "@storybook/addon-storysource": "^4.0.0", - "@storybook/addons": "^4.0.0", - "@storybook/components": "^4.0.0", - "@storybook/react": "^4.0.0", - "add-asset-html-webpack-plugin": "^3.0.1", + "@storybook/addon-info": "^4.0.2", + "@storybook/addon-knobs": "^4.0.2", + "@storybook/addon-links": "^4.0.2", + "@storybook/addon-options": "^4.0.2", + "@storybook/addon-storysource": "^4.0.2", + "@storybook/addons": "^4.0.2", + "@storybook/components": "^4.0.2", + "@storybook/react": "^4.0.2", + "add-asset-html-webpack-plugin": "^3.1.2", "babel-core": "^7.0.0-bridge.0", "babel-eslint": "^10.0.1", "babel-jest": "^23.6.0", @@ -234,7 +234,7 @@ "chalk": "^2.4.1", "clean-webpack-plugin": "^0.1.19", "concurrently": "^4.0.1", - "copy-webpack-plugin": "^4.5.4", + "copy-webpack-plugin": "^4.6.0", "coveralls": "^3.0.2", "cross-env": "^5.2.0", "cross-spawn": "^6.0.5", @@ -272,8 +272,8 @@ "identity-obj-proxy": "^3.0.0", "jest": "^23.6.0", "jest-styled-components": "^6.2.2", - "jsdom": "^12.2.0", - "lint-staged": "^8.0.3", + "jsdom": "^13.0.0", + "lint-staged": "^8.0.4", "lnd-binary": "^0.3.7", "mini-css-extract-plugin": "^0.4.4", "minimist": "^1.2.0", @@ -281,7 +281,7 @@ "node-sass": "^4.9.3", "prettier": "^1.14.3", "react-storybook-addon-chapters": "^2.1.8", - "react-test-renderer": "^16.5.2", + "react-test-renderer": "^16.6.0", "redux-logger": "^3.0.6", "rimraf": "^2.6.2", "sass-loader": "^7.1.0", @@ -315,8 +315,8 @@ "debug": "^4.1.0", "debug-logger": "^0.4.1", "dexie": "^2.0.4", - "downshift": "^3.1.0", - "electron": "^3.0.6", + "downshift": "^3.1.4", + "electron": "^3.0.7", "electron-is-dev": "^1.0.1", "font-awesome": "^4.7.0", "get-port": "^4.0.0", @@ -329,16 +329,16 @@ "lodash.pick": "^4.4.0", "prop-types": "^15.6.2", "qrcode.react": "0.8.0", - "rc-menu": "^7.4.15", - "react": "^16.5.2", - "react-dom": "^16.5.2", + "rc-menu": "^7.4.18", + "react": "^16.6.0", + "react-dom": "^16.6.0", "react-hot-loader": "^4.3.11", - "react-intl": "^2.7.1", + "react-intl": "^2.7.2", "react-intl-redux": "^2.0.2", - "react-redux": "^5.0.7", + "react-redux": "^5.1.0", "react-router-dom": "^4.3.1", "react-router-redux": "^5.0.0-alpha.9", - "react-spring": "^5.9.2", + "react-spring": "^6.1.5", "rebass": "^3.0.0-9", "redux": "^4.0.0", "redux-electron-ipc": "^1.1.13", @@ -347,7 +347,7 @@ "satoshi-bitcoin": "^1.0.4", "source-map-support": "^0.5.9", "split2": "^3.0.0", - "styled-components": "^4.0.0-beta.10", + "styled-components": "^4.0.3", "styled-system-html": "^2.0.2", "tildify": "^1.2.0", "untildify": "^3.0.3", diff --git a/test/unit/components/UI/__snapshots__/Menu.spec.js.snap b/test/unit/components/UI/__snapshots__/Menu.spec.js.snap index dbd10e94..8695d66a 100644 --- a/test/unit/components/UI/__snapshots__/Menu.spec.js.snap +++ b/test/unit/components/UI/__snapshots__/Menu.spec.js.snap @@ -51,7 +51,6 @@ exports[`component.UI.Menu should render correctly 1`] = ` >
My Items @@ -100,7 +99,6 @@ exports[`component.UI.Menu should render correctly 1`] = ` >
Other items diff --git a/test/unit/components/UI/__snapshots__/Notification.spec.js.snap b/test/unit/components/UI/__snapshots__/Notification.spec.js.snap index 5fd4909c..0c8ddb42 100644 --- a/test/unit/components/UI/__snapshots__/Notification.spec.js.snap +++ b/test/unit/components/UI/__snapshots__/Notification.spec.js.snap @@ -30,6 +30,7 @@ exports[`component.UI.Notification should render correctly 1`] = ` padding-bottom: 16px; cursor: pointer; border-radius: 5px; + box-shadow: 0 3px 4px 0 rgba(30,30,30,0.5); }
= 1" css-to-react-native "^2.2.2" memoize-one "^4.0.0" prop-types "^15.5.4" - react-is "^16.3.1" + react-is "^16.6.0" stylis "^3.5.0" stylis-rule-sheet "^0.0.10" + supports-color "^5.5.0" styled-system-html@^2.0.2: version "2.0.2" @@ -16430,6 +16474,15 @@ w3c-hr-time@^1.0.1: dependencies: browser-process-hrtime "^0.1.2" +w3c-xmlserializer@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/w3c-xmlserializer/-/w3c-xmlserializer-1.0.0.tgz#d23e20de595b892056f20a359fc2622908d48695" + integrity sha512-0et1+9uXYiIRAecx1D5Z1nk60+vimniGdIKl4XjeqkWi6acoHNlXMv1VR5jV+jF4ooeO08oWbYxeAJOcon1oMA== + dependencies: + domexception "^1.0.1" + webidl-conversions "^4.0.2" + xml-name-validator "^3.0.0" + walker@~1.0.5: version "1.0.7" resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.7.tgz#2f7f9b8fd10d677262b18a884e28d19618e028fb"