From 9617ab7753332769556b683c822807a2ea6bed78 Mon Sep 17 00:00:00 2001 From: Thibaut Date: Tue, 26 Feb 2019 15:58:02 +0100 Subject: [PATCH 1/7] fix(): account menu --- ios/NativeSigner.xcodeproj/project.pbxproj | 1 - package-lock.json | 13 ++-- package.json | 1 + src/App.js | 10 ++- src/screens/AccountList.js | 80 ++++++++++++++++++---- 5 files changed, 79 insertions(+), 26 deletions(-) diff --git a/ios/NativeSigner.xcodeproj/project.pbxproj b/ios/NativeSigner.xcodeproj/project.pbxproj index a39c0a312e..de4904455b 100644 --- a/ios/NativeSigner.xcodeproj/project.pbxproj +++ b/ios/NativeSigner.xcodeproj/project.pbxproj @@ -5,7 +5,6 @@ }; objectVersion = 46; objects = { - /* Begin PBXBuildFile section */ 00C302E91ABCBA2D00DB3ED1 /* libRCTNetwork.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302DC1ABCB9D200DB3ED1 /* libRCTNetwork.a */; }; 00C302EA1ABCBA2D00DB3ED1 /* libRCTVibration.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 00C302E41ABCB9EE00DB3ED1 /* libRCTVibration.a */; }; diff --git a/package-lock.json b/package-lock.json index 0b6b3bacce..5edf198f42 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12970,6 +12970,11 @@ "react-native-fit-image": "^1.5.2" } }, + "react-native-popup-menu": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/react-native-popup-menu/-/react-native-popup-menu-0.15.0.tgz", + "integrity": "sha512-iJIzVNq46oCxKQVFw+4ceNwYDfbvbtn8nchSOluVB3NlPZKLCOZ+0u1KzA0fyxPtQdLf2yFbbVPi/A8XbP0eOg==" + }, "react-native-qrcode": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/react-native-qrcode/-/react-native-qrcode-0.2.7.tgz", @@ -13093,11 +13098,6 @@ "ansi-regex": "^3.0.0" } }, - "strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" - }, "yargs": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/yargs/-/yargs-8.0.2.tgz", @@ -14973,8 +14973,7 @@ "strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", - "dev": true + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" }, "strip-eof": { "version": "1.0.0", diff --git a/package.json b/package.json index 15fa11bee0..4ebf2ae18f 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "react-native-camera": "^1.9.0", "react-native-keyboard-aware-scroll-view": "^0.5.0", "react-native-markdown-renderer": "^3.2.8", + "react-native-popup-menu": "^0.15.0", "react-native-qrcode": "^0.2.7", "react-native-secure-storage": "https://github.com/debris/react-native-secure-storage", "react-native-simple-picker": "^2.1.0", diff --git a/src/App.js b/src/App.js index 93cb8a240e..9b30dda081 100644 --- a/src/App.js +++ b/src/App.js @@ -25,6 +25,8 @@ import { withNavigation } from 'react-navigation'; import { Provider as UnstatedProvider } from 'unstated'; +import { MenuProvider } from 'react-native-popup-menu'; + import '../ReactotronConfig'; import colors from './colors'; import Background from './components/Background'; @@ -55,9 +57,11 @@ export default class App extends Component { render() { return ( - - - + + + + + ); } diff --git a/src/screens/AccountList.js b/src/screens/AccountList.js index 99fd4a846a..bd720a82a6 100644 --- a/src/screens/AccountList.js +++ b/src/screens/AccountList.js @@ -20,6 +20,14 @@ import PropTypes from 'prop-types'; import React from 'react'; import { FlatList, StyleSheet, Text, View } from 'react-native'; import { Subscribe } from 'unstated'; +import { + Menu, + MenuOptions, + MenuOption, + MenuTrigger, +} from 'react-native-popup-menu'; +import Icon from 'react-native-vector-icons/MaterialIcons'; + import colors from '../colors'; import AccountCard from '../components/AccountCard'; import Background from '../components/Background'; @@ -31,6 +39,7 @@ export default class AccountList extends React.PureComponent { static navigationOptions = { title: 'Accounts' }; + render() { return ( @@ -86,11 +95,33 @@ class AccountListView extends React.PureComponent { this.scrollToIndex(); } + AccountMenu = () => { + const addIcon = + + return ( + + this.props.navigation.navigate(value)} + > + + + + + + + + + ) + }; + render() { return ( - ACCOUNTS + + ACCOUNTS + {this.AccountMenu()} + { this.list = list; @@ -115,11 +146,6 @@ class AccountListView extends React.PureComponent { enableEmptySections /> -