From 9c9f34a0bde7eb53271331a2d6ccc12a5c25b5a8 Mon Sep 17 00:00:00 2001
From: Amaury Martiny
Date: Thu, 5 Jul 2018 13:50:16 +0200
Subject: [PATCH 1/3] Remove react-tooltip
---
packages/fether-react/package.json | 1 -
packages/fether-ui/package.json | 1 -
.../fether-ui/src/ClickToCopy/ClickToCopy.js | 41 +++++++------------
yarn.lock | 7 ----
4 files changed, 15 insertions(+), 35 deletions(-)
diff --git a/packages/fether-react/package.json b/packages/fether-react/package.json
index 6b68b0cb..112e5a7d 100644
--- a/packages/fether-react/package.json
+++ b/packages/fether-react/package.json
@@ -54,7 +54,6 @@
"react-markdown": "^3.3.4",
"react-router-dom": "^4.2.2",
"react-scripts": "1.1.4",
- "react-tooltip": "^3.6.1",
"recompose": "^0.27.1",
"rxjs": "^6.2.0"
},
diff --git a/packages/fether-ui/package.json b/packages/fether-ui/package.json
index 9d676770..54c8a4b8 100644
--- a/packages/fether-ui/package.json
+++ b/packages/fether-ui/package.json
@@ -33,7 +33,6 @@
"dependencies": {
"react-blockies": "^1.3.0",
"react-content-loader": "^3.1.2",
- "react-tooltip": "^3.6.1",
"semantic-ui-css": "^2.3.2",
"semantic-ui-react": "^0.81.3"
},
diff --git a/packages/fether-ui/src/ClickToCopy/ClickToCopy.js b/packages/fether-ui/src/ClickToCopy/ClickToCopy.js
index ceb3180a..dad28243 100644
--- a/packages/fether-ui/src/ClickToCopy/ClickToCopy.js
+++ b/packages/fether-ui/src/ClickToCopy/ClickToCopy.js
@@ -4,8 +4,9 @@
// SPDX-License-Identifier: BSD-3-Clause
import React, { PureComponent } from 'react';
+import { Popup } from 'semantic-ui-react';
import PropTypes from 'prop-types';
-import ReactTooltip from 'react-tooltip';
+import 'semantic-ui-css/components/popup.min.css';
export class ClickToCopy extends PureComponent {
static defaultProps = {
@@ -21,10 +22,6 @@ export class ClickToCopy extends PureComponent {
copied: false
};
- componentWillUnmount () {
- window.clearTimeout(this.timeout);
- }
-
handleCopy = () => {
// https://hackernoon.com/copying-text-to-clipboard-with-javascript-df4d4988697f
// Note react-copy-to-clipboard created a bug, https://github.com/nkbt/react-copy-to-clipboard/issues/92
@@ -36,35 +33,27 @@ export class ClickToCopy extends PureComponent {
document.body.removeChild(el);
this.setState({ copied: true });
-
- // Show the copied state only for 1s
- if (this.timeout) {
- window.clearTimeout(this.timeout);
- }
- this.timeout = window.setTimeout(
- () => this.setState({ copied: false }),
- 1000
- );
};
- handleResetCopied = () => {};
+ handleResetCopied = () => this.setState({ copied: false });
render () {
const { children, label, ...otherProps } = this.props;
const { copied } = this.state;
return (
-
- {children}
- (copied ? 'Copied.' : label), 50]}
- {...otherProps}
- />
-
+
+ {children}
+
+ }
+ />
);
}
}
diff --git a/yarn.lock b/yarn.lock
index b8d3e188..b61f7ff4 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -9667,13 +9667,6 @@ react-scripts@1.1.4:
optionalDependencies:
fsevents "^1.1.3"
-react-tooltip@^3.6.1:
- version "3.6.1"
- resolved "https://registry.yarnpkg.com/react-tooltip/-/react-tooltip-3.6.1.tgz#2ca993baa50d7e0271b8d13c6024445a883842eb"
- dependencies:
- classnames "^2.2.5"
- prop-types "^15.6.0"
-
react@^16.3.2, react@^16.4.0:
version "16.4.1"
resolved "https://registry.yarnpkg.com/react/-/react-16.4.1.tgz#de51ba5764b5dbcd1f9079037b862bd26b82fe32"
--
GitLab
From aca779734d24ed9b2c01049d77d386cff82aee8e Mon Sep 17 00:00:00 2001
From: Amaury Martiny
Date: Thu, 5 Jul 2018 14:20:06 +0200
Subject: [PATCH 2/3] Remove componentDidCatch
---
packages/fether-react/src/App/App.js | 7 -------
1 file changed, 7 deletions(-)
diff --git a/packages/fether-react/src/App/App.js b/packages/fether-react/src/App/App.js
index a624480f..fc8a44f5 100644
--- a/packages/fether-react/src/App/App.js
+++ b/packages/fether-react/src/App/App.js
@@ -29,13 +29,6 @@ const Router =
@inject('healthStore', 'onboardingStore')
@observer
class App extends Component {
- componentDidCatch () {
- if (process.env.NODE_ENV !== 'development') {
- // Redirect to '/' on errors
- window.location.href = '/';
- }
- }
-
render () {
return (
--
GitLab
From ef9c645ea24bf83d0db885c77495e3eebdffc6c8 Mon Sep 17 00:00:00 2001
From: Amaury Martiny
Date: Thu, 5 Jul 2018 14:20:36 +0200
Subject: [PATCH 3/3] Use FetherForm on account creation
---
.../CreateAccount/AccountName/AccountName.js | 4 ++--
.../AccountPassword/AccountPassword.js | 6 +++---
.../AccountRewritePhrase/AccountRewritePhrase.js | 11 ++++++-----
.../fether-react/src/Onboarding/Onboarding.js | 15 ++++++---------
.../src/assets/sass/components/_account.scss | 1 +
.../fether-react/src/stores/sendStore.spec.js | 15 ++++++---------
.../fether-ui/src/AccountCard/Address/Address.js | 2 +-
packages/fether-ui/src/ClickToCopy/ClickToCopy.js | 2 +-
packages/fether-ui/src/Form/Field/Field.js | 4 +++-
9 files changed, 29 insertions(+), 31 deletions(-)
diff --git a/packages/fether-react/src/Accounts/CreateAccount/AccountName/AccountName.js b/packages/fether-react/src/Accounts/CreateAccount/AccountName/AccountName.js
index 1659aee9..39385988 100644
--- a/packages/fether-react/src/Accounts/CreateAccount/AccountName/AccountName.js
+++ b/packages/fether-react/src/Accounts/CreateAccount/AccountName/AccountName.js
@@ -4,7 +4,7 @@
// SPDX-License-Identifier: BSD-3-Clause
import React, { Component } from 'react';
-import { AccountCard, Card, FormField } from 'fether-ui';
+import { AccountCard, Card, Form as FetherForm } from 'fether-ui';
import Blockies from 'react-blockies';
import { inject, observer } from 'mobx-react';
import { Link } from 'react-router-dom';
@@ -79,7 +79,7 @@ class AccountName extends Component {
Please give this account a name:
- Secure your account with a password:
-
-
)}
-
- }
+