From cadeee9ced3f328067e3d99e4de18274336539e0 Mon Sep 17 00:00:00 2001 From: Aaron Sutula Date: Tue, 5 Feb 2019 15:25:02 -0800 Subject: [PATCH] Add contact (#908) * WIP on new add contact screen * Wip on searching and displaying Textile contacts * Increase wait time for now * Render add contact search bar above list for now * Local contacts search integration * Mostly working Textile contact adding * Clean up log statements * WIP on MessageComposer * Working on invite * Move store link to .env * Clean up Button usage * Little clean up --- .env.example | 4 +- App/Components/Button.tsx | 29 +- App/Components/LargeButton.tsx | 39 ++ App/Components/ListItem.tsx | 17 +- App/Components/OnboardingMessage.tsx | 5 +- App/Components/ReferralCode.tsx | 9 +- App/Components/RowSeparator.tsx | 4 +- App/Components/SearchBar.tsx | 5 +- App/Components/SmallButton.tsx | 34 ++ App/Components/WaitListSignupScreen.tsx | 9 +- App/Containers/AddContact.tsx | 217 +++++++++ App/Containers/Contact.tsx | 17 +- App/Containers/Contacts.tsx | 32 +- App/Containers/Groups.tsx | 2 +- App/Containers/MailListSignupScreen.tsx | 9 +- App/Containers/OnboardingUsername.tsx | 9 +- App/Containers/SetAvatar.tsx | 9 +- App/NativeModules/MessageComposer/Api.ts | 7 + App/NativeModules/MessageComposer/index.ts | 1 + .../AppNavigation/Modal/AddContact/index.ts | 21 + App/Navigation/AppNavigation/Modal/index.ts | 2 + App/Redux/ContactsRedux.ts | 251 +++++++++- App/Sagas/Contacts/ContactsSagas.ts | 198 ++++++++ App/Sagas/Contacts/index.ts | 22 + App/Sagas/TextileSagas.ts | 15 - App/Sagas/index.ts | 7 +- App/Themes/Constants.ts | 14 + DEVELOPMENT.md | 2 + android/app/build.gradle | 1 + android/app/src/main/AndroidManifest.xml | 3 + .../java/com/textile/MainApplication.java | 2 + .../textile/textilenode/MessageComposer.java | 35 ++ .../textile/textilenode/TextilePackage.java | 1 + android/settings.gradle | 2 + ios/NativeModules/Events.m | 81 ---- ios/NativeModules/MessageComposer.h | 14 + ios/NativeModules/MessageComposer.m | 71 +++ ios/NativeModules/TextileNode.m | 442 ------------------ ios/Textile.xcodeproj/project.pbxproj | 44 ++ ios/Textile/Info.plist | 2 + package.json | 1 + yarn.lock | 4 + 42 files changed, 1074 insertions(+), 619 deletions(-) create mode 100644 App/Components/LargeButton.tsx create mode 100644 App/Components/SmallButton.tsx create mode 100644 App/Containers/AddContact.tsx create mode 100644 App/NativeModules/MessageComposer/Api.ts create mode 100644 App/NativeModules/MessageComposer/index.ts create mode 100644 App/Navigation/AppNavigation/Modal/AddContact/index.ts create mode 100644 App/Sagas/Contacts/ContactsSagas.ts create mode 100644 App/Sagas/Contacts/index.ts create mode 100644 android/app/src/main/java/com/textile/textilenode/MessageComposer.java delete mode 100644 ios/NativeModules/Events.m create mode 100644 ios/NativeModules/MessageComposer.h create mode 100644 ios/NativeModules/MessageComposer.m delete mode 100644 ios/NativeModules/TextileNode.m diff --git a/.env.example b/.env.example index 5de7870a3..46168483a 100644 --- a/.env.example +++ b/.env.example @@ -9,4 +9,6 @@ RN_MAILCHIMP_API_KEY="a-key" RN_MAILCHIMP_LIST_ID="a-list-id" RN_MAILCHIMP_WAITLIST_ID="a-list-id" RN_PEER_SWAP="https://" -RN_RELEASE_TYPE="dev" \ No newline at end of file +RN_RELEASE_TYPE="dev" +RN_IOS_STORE_LINK="https://" +RN_ANDROID_STORE_LINK="https://" \ No newline at end of file diff --git a/App/Components/Button.tsx b/App/Components/Button.tsx index 38d28922e..9efa6b332 100644 --- a/App/Components/Button.tsx +++ b/App/Components/Button.tsx @@ -1,12 +1,13 @@ -import React from 'react' +import React, { Component } from 'react' import { Text, TouchableOpacity, ViewStyle, TextStyle, ActivityIndicator } from 'react-native' +import RoundedCornersView from './RoundedCornersView' + const BUTTON: ViewStyle = { - backgroundColor: '#2625FF', - minWidth: 300, - paddingVertical: 18, - paddingHorizontal: 65, - borderRadius: 6 + backgroundColor: '#2625FF' + // minWidth: 300, + // paddingVertical: 18, + // paddingHorizontal: 65 } const BUTTON_TEXT: TextStyle = { @@ -33,13 +34,15 @@ const button = (props: Props) => { const { onPress, disabled, text, style, textStyle, processing } = props return ( - - {processing && - - } - {!processing && - {text} - } + + + {processing && + + } + {!processing && + {text} + } + ) } diff --git a/App/Components/LargeButton.tsx b/App/Components/LargeButton.tsx new file mode 100644 index 000000000..b7036653a --- /dev/null +++ b/App/Components/LargeButton.tsx @@ -0,0 +1,39 @@ +import React from 'react' +import { ViewStyle } from 'react-native' +import Button from './Button' +import * as s from '../Themes/Constants' + +interface Props { + text: string + style?: ViewStyle + disabled?: boolean + processing?: boolean + onPress?: () => void +} + +const button = (props: Props) => { + const { text, onPress, style, processing } = props + return ( +