From 732274aba22db3443dd6b74cf9e7f76be498804d Mon Sep 17 00:00:00 2001 From: Godefroy Ponsinet Date: Fri, 21 Sep 2018 10:25:00 +0200 Subject: [PATCH] fix(rn): bas64 Signed-off-by: Godefroy Ponsinet --- .../Screens/Contacts/Add/ByPublicKey.js | 25 ++++++------------- client/react-native/package.json | 1 + client/react-native/yarn.lock | 10 ++++++++ 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/client/react-native/common/components/Screens/Contacts/Add/ByPublicKey.js b/client/react-native/common/components/Screens/Contacts/Add/ByPublicKey.js index 1d1992b138..170148c1ba 100644 --- a/client/react-native/common/components/Screens/Contacts/Add/ByPublicKey.js +++ b/client/react-native/common/components/Screens/Contacts/Add/ByPublicKey.js @@ -12,29 +12,19 @@ import { } from '../../../../styles' import { mutations } from '../../../../graphql' import createTabNavigator from 'react-navigation-deprecated-tab-navigator/src/createTabNavigator' +import { btoa } from 'b64-lite' class TextInputMultilineFix extends PureComponent { state = { - multiline: true, + multiline: false, + } + + componentDidMount () { + this.setState({ multiline: this.props.multiline }) } render () { - return ( - - this.setState({ multiline: false }, () => - this.setState({ multiline: true }) - ) - } - onBlur={() => - this.setState({ multiline: false }, () => - this.setState({ multiline: true }) - ) - } - multiline={this.state.multiline} - {...this.props} - /> - ) + return } } @@ -68,6 +58,7 @@ class ByPublicKey extends PureComponent { marginTop, rounded, ]} + multiline placeholder='Type or copy/paste a berty user public key here' value={routeName === 'Enter a public key' ? contactID : myID} onChangeText={ diff --git a/client/react-native/package.json b/client/react-native/package.json index 86e59e2f74..893863af17 100644 --- a/client/react-native/package.json +++ b/client/react-native/package.json @@ -3,6 +3,7 @@ "version": "0.0.1", "description": "Berty's react native", "dependencies": { + "b64-lite": "^1.3.1", "graphql": "^0.13.2", "graphql-relay": "^0.5.5", "isomorphic-fetch": "^2.2.1", diff --git a/client/react-native/yarn.lock b/client/react-native/yarn.lock index 590ee2f89c..46ece64e7a 100644 --- a/client/react-native/yarn.lock +++ b/client/react-native/yarn.lock @@ -834,6 +834,12 @@ axobject-query@^2.0.1: dependencies: ast-types-flow "0.0.7" +b64-lite@^1.3.1: + version "1.3.1" + resolved "https://registry.yarnpkg.com/b64-lite/-/b64-lite-1.3.1.tgz#708430847ceb458148c4461ae633d6e15f53b360" + dependencies: + base-64 "^0.1.0" + babel-code-frame@^6.22.0, babel-code-frame@^6.26.0: version "6.26.0" resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b" @@ -1757,6 +1763,10 @@ balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" +base-64@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/base-64/-/base-64-0.1.0.tgz#780a99c84e7d600260361511c4877613bf24f6bb" + base64-js@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.8.tgz#1101e9544f4a76b1bc3b26d452ca96d7a35e7978"