From cdebb4c312a9e997b9b135dfe85802c698604a95 Mon Sep 17 00:00:00 2001 From: alwxndr Date: Fri, 16 Sep 2016 18:30:19 +0300 Subject: [PATCH] fixes to make registration work on iOS (#232), other iOS fixes --- .flowconfig | 23 ++- .re-natal | 5 +- .../java/com/statusim/MainApplication.java | 3 +- ios/StatusIm.xcodeproj/project.pbxproj | 76 +++++++++- .../xcshareddata/xcschemes/StatusIm.xcscheme | 11 +- .../AppIcon.appiconset/Contents.json | 10 ++ ios/StatusIm/Info.plist | 135 ++++++++++-------- .../ios/RCTStatus/RCTStatus.m | 7 +- package.json | 25 ++-- postinstall.sh | 2 + src/status_im/accounts/login/screen.cljs | 46 +++--- src/status_im/accounts/login/styles.cljs | 8 +- src/status_im/accounts/recover/screen.cljs | 34 ++--- src/status_im/accounts/recover/styles.cljs | 3 +- src/status_im/accounts/screen.cljs | 3 +- src/status_im/accounts/styles.cljs | 3 +- src/status_im/android/core.cljs | 1 - src/status_im/android/platform.cljs | 18 ++- src/status_im/chat/handlers.cljs | 4 +- src/status_im/chat/sign_up.cljs | 2 +- .../chat/styles/command_validation.cljs | 5 +- .../chat/styles/content_suggestions.cljs | 5 +- src/status_im/chat/styles/input.cljs | 17 +-- src/status_im/chat/styles/plain_message.cljs | 4 +- src/status_im/chat/styles/response.cljs | 13 +- src/status_im/chat/styles/screen.cljs | 12 +- src/status_im/chat/styles/suggestions.cljs | 16 +-- src/status_im/chat/suggestions.cljs | 2 +- src/status_im/chat/views/actions.cljs | 3 +- src/status_im/chat/views/message_input.cljs | 21 +-- src/status_im/chat/views/new_message.cljs | 6 +- src/status_im/chat/views/request_message.cljs | 7 +- src/status_im/chat/views/response.cljs | 19 +-- src/status_im/chat/views/suggestions.cljs | 4 +- src/status_im/chats_list/screen.cljs | 24 ++-- src/status_im/chats_list/styles.cljs | 13 +- .../chats_list/views/chat_list_item.cljs | 1 - src/status_im/commands/handlers/jail.cljs | 4 +- src/status_im/commands/handlers/loading.cljs | 4 +- src/status_im/components/carousel/styles.cljs | 18 ++- .../components/chat_icon/styles.cljs | 8 +- src/status_im/components/drawer/styles.cljs | 3 +- src/status_im/components/drawer/view.cljs | 11 +- src/status_im/components/main_tabs.cljs | 2 +- src/status_im/components/react.cljs | 13 +- src/status_im/components/styles.cljs | 7 - .../components/tabs/bottom_gradient.cljs | 7 +- src/status_im/components/tabs/styles.cljs | 10 +- .../components/text_field/styles.cljs | 51 +++---- src/status_im/components/text_field/view.cljs | 102 ++++++------- src/status_im/contacts/screen.cljs | 20 ++- src/status_im/contacts/styles.cljs | 11 +- src/status_im/contacts/views/new_contact.cljs | 18 +-- src/status_im/discovery/screen.cljs | 21 ++- .../group_settings/styles/group_settings.cljs | 36 ++--- src/status_im/handlers/server.cljs | 2 +- src/status_im/ios/core.cljs | 5 +- src/status_im/ios/platform.cljs | 11 +- src/status_im/navigation/handlers.cljs | 2 +- src/status_im/new_group/styles.cljs | 16 +-- src/status_im/profile/handlers.cljs | 6 +- .../profile/photo_capture/screen.cljs | 1 + src/status_im/profile/styles.cljs | 9 +- src/status_im/transactions/screen.cljs | 18 +-- src/status_im/transactions/styles.cljs | 3 +- src/status_im/utils/image_processing.cljs | 2 +- src/status_im/utils/utils.cljs | 17 ++- 67 files changed, 540 insertions(+), 489 deletions(-) diff --git a/.flowconfig b/.flowconfig index e28e2f5bd5..b69d071bc2 100644 --- a/.flowconfig +++ b/.flowconfig @@ -9,6 +9,21 @@ # Ignore malformed json .*/node_modules/y18n/test/.*\.json +# Ignore the website subdir +/website/.* + +# Ignore BUCK generated dirs +/\.buckd/ + +# Ignore unexpected extra @providesModule +.*/node_modules/commoner/test/source/widget/share.js + +# Ignore duplicate module providers +# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root +.*/Libraries/react-native/React.js +.*/Libraries/react-native/ReactNative.js +.*/node_modules/jest-runtime/build/__tests__/.* + [include] [libs] @@ -33,9 +48,11 @@ suppress_type=$FlowIssue suppress_type=$FlowFixMe suppress_type=$FixMe -suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) -suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-7]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ +suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(30\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) +suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(30\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy +unsafe.enable_getters_and_setters=true + [version] -^0.27.0 +^0.30.0 diff --git a/.re-natal b/.re-natal index f91fe6bc29..fe8f3fd066 100644 --- a/.re-natal +++ b/.re-natal @@ -26,7 +26,8 @@ "react-native-dialogs", "react-native-image-resizer", "react-native-image-crop-picker", - "react-native-webview-bridge" + "react-native-webview-bridge", + "react-native-drawer-layout" ], "imageDirs": [ "images" @@ -36,4 +37,4 @@ "dev": "env/dev", "prod": "env/prod" } -} +} \ No newline at end of file diff --git a/android/app/src/main/java/com/statusim/MainApplication.java b/android/app/src/main/java/com/statusim/MainApplication.java index 3d7bec0251..c6b9b9078b 100644 --- a/android/app/src/main/java/com/statusim/MainApplication.java +++ b/android/app/src/main/java/com/statusim/MainApplication.java @@ -20,7 +20,7 @@ import com.github.yamill.orientation.OrientationPackage; import com.rnfs.RNFSPackage; import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage; import fr.bamlab.rnimageresizer.ImageResizerPackage; -import com.reactnative.picker.PickerPackage; +import com.reactnative.ivpusic.imagepicker.PickerPackage; import com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage; import java.util.Arrays; @@ -53,7 +53,6 @@ public class MainApplication extends Application implements ReactApplication { new ImageResizerPackage(), new PickerPackage(), new WebViewBridgePackage() - ); } }; diff --git a/ios/StatusIm.xcodeproj/project.pbxproj b/ios/StatusIm.xcodeproj/project.pbxproj index 6d43fd4442..ee36cbb77a 100644 --- a/ios/StatusIm.xcodeproj/project.pbxproj +++ b/ios/StatusIm.xcodeproj/project.pbxproj @@ -26,7 +26,12 @@ 2028DFFA1D4275B600227DCD /* SF-UI-Display-Regular.otf in Resources */ = {isa = PBXBuildFile; fileRef = 2028DFF61D4275B600227DCD /* SF-UI-Display-Regular.otf */; }; 2028DFFB1D4275B600227DCD /* SF-UI-Display-Semibold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 2028DFF71D4275B600227DCD /* SF-UI-Display-Semibold.otf */; }; 2028DFFC1D4275B600227DCD /* SF-UI-Display-Thin.otf in Resources */ = {isa = PBXBuildFile; fileRef = 2028DFF81D4275B600227DCD /* SF-UI-Display-Thin.otf */; }; + 20A5C9711D9283A2002C4965 /* libimageCropPicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 20A5C9531D927137002C4965 /* libimageCropPicker.a */; }; 20AB9EC61D47CC0300E7FD9C /* libRCTStatus.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 201067C41D4789F700FA83B6 /* libRCTStatus.a */; }; + 20B6B6841D92C42600CC5C6A /* RSKImageCropper.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20B6B6831D92C42600CC5C6A /* RSKImageCropper.framework */; }; + 20B6B6851D92C42600CC5C6A /* RSKImageCropper.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 20B6B6831D92C42600CC5C6A /* RSKImageCropper.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 20B6B6871D92C42600CC5C6A /* QBImagePicker.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 20B6B6861D92C42600CC5C6A /* QBImagePicker.framework */; }; + 20B6B6881D92C42600CC5C6A /* QBImagePicker.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 20B6B6861D92C42600CC5C6A /* QBImagePicker.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 213311F38CA74CE280FD09AD /* libRNI18n.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 52F6ED6465184513A082652B /* libRNI18n.a */; }; 22118DE1207A419FBFE7B62D /* libRealmReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = CD48A32459B64E96843BB238 /* libRealmReact.a */; }; 25DC9C9DC25846BD8D084888 /* libc++.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 8B9A886A2CB448B1ABA0EB62 /* libc++.tbd */; }; @@ -138,6 +143,13 @@ remoteGlobalIDString = 206C9F3A1D474E910063E3E6; remoteInfo = RCTStatus; }; + 20A5C9521D927137002C4965 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = 20A5C94B1D927137002C4965 /* imageCropPicker.xcodeproj */; + proxyType = 2; + remoteGlobalIDString = 3400A8081CEB54A6008A0BC7; + remoteInfo = imageCropPicker; + }; 20B7D0FD1D3F74CC00B70F14 /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = 45FB5F523DE04BDE9877869C /* RNRandomBytes.xcodeproj */; @@ -238,6 +250,21 @@ }; /* End PBXContainerItemProxy section */ +/* Begin PBXCopyFilesBuildPhase section */ + 20B6B6891D92C42700CC5C6A /* Embed Frameworks */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 10; + files = ( + 20B6B6851D92C42600CC5C6A /* RSKImageCropper.framework in Embed Frameworks */, + 20B6B6881D92C42600CC5C6A /* QBImagePicker.framework in Embed Frameworks */, + ); + name = "Embed Frameworks"; + runOnlyForDeploymentPostprocessing = 0; + }; +/* End PBXCopyFilesBuildPhase section */ + /* Begin PBXFileReference section */ 008F07F21AC5B25A0029DE68 /* main.jsbundle */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = main.jsbundle; sourceTree = ""; }; 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTActionSheet.xcodeproj; path = "../node_modules/react-native/Libraries/ActionSheetIOS/RCTActionSheet.xcodeproj"; sourceTree = ""; }; @@ -265,6 +292,11 @@ 2028DFF61D4275B600227DCD /* SF-UI-Display-Regular.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-UI-Display-Regular.otf"; sourceTree = ""; }; 2028DFF71D4275B600227DCD /* SF-UI-Display-Semibold.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-UI-Display-Semibold.otf"; sourceTree = ""; }; 2028DFF81D4275B600227DCD /* SF-UI-Display-Thin.otf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "SF-UI-Display-Thin.otf"; sourceTree = ""; }; + 20A5C94B1D927137002C4965 /* imageCropPicker.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = imageCropPicker.xcodeproj; path = "../node_modules/react-native-image-crop-picker/ios/imageCropPicker.xcodeproj"; sourceTree = ""; }; + 20A5C96C1D92715E002C4965 /* RSKImageCropper.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = RSKImageCropper.framework; path = "../node_modules/react-native-image-crop-picker/ios/RSKImageCropper/build/Debug-iphoneos/RSKImageCropper.framework"; sourceTree = ""; }; + 20A5C96E1D92716C002C4965 /* QBImagePicker.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QBImagePicker.framework; path = "../node_modules/react-native-image-crop-picker/ios/QBImagePicker/build/Debug-iphoneos/QBImagePicker.framework"; sourceTree = ""; }; + 20B6B6831D92C42600CC5C6A /* RSKImageCropper.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = RSKImageCropper.framework; sourceTree = BUILT_PRODUCTS_DIR; }; + 20B6B6861D92C42600CC5C6A /* QBImagePicker.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = QBImagePicker.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 2756305FAFF144C4A6B0A039 /* Zocial.ttf */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = unknown; name = Zocial.ttf; path = "../node_modules/react-native-vector-icons/Fonts/Zocial.ttf"; sourceTree = ""; }; 2BEE3436791D42248F853999 /* libRCTImageResizer.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libRCTImageResizer.a; sourceTree = ""; }; 2F0276A9E90843E996A0E762 /* UdpSockets.xcodeproj */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = "wrapper.pb-project"; name = UdpSockets.xcodeproj; path = "../node_modules/react-native-udp/ios/UdpSockets.xcodeproj"; sourceTree = ""; }; @@ -315,9 +347,12 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 20A5C9711D9283A2002C4965 /* libimageCropPicker.a in Frameworks */, 9E3AB6D01D87DB2B008846B4 /* libReact-Native-Webview-Bridge.a in Frameworks */, + 20B6B6841D92C42600CC5C6A /* RSKImageCropper.framework in Frameworks */, CE4E31B31D8695250033ED64 /* Statusgo.framework in Frameworks */, 20AB9EC61D47CC0300E7FD9C /* libRCTStatus.a in Frameworks */, + 20B6B6871D92C42600CC5C6A /* QBImagePicker.framework in Frameworks */, 146834051AC3E58100842450 /* libReact.a in Frameworks */, 00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */, 00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */, @@ -494,6 +529,14 @@ name = SF; sourceTree = ""; }; + 20A5C94C1D927137002C4965 /* Products */ = { + isa = PBXGroup; + children = ( + 20A5C9531D927137002C4965 /* libimageCropPicker.a */, + ); + name = Products; + sourceTree = ""; + }; 20B7D0F01D3F74CC00B70F14 /* Products */ = { isa = PBXGroup; children = ( @@ -578,6 +621,7 @@ 832341AE1AAA6A7D00B99B32 /* Libraries */ = { isa = PBXGroup; children = ( + 20A5C94B1D927137002C4965 /* imageCropPicker.xcodeproj */, 9E3AB6B21D87DA2A008846B4 /* React-Native-Webview-Bridge.xcodeproj */, 146833FF1AC3E56700842450 /* React.xcodeproj */, 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */, @@ -617,6 +661,8 @@ 83CBB9F61A601CBA00E9B192 = { isa = PBXGroup; children = ( + 20B6B6861D92C42600CC5C6A /* QBImagePicker.framework */, + 20B6B6831D92C42600CC5C6A /* RSKImageCropper.framework */, 13B07FAE1A68108700A75B9A /* StatusIm */, 832341AE1AAA6A7D00B99B32 /* Libraries */, 00E356EF1AD99517003FC87E /* StatusImTests */, @@ -648,6 +694,8 @@ A97BA941B2FB44B4B66EE6D3 /* Frameworks */ = { isa = PBXGroup; children = ( + 20A5C96E1D92716C002C4965 /* QBImagePicker.framework */, + 20A5C96C1D92715E002C4965 /* RSKImageCropper.framework */, CE4E31B21D8695250033ED64 /* Statusgo.framework */, 8B9A886A2CB448B1ABA0EB62 /* libc++.tbd */, 4E586E1B0E544F64AA9F5BD1 /* libz.tbd */, @@ -692,6 +740,7 @@ 13B07F8C1A680F5B00A75B9A /* Frameworks */, 13B07F8E1A680F5B00A75B9A /* Resources */, 00DD1BFF1BD5951E006B06BC /* Bundle React Native code and images */, + 20B6B6891D92C42700CC5C6A /* Embed Frameworks */, ); buildRules = ( ); @@ -715,6 +764,10 @@ CreatedOnToolsVersion = 6.2; TestTargetID = 13B07F861A680F5B00A75B9A; }; + 13B07F861A680F5B00A75B9A = { + DevelopmentTeam = 259TWTDE52; + ProvisioningStyle = Automatic; + }; }; }; buildConfigurationList = 83CBB9FA1A601CBA00E9B192 /* Build configuration list for PBXProject "StatusIm" */; @@ -733,6 +786,10 @@ ProductGroup = 20B7D11B1D3F74CD00B70F14 /* Products */; ProjectRef = 807594C429CA44128AB5666B /* BVLinearGradient.xcodeproj */; }, + { + ProductGroup = 20A5C94C1D927137002C4965 /* Products */; + ProjectRef = 20A5C94B1D927137002C4965 /* imageCropPicker.xcodeproj */; + }, { ProductGroup = 00C302A81ABCB8CE00DB3ED1 /* Products */; ProjectRef = 00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */; @@ -912,6 +969,13 @@ remoteRef = 201067C31D4789F700FA83B6 /* PBXContainerItemProxy */; sourceTree = BUILT_PRODUCTS_DIR; }; + 20A5C9531D927137002C4965 /* libimageCropPicker.a */ = { + isa = PBXReferenceProxy; + fileType = archive.ar; + path = libimageCropPicker.a; + remoteRef = 20A5C9521D927137002C4965 /* PBXContainerItemProxy */; + sourceTree = BUILT_PRODUCTS_DIR; + }; 20B7D0FE1D3F74CC00B70F14 /* libRNRandomBytes.a */ = { isa = PBXReferenceProxy; fileType = archive.ar; @@ -1180,7 +1244,9 @@ x86_64, ); ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEAD_CODE_STRIPPING = NO; + DEVELOPMENT_TEAM = 259TWTDE52; FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../modules/react-native-status/ios/RCTStatus"; HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -1201,10 +1267,12 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", ); INFOPLIST_FILE = StatusIm/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = ( - "-ObjC", "$(inherited)", + "-lc++", + "-ObjC", ); PRODUCT_BUNDLE_IDENTIFIER = com.statusim; PRODUCT_NAME = StatusIm; @@ -1220,7 +1288,9 @@ x86_64, ); ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; + "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; DEAD_CODE_STRIPPING = NO; + DEVELOPMENT_TEAM = 259TWTDE52; FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/../modules/react-native-status/ios/RCTStatus"; HEADER_SEARCH_PATHS = ( "$(inherited)", @@ -1241,10 +1311,12 @@ "$(SRCROOT)/../node_modules/react-native-image-resizer/ios/RCTImageResizer", ); INFOPLIST_FILE = StatusIm/Info.plist; + IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; OTHER_LDFLAGS = ( - "-ObjC", "$(inherited)", + "-lc++", + "-ObjC", ); PRODUCT_BUNDLE_IDENTIFIER = com.statusim; PRODUCT_NAME = StatusIm; diff --git a/ios/StatusIm.xcodeproj/xcshareddata/xcschemes/StatusIm.xcscheme b/ios/StatusIm.xcodeproj/xcshareddata/xcschemes/StatusIm.xcscheme index 3afad3bbfb..bca2f64833 100644 --- a/ios/StatusIm.xcodeproj/xcshareddata/xcschemes/StatusIm.xcscheme +++ b/ios/StatusIm.xcodeproj/xcshareddata/xcschemes/StatusIm.xcscheme @@ -37,10 +37,10 @@ + shouldUseLaunchSchemeArgsEnv = "YES"> @@ -62,15 +62,18 @@ ReferencedContainer = "container:StatusIm.xcodeproj"> + + @@ -86,10 +89,10 @@ diff --git a/ios/StatusIm/Images.xcassets/AppIcon.appiconset/Contents.json b/ios/StatusIm/Images.xcassets/AppIcon.appiconset/Contents.json index 118c98f746..b8236c6534 100644 --- a/ios/StatusIm/Images.xcassets/AppIcon.appiconset/Contents.json +++ b/ios/StatusIm/Images.xcassets/AppIcon.appiconset/Contents.json @@ -1,5 +1,15 @@ { "images" : [ + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "2x" + }, + { + "idiom" : "iphone", + "size" : "20x20", + "scale" : "3x" + }, { "idiom" : "iphone", "size" : "29x29", diff --git a/ios/StatusIm/Info.plist b/ios/StatusIm/Info.plist index ee2fe54827..921348bc4a 100644 --- a/ios/StatusIm/Info.plist +++ b/ios/StatusIm/Info.plist @@ -1,62 +1,79 @@ - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - APPL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - LSRequiresIPhoneOS - - NSAppTransportSecurity - - NSAllowsArbitraryLoads - - - NSLocationWhenInUseUsageDescription - - UIAppFonts - - SF-UI-Display-Medium.otf - SF-UI-Display-Regular.otf - SF-UI-Display-Semibold.otf - SF-UI-Display-Thin.otf - Entypo.ttf - EvilIcons.ttf - FontAwesome.ttf - Foundation.ttf - Ionicons.ttf - MaterialIcons.ttf - Octicons.ttf - Zocial.ttf - - UILaunchStoryboardName - LaunchScreen - UIRequiredDeviceCapabilities - - armv7 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UIViewControllerBasedStatusBarAppearance - - - \ No newline at end of file + + NSCameraUsageDescription + We need to access your camera + NSPhotoLibraryUsageDescription + We need to access your photo storage to give you an ability to select photos + NSContactsUsageDescription + We need to access your contacts + CFBundleDevelopmentRegion + en + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 1.0 + CFBundleSignature + ???? + CFBundleVersion + 1 + LSRequiresIPhoneOS + + UILaunchStoryboardName + LaunchScreen + UIRequiredDeviceCapabilities + + armv7 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UIViewControllerBasedStatusBarAppearance + + NSLocationWhenInUseUsageDescription + + NSAppTransportSecurity + + NSExceptionDomains + + api.status.im + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + localhost + + NSTemporaryExceptionAllowsInsecureHTTPLoads + + + + + UIAppFonts + + SF-UI-Display-Medium.otf + SF-UI-Display-Regular.otf + SF-UI-Display-Semibold.otf + SF-UI-Display-Thin.otf + Entypo.ttf + EvilIcons.ttf + FontAwesome.ttf + Foundation.ttf + Ionicons.ttf + MaterialIcons.ttf + Octicons.ttf + Zocial.ttf + + + diff --git a/modules/react-native-status/ios/RCTStatus/RCTStatus.m b/modules/react-native-status/ios/RCTStatus/RCTStatus.m index dc966e5da9..1bc368b58b 100644 --- a/modules/react-native-status/ios/RCTStatus/RCTStatus.m +++ b/modules/react-native-status/ios/RCTStatus/RCTStatus.m @@ -2,8 +2,9 @@ #import +static bool isStatusInitialized; + @implementation Status{ - bool isStatusInitialized; } @@ -47,8 +48,7 @@ RCT_EXPORT_METHOD(callJail:(NSString *)chatId //////////////////////////////////////////////////////////////////// #pragma mark - startNode //////////////////////////////////////////////////////////////////// startNode -RCT_EXPORT_METHOD(startNode:(RCTResponseSenderBlock)onResultCallback - callback:(RCTResponseSenderBlock)onAlreadyRunningCallback) { +RCT_EXPORT_METHOD(startNode:(RCTResponseSenderBlock)onResultCallback) { #if DEBUG NSLog(@"startNode() method called"); #endif @@ -82,7 +82,6 @@ RCT_EXPORT_METHOD(startNode:(RCTResponseSenderBlock)onResultCallback onResultCallback(@[[NSNull null]]); return; } - onAlreadyRunningCallback(@[[NSNull null]]); } RCT_EXPORT_METHOD(stopNode:(RCTResponseSenderBlock)callback) { diff --git a/package.json b/package.json index f2fbb3e2eb..b392e4da8c 100644 --- a/package.json +++ b/package.json @@ -26,19 +26,20 @@ "punycode": "^1.4.1", "querystring-es3": "^0.2.1", "re-natal": "0.2.38", - "react": "^15.2.0", - "react-native": "^0.30.0", + "react": "^15.3.1", + "react-native": "^0.33.0", "react-native-action-button": "^1.1.11", "react-native-android-sms-listener": "github:alwx/react-native-android-sms-listener#listener-bugfix", - "react-native-camera": "github:codyhazelwood/react-native-camera", + "react-native-camera": "git+https://github.com/lwansbrough/react-native-camera.git", "react-native-circle-checkbox": "github:paramoshkinandrew/ReactNativeCircleCheckbox", "react-native-contacts": "^0.2.4", "react-native-crypto": "^2.0.1", "react-native-dialogs": "0.0.16", + "react-native-drawer-layout": "^1.1.0", "react-native-fs": "^1.5.1", "react-native-http": "github:tradle/react-native-http#834492d", "react-native-i18n": "0.0.8", - "react-native-image-crop-picker": "^0.5.4", + "react-native-image-crop-picker": "^0.9.4", "react-native-image-resizer": "github:danieldunderfelt/react-native-image-resizer", "react-native-invertible-scroll-view": "^1.0.0", "react-native-level-fs": "^2.0.1", @@ -46,12 +47,12 @@ "react-native-orientation": "github:youennPennarun/react-native-orientation", "react-native-qrcode": "^0.2.2", "react-native-randombytes": "^2.1.0", - "react-native-tcp": "^1.0.1", - "react-native-udp": "^1.2.5", + "react-native-tcp": "^2.0.4", + "react-native-udp": "^1.2.6", "react-native-vector-icons": "^2.0.3", - "react-native-webview-bridge": "github:rasom/react-native-webview-bridge#master", + "react-native-webview-bridge": "^0.33.0", "readable-stream": "^1.0.33", - "realm": "^0.14.0", + "realm": "^0.14.3", "stream-browserify": "^1.0.0", "timers-browserify": "^1.4.2", "tty-browserify": "0.0.0", @@ -70,7 +71,6 @@ "console": "console-browserify", "constants": "constants-browserify", "dns": "dns.js", - "net": "react-native-tcp", "domain": "domain-browser", "http": "react-native-http", "https": "https-browserify", @@ -81,7 +81,8 @@ "dgram": "react-native-udp", "timers": "timers-browserify", "tty": "tty-browserify", - "vm": "vm-browserify" + "vm": "vm-browserify", + "net": "react-native-tcp" }, "react-native": { "crypto": "react-native-crypto", @@ -95,7 +96,6 @@ "console": "console-browserify", "constants": "constants-browserify", "dns": "dns.js", - "net": "react-native-tcp", "domain": "domain-browser", "http": "react-native-http", "https": "https-browserify", @@ -106,6 +106,7 @@ "dgram": "react-native-udp", "timers": "timers-browserify", "tty": "tty-browserify", - "vm": "vm-browserify" + "vm": "vm-browserify", + "net": "react-native-tcp" } } diff --git a/postinstall.sh b/postinstall.sh index a5dab99b06..c0c99f9072 100755 --- a/postinstall.sh +++ b/postinstall.sh @@ -1,7 +1,9 @@ #!/bin/sh # rn-nodeify +# temporary hack due to https://github.com/facebook/react-native/issues/4968 ./node_modules/.bin/rn-nodeify --install --hack; +npm install --save react-native-tcp@2.0.4; # symlink for re-natal if ! [ -f re-natal ]; then diff --git a/src/status_im/accounts/login/screen.cljs b/src/status_im/accounts/login/screen.cljs index eb52bd2b76..cea8d015ea 100644 --- a/src/status_im/accounts/login/screen.cljs +++ b/src/status_im/accounts/login/screen.cljs @@ -6,7 +6,8 @@ text-input image linear-gradient - touchable-highlight]] + touchable-highlight + get-dimensions]] [status-im.components.status-bar :refer [status-bar]] [status-im.components.toolbar :refer [toolbar]] [status-im.components.text-field.view :refer [text-field]] @@ -34,33 +35,35 @@ (defview address-input [address] [view [text-field - {:value address - :editable false - :label (label :t/address) - :labelColor "#ffffff80" - :lineColor :white - :inputStyle st/input-style - :wrapperStyle (merge button-input st/address-input-wrapper) - :onChangeText #(dispatch [:set-in [:login :address] %])}]]) + {:value address + :editable false + :label (label :t/address) + :label-color "#ffffff80" + :line-color :white + :input-style st/input-style + :wrapper-style (merge button-input st/address-input-wrapper) + :on-change-text #(dispatch [:set-in [:login :address] %])}]]) (defview password-input [error] [view [text-field - {:value "" - :error (when (pos? (count error)) (label :t/wrong-password)) - :errorColor :white - :label (label :t/password) - :labelColor "#ffffff80" - :lineColor :white - :inputStyle st/input-style - :onChangeText #(do - (dispatch [:set-in [:login :password] %]) - (dispatch [:set-in [:login :error] ""]))}]]) + {:editable true + :error (when (pos? (count error)) (label :t/wrong-password)) + :error-color :white + :label (label :t/password) + :secure-text-entry true + :label-color "#ffffff80" + :line-color :white + :input-style st/input-style + :on-change-text #(do + (dispatch [:set-in [:login :password] %]) + (dispatch [:set-in [:login :error] ""]))}]]) (defview login [] [{:keys [address password error]} [:get :login] keyboard-height [:get :keyboard-height]] - [view st/screen-container + [view (st/screen-container (- (:height (get-dimensions "window")) + keyboard-height)) [linear-gradient {:colors ["rgba(182, 116, 241, 1)" "rgba(107, 147, 231, 1)" "rgba(43, 171, 238, 1)"] :start [0, 0] :end [0.5, 1] @@ -80,8 +83,7 @@ [password-input error]]] [view st/bottom-actions-container [view st/connect-button-container - [touchable-highlight - {:on-press #(dispatch [:login-account address password])} + [touchable-highlight {:on-press #(dispatch [:login-account address password])} [view st/connect-button [text {:style st/connect-button-text} (label :t/connect)]]]]]]) diff --git a/src/status_im/accounts/login/styles.cljs b/src/status_im/accounts/login/styles.cljs index daf7f2bb27..5bdf58ac0a 100644 --- a/src/status_im/accounts/login/styles.cljs +++ b/src/status_im/accounts/login/styles.cljs @@ -1,14 +1,12 @@ (ns status-im.accounts.login.styles - (:require [status-im.components.styles :refer [title-font - text1-color + (:require [status-im.components.styles :refer [text1-color color-white toolbar-background2 online-color]])) -(def screen-container - {:flex 1 - :color :white}) +(defn screen-container [height] + {:height height}) (def gradient-background {:position :absolute diff --git a/src/status_im/accounts/recover/screen.cljs b/src/status_im/accounts/recover/screen.cljs index 398265c131..9a4ee36134 100644 --- a/src/status_im/accounts/recover/screen.cljs +++ b/src/status_im/accounts/recover/screen.cljs @@ -40,15 +40,15 @@ (label :t/enter-valid-passphrase))] [view [text-field - {:value passphrase - :error error - :errorColor "#7099e6" - :label (label :t/passphrase) - :labelColor "#838c93de" - :lineColor "#0000001f" - :inputStyle st/input-style - :wrapperStyle (merge button-input st/address-input-wrapper) - :onChangeText #(dispatch [:set-in [:recover :passphrase] %])}]])) + {:value passphrase + :error error + :error-color "#7099e6" + :label (label :t/passphrase) + :label-color "#838c93de" + :line-color "#0000001f" + :input-style st/input-style + :wrapper-style (merge button-input st/address-input-wrapper) + :on-change-text #(dispatch [:set-in [:recover :passphrase] %])}]])) (defview password-input [password] [error [:get-in [:recover :password-error]]] @@ -58,14 +58,14 @@ (label :t/enter-valid-password))] [view [text-field - {:value password - :error error - :errorColor "#7099e6" - :label (label :t/password) - :labelColor "#838c93de" - :lineColor "#0000001f" - :inputStyle st/input-style - :onChangeText #(dispatch [:set-in [:recover :password] %])}]])) + {:value password + :error error + :error-color "#7099e6" + :label (label :t/password) + :label-color "#838c93de" + :line-color "#0000001f" + :input-style st/input-style + :on-change-text #(dispatch [:set-in [:recover :password] %])}]])) (defview recover [] [{:keys [passphrase password passphrase-error password-error]} [:get :recover]] diff --git a/src/status_im/accounts/recover/styles.cljs b/src/status_im/accounts/recover/styles.cljs index 156c63fa12..b75680ffe0 100644 --- a/src/status_im/accounts/recover/styles.cljs +++ b/src/status_im/accounts/recover/styles.cljs @@ -1,6 +1,5 @@ (ns status-im.accounts.recover.styles - (:require [status-im.components.styles :refer [title-font - text1-color + (:require [status-im.components.styles :refer [text1-color color-white toolbar-background2 online-color]])) diff --git a/src/status_im/accounts/screen.cljs b/src/status_im/accounts/screen.cljs index c2111578eb..f7d3481889 100644 --- a/src/status_im/accounts/screen.cljs +++ b/src/status_im/accounts/screen.cljs @@ -89,5 +89,4 @@ :style st/icon-plus}] [text {:style st/add-account-text :font :default} - (label :t/add-account)]]]] - ]]])) + (label :t/add-account)]]]]]]])) diff --git a/src/status_im/accounts/styles.cljs b/src/status_im/accounts/styles.cljs index 804ebb82fe..643d0fd2f3 100644 --- a/src/status_im/accounts/styles.cljs +++ b/src/status_im/accounts/styles.cljs @@ -25,8 +25,7 @@ {:flex 1}))) (def account-list - {:margin-top 20 - :height 100}) + {:margin-bottom 20}) (def row-separator {:borderBottomWidth 1 diff --git a/src/status_im/android/core.cljs b/src/status_im/android/core.cljs index 8bd056dbdd..4156377057 100644 --- a/src/status_im/android/core.cljs +++ b/src/status_im/android/core.cljs @@ -26,7 +26,6 @@ [status-im.group-settings.screen :refer [group-settings]] [status-im.profile.screen :refer [profile my-profile]] [status-im.profile.photo-capture.screen :refer [profile-photo-capture]] - [status-im.utils.utils :refer [toast]] status-im.persistence.realm.core [taoensso.timbre :as log] [status-im.components.status :as status])) diff --git a/src/status_im/android/platform.cljs b/src/status_im/android/platform.cljs index d0f66bc328..330e4e32fd 100644 --- a/src/status_im/android/platform.cljs +++ b/src/status_im/android/platform.cljs @@ -3,13 +3,17 @@ [status-im.utils.utils :as u])) (def component-styles - {:status-bar {:default {:height 0 - :bar-style "default" - :color styles/color-gray} - :transparent {:height 20 - :bar-style "default" - :translucent? true - :color styles/color-transparent}}}) + {:status-bar {:default {:height 0 + :bar-style "default" + :color styles/color-gray} + :main {:height 0 + :bar-style "default" + :color styles/color-gray} + :transparent {:height 20 + :bar-style "default" + :translucent? true + :color styles/color-transparent}} + :bottom-gradient {:height 3}}) (def fonts {:default {:font-family "sans-serif"} diff --git a/src/status_im/chat/handlers.cljs b/src/status_im/chat/handlers.cljs index 4eb69f9b27..d392a7740f 100644 --- a/src/status_im/chat/handlers.cljs +++ b/src/status_im/chat/handlers.cljs @@ -208,7 +208,9 @@ (register-handler :stop-listening-confirmation-code-sms (fn [db [_]] - (sign-up-service/stop-listening-confirmation-code-sms db))) + (if (:confirmation-code-sms-listener db) + (sign-up-service/stop-listening-confirmation-code-sms db) + db))) (register-handler :sign-up-confirm (u/side-effect! diff --git a/src/status_im/chat/sign_up.cljs b/src/status_im/chat/sign_up.cljs index 2c69491086..2fc41d1712 100644 --- a/src/status_im/chat/sign_up.cljs +++ b/src/status_im/chat/sign_up.cljs @@ -1,7 +1,7 @@ (ns status-im.chat.sign-up (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] [status-im.components.styles :refer [default-chat-color]] - [status-im.utils.utils :refer [on-error http-post toast]] + [status-im.utils.utils :refer [http-post]] [status-im.utils.random :as random] [status-im.utils.sms-listener :refer [add-sms-listener remove-sms-listener]] diff --git a/src/status_im/chat/styles/command_validation.cljs b/src/status_im/chat/styles/command_validation.cljs index 90d196b753..341d243f55 100644 --- a/src/status_im/chat/styles/command_validation.cljs +++ b/src/status_im/chat/styles/command_validation.cljs @@ -9,9 +9,8 @@ :padding-top 12}) (def title - {:color :white - :font-size 14 - :font-family st/font}) + {:color :white + :font-size 14}) (def description (assoc title :opacity 0.9 diff --git a/src/status_im/chat/styles/content_suggestions.cljs b/src/status_im/chat/styles/content_suggestions.cljs index 97c403bca7..869c0b68b5 100644 --- a/src/status_im/chat/styles/content_suggestions.cljs +++ b/src/status_im/chat/styles/content_suggestions.cljs @@ -1,6 +1,5 @@ (ns status-im.chat.styles.content-suggestions - (:require [status-im.components.styles :refer [font - color-light-blue-transparent + (:require [status-im.components.styles :refer [color-light-blue-transparent color-white color-black color-blue @@ -26,13 +25,11 @@ (def value-text {:marginTop 9 :fontSize 14 - :fontFamily font :color text1-color}) (def description-text {:marginTop 1.5 :fontSize 14 - :fontFamily font :color text2-color}) (defn suggestions-container [suggestions-count] diff --git a/src/status_im/chat/styles/input.cljs b/src/status_im/chat/styles/input.cljs index 6dd49b23be..7b2d254d6e 100644 --- a/src/status_im/chat/styles/input.cljs +++ b/src/status_im/chat/styles/input.cljs @@ -1,11 +1,10 @@ (ns status-im.chat.styles.input - (:require [status-im.components.styles :refer [font - color-white - color-blue - text1-color - text2-color - chat-background - color-black]])) + (:require [status-im.components.styles :refer [color-white + color-blue + text1-color + text2-color + chat-background + color-black]])) (def command-input-and-suggestions-container {:flexDirection :column}) @@ -36,7 +35,6 @@ {:marginTop 3 :marginHorizontal 12 :fontSize 12 - :fontFamily font :color color-white}) (def command-input @@ -45,7 +43,6 @@ :marginTop -2 :padding 0 :fontSize 14 - :fontFamily font :color text1-color}) (def send-container @@ -101,7 +98,6 @@ (def staged-command-text {:fontSize 12 - :fontFamily font :color color-white}) (def staged-command-cancel @@ -117,5 +113,4 @@ {:marginTop 5 :marginHorizontal 0 :fontSize 14 - :fontFamily font :color color-black}) diff --git a/src/status_im/chat/styles/plain_message.cljs b/src/status_im/chat/styles/plain_message.cljs index 429982957f..008fcd7217 100644 --- a/src/status_im/chat/styles/plain_message.cljs +++ b/src/status_im/chat/styles/plain_message.cljs @@ -1,6 +1,5 @@ (ns status-im.chat.styles.plain-message - (:require [status-im.components.styles :refer [font - text2-color]])) + (:require [status-im.components.styles :refer [text2-color]])) (defn message-input-button-touchable [w] {:width w @@ -37,7 +36,6 @@ :marginTop -2 :padding 0 :fontSize 14 - :fontFamily font :color text2-color}) (def smile-icon diff --git a/src/status_im/chat/styles/response.cljs b/src/status_im/chat/styles/response.cljs index 01024dcfba..1f9788ee33 100644 --- a/src/status_im/chat/styles/response.cljs +++ b/src/status_im/chat/styles/response.cljs @@ -1,12 +1,12 @@ (ns status-im.chat.styles.response - (:require [status-im.components.styles :refer [font - color-white + (:require [status-im.components.styles :refer [color-white color-blue text1-color text2-color chat-background color-black]] - [status-im.chat.constants :refer [input-height request-info-height + [status-im.chat.constants :refer [input-height + request-info-height response-height-normal]])) (def drag-container @@ -39,22 +39,20 @@ (def command-name {:marginTop 0 :fontSize 12 - :fontFamily font :color color-white}) (def message-info {:marginTop 1 :fontSize 12 - :fontFamily font :opacity 0.69 :color color-white}) -(defn response-view [height] +(defn response-view [keyboard-height height] {:flexDirection :column :position :absolute :left 0 :right 0 - :bottom 0 + :bottom keyboard-height :height height :backgroundColor color-white :elevation 2}) @@ -90,5 +88,4 @@ :marginTop -2 :padding 0 :fontSize 14 - :fontFamily font :color (if disbale? color-white text1-color)}) diff --git a/src/status_im/chat/styles/screen.cljs b/src/status_im/chat/styles/screen.cljs index 0e03df2681..d975c822bb 100644 --- a/src/status_im/chat/styles/screen.cljs +++ b/src/status_im/chat/styles/screen.cljs @@ -1,7 +1,5 @@ (ns status-im.chat.styles.screen - (:require [status-im.components.styles :refer [font - title-font - color-white + (:require [status-im.components.styles :refer [color-white color-black chat-background online-color @@ -50,8 +48,7 @@ (def chat-name-text {:marginTop -2.5 :color text1-color - :fontSize 16 - :fontFamily font}) + :fontSize 16}) (def group-icon {:marginTop 4 @@ -65,15 +62,13 @@ (def members {:marginTop -0.5 :marginLeft 4 - :fontFamily font :fontSize 12 :color text2-color}) (def last-activity {:marginTop 1 :color text2-color - :fontSize 12 - :fontFamily font}) + :fontSize 12}) (defn actions-wrapper [status-bar-height] {:backgroundColor toolbar-background1 @@ -142,7 +137,6 @@ (def typing-text {:marginTop -2 :fontSize 12 - :fontFamily font :color text2-color}) (def overlay-highlight diff --git a/src/status_im/chat/styles/suggestions.cljs b/src/status_im/chat/styles/suggestions.cljs index 2985922cd7..83076d4ae9 100644 --- a/src/status_im/chat/styles/suggestions.cljs +++ b/src/status_im/chat/styles/suggestions.cljs @@ -1,6 +1,5 @@ (ns status-im.chat.styles.suggestions - (:require [status-im.components.styles :refer [font - color-light-blue-transparent + (:require [status-im.components.styles :refer [color-light-blue-transparent color-white color-black color-gray @@ -47,7 +46,6 @@ {:marginTop 2.5 :marginHorizontal 12 :fontSize 12 - :fontFamily font :color color-white}) (def title-container @@ -61,21 +59,19 @@ (def value-text {:marginTop 6 :fontSize 14 - :fontFamily font :color text1-color}) (def description-text {:marginTop 2 :fontSize 12 - :fontFamily font :color text2-color}) -(defn container [height] +(defn container [keyboard-height height] {:flexDirection :column :position :absolute :left 0 :right 0 - :bottom 0 + :bottom keyboard-height :height height :backgroundColor color-white :elevation 2}) @@ -117,6 +113,6 @@ (def header-icon {:background-color :#838c93 - :width 14 - :border-radius 1 - :height 3}) + :width 14 + :border-radius 1 + :height 3}) diff --git a/src/status_im/chat/suggestions.cljs b/src/status_im/chat/suggestions.cljs index f07b2b5a85..1de4d86970 100644 --- a/src/status_im/chat/suggestions.cljs +++ b/src/status_im/chat/suggestions.cljs @@ -4,7 +4,7 @@ [status-im.models.commands :refer [get-commands get-chat-command-request get-chat-command-to-message-id]] - [status-im.utils.utils :refer [log on-error http-get]] + [status-im.utils.utils :refer [log http-get]] [clojure.string :as s])) (defn suggestion? [text] diff --git a/src/status_im/chat/views/actions.cljs b/src/status_im/chat/views/actions.cljs index 1ea7274e2e..dd0e233c45 100644 --- a/src/status_im/chat/views/actions.cljs +++ b/src/status_im/chat/views/actions.cljs @@ -114,7 +114,8 @@ [view st/action-view [text {:style st/action-title :number-of-lines 1 - :font :medium} title] + :font :medium} + title] (when-let [subtitle subtitle] [text {:style st/action-subtitle :number-of-lines 1 diff --git a/src/status_im/chat/views/message_input.cljs b/src/status_im/chat/views/message_input.cljs index 4376a6f9b9..bdb730a4cd 100644 --- a/src/status_im/chat/views/message_input.cljs +++ b/src/status_im/chat/views/message_input.cljs @@ -23,10 +23,10 @@ [view st/message-input-container input]) (defn plain-input-options [disable?] - {:style st-message/message-input - :onChangeText (when-not disable? plain-message/set-input-message) - :editable (not disable?) - :onSubmitEditing plain-message/send}) + {:style st-message/message-input + :on-change-text (when-not disable? plain-message/set-input-message) + :editable (not disable?) + :on-submit-editing plain-message/send}) (defn on-press-commands-handler [{:keys [suggestions-trigger]}] @@ -35,9 +35,9 @@ command/send-command)) (defn command-input-options [command icon-width disable?] - {:style (st-response/command-input icon-width disable?) - :onChangeText (when-not disable? command/set-input-message) - :onSubmitEditing (on-press-commands-handler command)}) + {:style (st-response/command-input icon-width disable?) + :on-change-text (when-not disable? command/set-input-message) + :on-submit-editing (on-press-commands-handler command)}) (defview message-input [input-options command] [command? [:command?] @@ -49,12 +49,13 @@ (if command? (command-input-options command icon-width disable?) (plain-input-options disable?)) - {:autoFocus false - :blurOnSubmit false + {:auto-focus false + :blur-on-submit false + :editable true :accessibility-label :input :on-focus #(dispatch [:set :focused true]) :on-blur #(dispatch [:set :focused false]) - :default-value (if command? input-command input-message)} + :default-value (if command? (or input-command "") input-message)} input-options)]) (defview plain-message-input-view [{:keys [input-options]}] diff --git a/src/status_im/chat/views/new_message.cljs b/src/status_im/chat/views/new_message.cljs index 374ccc2725..f59ff230b1 100644 --- a/src/status_im/chat/views/new_message.cljs +++ b/src/status_im/chat/views/new_message.cljs @@ -19,9 +19,9 @@ (defn get-options [{:keys [type placeholder]} command-type] (let [options (case (keyword type) - :phone {:input-options {:keyboardType :phone-pad}} - :password {:input-options {:secureTextEntry true}} - :number {:input-options {:keyboardType :numeric}} + :phone {:input-options {:keyboard-type "phone-pad"}} + :password {:input-options {:secure-text-entry true}} + :number {:input-options {:keyboard-type "numeric"}} ;; todo maybe nil is fine for now :) nil #_(throw (js/Error. "Uknown command type")))] (if (= :response command-type) diff --git a/src/status_im/chat/views/request_message.cljs b/src/status_im/chat/views/request_message.cljs index 3c445a04a7..e8ed5d5efb 100644 --- a/src/status_im/chat/views/request_message.cljs +++ b/src/status_im/chat/views/request_message.cljs @@ -56,7 +56,7 @@ :component-will-unmount #(reset! loop? false) :reagent-render - (fn [message-id command] + (fn [message-id {command-icon :icon :as command}] (if command [touchable-highlight {:on-press (when-not @answered? @@ -64,8 +64,9 @@ :style st/command-request-image-touchable :accessibility-label (label command)} [animated-view {:style (st/command-request-image-view command scale-anim-val)} - [image {:source {:uri (:icon command)} - :style st/command-request-image}]]]))}))) + (if command-icon + [image {:source {:uri command-icon} + :style st/command-request-image}])]]))}))) (defn message-content-command-request [{:keys [message-id content from incoming-group]}] diff --git a/src/status_im/chat/views/response.cljs b/src/status_im/chat/views/response.cljs index 2caafd4f6f..fdc3c3831f 100644 --- a/src/status_im/chat/views/response.cljs +++ b/src/status_im/chat/views/response.cljs @@ -7,7 +7,6 @@ [status-im.components.react :refer [view animated-view icon - image text text-input touchable-highlight @@ -20,6 +19,7 @@ [status-im.chat.suggestions-responder :as resp] [status-im.chat.constants :as c] [status-im.chat.views.command-validation :as cv] + [status-im.utils.platform :refer [ios?]] [status-im.components.webview-bridge :refer [webview-bridge]])) (defn drag-icon [] @@ -71,12 +71,13 @@ (let [;; todo to-response-height, cur-response-height must be specific ;; for each chat to-response-height (subscribe [:response-height]) - changed (subscribe [:animations :response-height-changed]) - animate? (subscribe [:animate?]) - context {:to-value to-response-height - :val response-height - :animate? animate?} - on-update #(container-animation-logic context)] + changed (subscribe [:animations :response-height-changed]) + animate? (subscribe [:animate?]) + keyboard-height (subscribe [:get :keyboard-height]) + context {:to-value to-response-height + :val response-height + :animate? animate?} + on-update #(container-animation-logic context)] (r/create-class {:component-did-mount on-update @@ -85,7 +86,9 @@ :reagent-render (fn [response-height & children] @to-response-height @changed - (into [animated-view {:style (st/response-view response-height)}] + (into [animated-view {:style (st/response-view + (if ios? @keyboard-height 0) + response-height)}] children))}))) (defn on-navigation-change diff --git a/src/status_im/chat/views/suggestions.cljs b/src/status_im/chat/views/suggestions.cljs index 2d84b0b812..8b7bbb5587 100644 --- a/src/status_im/chat/views/suggestions.cljs +++ b/src/status_im/chat/views/suggestions.cljs @@ -16,6 +16,7 @@ [reagent.core :as r] [status-im.components.animation :as anim] [status-im.components.drag-drop :as drag] + [status-im.utils.platform :refer [ios?]] [status-im.chat.suggestions-responder :as resp] [status-im.chat.constants :as c])) @@ -108,6 +109,7 @@ (let [;; todo to-response-height, cur-response-height must be specific ;; for each chat to-response-height (subscribe [:command-suggestions-height]) + keyboard-height (subscribe [:get :keyboard-height]) changed (subscribe [:animations :commands-height-changed]) animate? (subscribe [:animate?]) context {:to-value to-response-height @@ -122,7 +124,7 @@ :reagent-render (fn [h & elements] @to-response-height @changed - (into [animated-view {:style (st/container h)}] elements))}))) + (into [animated-view {:style (st/container (if ios? @keyboard-height 0) h)}] elements))}))) (defn suggestion-container [] (let [h (anim/create-value c/input-height)] diff --git a/src/status_im/chats_list/screen.cljs b/src/status_im/chats_list/screen.cljs index cf2ad8c381..3dab81c73a 100644 --- a/src/status_im/chats_list/screen.cljs +++ b/src/status_im/chats_list/screen.cljs @@ -27,19 +27,17 @@ (defview chats-list-toolbar [] [chats-scrolled? [:get :chats-scrolled?]] - [view - [status-bar] - [toolbar {:nav-action {:image {:source {:uri :icon_hamburger} - :style st/hamburger-icon} - :handler open-drawer} - :title (label :t/chats) - :background-color (if chats-scrolled? - toolbar-background1 - toolbar-background2) - ;; TODO implement search - :action {:image {:source {:uri :icon_search} - :style st/search-icon} - :handler (fn [])}}]]) + [toolbar {:nav-action {:image {:source {:uri :icon_hamburger} + :style st/hamburger-icon} + :handler open-drawer} + :title (label :t/chats) + :background-color (if chats-scrolled? + toolbar-background1 + toolbar-background2) + ;; TODO implement search + :action {:image {:source {:uri :icon_search} + :style st/search-icon} + :handler (fn [])}}]) (defview chats-list [] [chats [:get :chats]] diff --git a/src/status_im/chats_list/styles.cljs b/src/status_im/chats_list/styles.cljs index 466a2fa81b..d230f45ae9 100644 --- a/src/status_im/chats_list/styles.cljs +++ b/src/status_im/chats_list/styles.cljs @@ -1,7 +1,5 @@ (ns status-im.chats-list.styles - (:require [status-im.components.styles :refer [font - title-font - color-white + (:require [status-im.components.styles :refer [color-white color-blue online-color text1-color @@ -32,8 +30,7 @@ (def name-text {:marginTop -2.5 :color text1-color - :fontSize 14 - :fontFamily title-font}) + :fontSize 14}) (def group-icon {:marginTop 4 @@ -44,7 +41,6 @@ (def memebers-text {:marginTop -0.5 :marginLeft 4 - :fontFamily font :fontSize 12 :color text2-color}) @@ -52,7 +48,6 @@ {:marginTop 7 :marginRight 40 :color text1-color - :fontFamily font :fontSize 14 :lineHeight 20}) @@ -68,8 +63,7 @@ :height 7}) (def datetime-text - {:fontFamily font - :fontSize 12 + {:fontSize 12 :color text2-color :marginLeft 5}) @@ -85,7 +79,6 @@ (def new-messages-text {:top 4 :left 0 - :fontFamily title-font :fontSize 10 :color color-blue :textAlign :center}) diff --git a/src/status_im/chats_list/views/chat_list_item.cljs b/src/status_im/chats_list/views/chat_list_item.cljs index 97d4ad5ded..028d50db2f 100644 --- a/src/status_im/chats_list/views/chat_list_item.cljs +++ b/src/status_im/chats_list/views/chat_list_item.cljs @@ -4,7 +4,6 @@ text image touchable-highlight]] - [status-im.components.styles :refer [font]] [status-im.chats-list.views.inner-item :refer [chat-list-item-inner-view]])) (defn chat-list-item [[chat-id chat]] diff --git a/src/status_im/commands/handlers/jail.cljs b/src/status_im/commands/handlers/jail.cljs index 11031286ba..7799c8e926 100644 --- a/src/status_im/commands/handlers/jail.cljs +++ b/src/status_im/commands/handlers/jail.cljs @@ -1,7 +1,7 @@ (ns status-im.commands.handlers.jail (:require [re-frame.core :refer [after dispatch subscribe trim-v debug]] [status-im.utils.handlers :as u] - [status-im.utils.utils :refer [http-get toast]] + [status-im.utils.utils :refer [http-get show-popup]] [status-im.components.status :as status] [status-im.utils.types :refer [json->clj]] [status-im.commands.utils :refer [generate-hiccup reg-handler]] @@ -76,7 +76,7 @@ (defn print-error-message! [message] (fn [_ params] (when (:error (last params)) - (toast (s/join "\n" [message params])) + (show-popup "Error" (s/join "\n" [message params])) (println message params)))) (reg-handler :init-render-command! init-render-command!) diff --git a/src/status_im/commands/handlers/loading.cljs b/src/status_im/commands/handlers/loading.cljs index 76cd8250c4..4b97a7eb4f 100644 --- a/src/status_im/commands/handlers/loading.cljs +++ b/src/status_im/commands/handlers/loading.cljs @@ -2,7 +2,7 @@ (:require-macros [status-im.utils.slurp :refer [slurp]]) (:require [re-frame.core :refer [path after dispatch subscribe trim-v debug]] [status-im.utils.handlers :as u] - [status-im.utils.utils :refer [http-get toast]] + [status-im.utils.utils :refer [http-get show-popup]] [clojure.string :as s] [status-im.persistence.realm.core :as realm] [status-im.components.status :as status] @@ -94,7 +94,7 @@ id (name reason) details])] - (toast m) + (show-popup "Error" m) (println m)))) (reg-handler :load-commands! (u/side-effect! load-commands!)) diff --git a/src/status_im/components/carousel/styles.cljs b/src/status_im/components/carousel/styles.cljs index 3610731870..ea520b7aa6 100644 --- a/src/status_im/components/carousel/styles.cljs +++ b/src/status_im/components/carousel/styles.cljs @@ -1,14 +1,12 @@ (ns status-im.components.carousel.styles - (:require [status-im.components.styles :refer [font - title-font - color-white - chat-background - online-color - selected-message-color - separator-color - text1-color - text2-color - toolbar-background1]])) + (:require [status-im.components.styles :refer [color-white + chat-background + online-color + selected-message-color + separator-color + text1-color + text2-color + toolbar-background1]])) (def scroll-view-container {:flex 1}) diff --git a/src/status_im/components/chat_icon/styles.cljs b/src/status_im/components/chat_icon/styles.cljs index af42ecd269..43c3adc4ef 100644 --- a/src/status_im/components/chat_icon/styles.cljs +++ b/src/status_im/components/chat_icon/styles.cljs @@ -1,7 +1,5 @@ (ns status-im.components.chat-icon.styles - (:require [status-im.components.styles :refer [font - title-font - color-white + (:require [status-im.components.styles :refer [color-white chat-background online-color selected-message-color @@ -37,7 +35,6 @@ (def default-chat-icon-text {:marginTop -2 :color color-white - :fontFamily font :fontSize 16 :lineHeight 20}) @@ -97,7 +94,8 @@ (def online-dot-right (merge online-dot {:left 9})) (def photo-pencil - {:margin-left 6 + {:margin-left 5 + :margin-right 5 :margin-top 3 :font-size 12 :color :white}) diff --git a/src/status_im/components/drawer/styles.cljs b/src/status_im/components/drawer/styles.cljs index a6b780ad22..0cb6ff24d0 100644 --- a/src/status_im/components/drawer/styles.cljs +++ b/src/status_im/components/drawer/styles.cljs @@ -1,6 +1,5 @@ (ns status-im.components.drawer.styles - (:require [status-im.components.styles :refer [font - color-light-blue-transparent + (:require [status-im.components.styles :refer [color-light-blue-transparent color-white color-black color-blue diff --git a/src/status_im/components/drawer/view.cljs b/src/status_im/components/drawer/view.cljs index 7b50784777..e4fba90368 100644 --- a/src/status_im/components/drawer/view.cljs +++ b/src/status_im/components/drawer/view.cljs @@ -7,7 +7,7 @@ view text image - drawer-layout-android + drawer-layout touchable-opacity]] [status-im.resources :as res] [status-im.components.drawer.styles :as st] @@ -76,9 +76,8 @@ (label :t/switch-users)]]]]) (defn drawer-view [items] - [drawer-layout-android {:drawerWidth 260 - :drawerPosition js/ReactNative.DrawerLayoutAndroid.positions.Left - :render-navigation-view #(r/as-element [drawer-menu]) - :ref (fn [drawer] - (reset! drawer-atom drawer))} + [drawer-layout {:drawerWidth 260 + :render-navigation-view #(r/as-element [drawer-menu]) + :ref (fn [drawer] + (reset! drawer-atom drawer))} items]) diff --git a/src/status_im/components/main_tabs.cljs b/src/status_im/components/main_tabs.cljs index be12355a36..99716d2301 100644 --- a/src/status_im/components/main_tabs.cljs +++ b/src/status_im/components/main_tabs.cljs @@ -104,7 +104,7 @@ [view-id [:get :view-id] tab-animation? [:get :prev-tab-view-id]] [view common-st/flex - [status-bar] + [status-bar {:type :main}] [view common-st/flex [drawer-view [view {:style common-st/flex diff --git a/src/status_im/components/react.cljs b/src/status_im/components/react.cljs index a3b11614e7..2588b22044 100644 --- a/src/status_im/components/react.cljs +++ b/src/status_im/components/react.cljs @@ -12,6 +12,7 @@ (def linear-gradient-module (u/require "react-native-linear-gradient")) (def dismiss-keyboard! (u/require "dismissKeyboard")) (def orientation (u/require "react-native-orientation")) +(def drawer (u/require "react-native-drawer-layout")) ;; Getters @@ -34,7 +35,7 @@ (def linear-gradient-class (adapt-class linear-gradient-module)) (def status-bar (get-class "StatusBar")) -(def drawer-layout-android (get-class "DrawerLayoutAndroid")) +(def drawer-layout (adapt-class drawer)) (def list-view-class (get-class "ListView")) (def scroll-view (get-class "ScrollView")) @@ -76,11 +77,11 @@ (defn text-input [props text] [text-input-class (merge - {:underlineColorAndroid :transparent - :placeholderTextColor st/text2-color - :placeholder "Type"} - props) - text]) + {:underline-color-android :transparent + :placeholder-text-color st/text2-color + :placeholder "Type" + :value text} + props)]) (defn icon ([n] (icon n {})) diff --git a/src/status_im/components/styles.cljs b/src/status_im/components/styles.cljs index 41220bacd4..6eee35fa01 100644 --- a/src/status_im/components/styles.cljs +++ b/src/status_im/components/styles.cljs @@ -1,10 +1,5 @@ (ns status-im.components.styles) -(def font "HelveticaNeue") -;; (def font "Avenir-Roman") -(def font-medium "sans-serif-medium") -(def title-font font-medium) - (def color-transparent "transparent") (def color-blue "#7099e6") (def color-blue-transparent "#7099e632") @@ -82,13 +77,11 @@ (def form-text-input {:marginLeft -4 :fontSize 14 - :fontFamily font :color text1-color}) (def white-form-text-input {:marginLeft -4 :fontSize 14 - :fontFamily font :color color-white}) (def toolbar-title-container diff --git a/src/status_im/components/tabs/bottom_gradient.cljs b/src/status_im/components/tabs/bottom_gradient.cljs index 16e62bdf05..ad46d5ce43 100644 --- a/src/status_im/components/tabs/bottom_gradient.cljs +++ b/src/status_im/components/tabs/bottom_gradient.cljs @@ -1,8 +1,11 @@ (ns status-im.components.tabs.bottom-gradient (:require [status-im.components.tabs.styles :as st] - [status-im.components.react :refer [linear-gradient]])) + [status-im.components.react :refer [linear-gradient]] + [status-im.utils.platform :refer [platform-specific]])) (defn bottom-gradient [] [linear-gradient {:locations [0 0.8 1] :colors ["rgba(24, 52, 76, 0)" "rgba(24, 52, 76, 0.085)" "rgba(24, 52, 76, 0.165)"] - :style st/bottom-gradient}]) \ No newline at end of file + :style (merge + st/bottom-gradient + (get-in platform-specific [:component-styles :bottom-gradient]))}]) \ No newline at end of file diff --git a/src/status_im/components/tabs/styles.cljs b/src/status_im/components/tabs/styles.cljs index 166345d2b4..9c645c56f9 100644 --- a/src/status_im/components/tabs/styles.cljs +++ b/src/status_im/components/tabs/styles.cljs @@ -1,7 +1,5 @@ (ns status-im.components.tabs.styles - (:require [status-im.components.styles :refer [font - title-font - color-white + (:require [status-im.components.styles :refer [color-white chat-background online-color selected-message-color @@ -28,8 +26,7 @@ {:position :absolute :bottom 0 :left 0 - :right 0 - :height 4}) + :right 0}) (def tabs-inner-container {:flexDirection :row @@ -46,8 +43,7 @@ :alignItems :center}) (def tab-title - {:fontFamily "sans-serif" - :fontSize 14 + {:fontSize 14 :color "#6e93d8"}) (def tab-icon diff --git a/src/status_im/components/text_field/styles.cljs b/src/status_im/components/text_field/styles.cljs index 582454b4d6..526b3cbe30 100644 --- a/src/status_im/components/text_field/styles.cljs +++ b/src/status_im/components/text_field/styles.cljs @@ -2,39 +2,40 @@ (def text-field-container - {:position :relative - :height 72 - :paddingTop 30 - :paddingBottom 7}) + {:position :relative + :height 72 + :padding-top 30 + :padding-bottom 7}) (def text-input - {:fontSize 16 - :height 34 - :lineHeight 34 - :paddingBottom 5 - :textAlignVertical :top}) + {:font-size 16 + :height 34 + :line-height 34 + :padding-bottom 5 + :text-align-vertical :top}) (defn label [top font-size color] - {:position :absolute - :top top - :left 0 - :color color - :fontSize font-size - :backgroundColor :transparent}) + {:position :absolute + :top top + :left 0 + :color color + :font-size font-size + :background-color :transparent}) (def label-float {}) -(defn underline-container [backgroundColor] - {:backgroundColor backgroundColor - :height 1 - :alignItems :center}) +(defn underline-container [background-color] + {:background-color background-color + :height 1 + :align-items :center}) -(defn underline [backgroundColor width] - {:backgroundColor backgroundColor - :height 1 - :width width}) +(defn underline [background-color width] + {:background-color background-color + :height 1 + :width width}) (defn error-text [color] - {:color color - :fontSize 12}) + {:color color + :background-color :transparent + :font-size 12}) diff --git a/src/status_im/components/text_field/view.cljs b/src/status_im/components/text_field/view.cljs index 0c9ec83269..b86564b92d 100644 --- a/src/status_im/components/text_field/view.cljs +++ b/src/status_im/components/text_field/view.cljs @@ -21,19 +21,19 @@ :label-font-small 13 :label-animation-duration 200}) -(def default-props {:wrapperStyle {} - :inputStyle {} - :lineStyle {} - :editable true - :labelColor "#838c93" - :lineColor "#0000001f" - :focusLineColor "#0000001f" - :errorColor "#d50000" - :secureTextEntry false - :onFocus #() - :onBlur #() - :onChangeText #() - :onChange #()}) +(def default-props {:wrapper-style {} + :input-style {} + :line-style {} + :editable true + :label-color "#838c93" + :line-color "#0000001f" + :focus-line-color "#0000001f" + :error-color "#d50000" + :secure-text-entry false + :on-focus #() + :on-blur #() + :on-change-text #() + :on-change #()}) (defn field-animation [{:keys [top to-top font-size to-font-size line-width to-line-width]}] @@ -117,18 +117,18 @@ ;(log/debug "component-did-update: " prev-props prev-state) ) -(defn on-focus [{:keys [component animation onFocus]}] +(defn on-input-focus [{:keys [component animation onFocus]}] (do (log/debug "input focused") - (r/set-state component {:has-focus true + (r/set-state component {:has-focus true :float-label? true}) (field-animation animation) (when onFocus (onFocus)))) -(defn on-blur [{:keys [component value animation onBlur]}] +(defn on-input-blur [{:keys [component value animation onBlur]}] (do (log/debug "Input blurred") - (r/set-state component {:has-focus false + (r/set-state component {:has-focus false :float-label? (if (s/blank? value) false true)}) (when (s/blank? value) (field-animation animation)) @@ -145,42 +145,42 @@ label-font-size line-width max-line-width] :as state} (r/state component) - {:keys [wrapperStyle inputStyle lineColor focusLineColor secureTextEntry - labelColor errorColor error label value onFocus onBlur - onChangeText onChange editable] :as props} (merge default-props (r/props component)) - lineColor (if error errorColor lineColor) - focusLineColor (if error errorColor focusLineColor) - labelColor (if (and error (not float-label?)) errorColor labelColor) + {:keys [wrapper-style input-style line-color focus-line-color secure-text-entry + label-color error-color error label value on-focus on-blur + on-change-text on-change editable] :as props} (merge default-props (r/props component)) + line-color (if error error-color line-color) + focus-line-color (if error error-color focus-line-color) + label-color (if (and error (not float-label?)) error-color label-color) label (if error (str label " *") label)] - [view (merge st/text-field-container wrapperStyle) - [animated-text {:style (st/label label-top label-font-size labelColor)} label] - [text-input {:style (merge st/text-input inputStyle) - :placeholder "" - :editable editable - :secureTextEntry secureTextEntry - :onFocus #(on-focus {:component component - :animation {:top label-top - :to-top (:label-top config) - :font-size label-font-size - :to-font-size (:label-font-small config) - :line-width line-width - :to-line-width max-line-width} - :onFocus onFocus}) - :onBlur #(on-blur {:component component - :value value - :animation {:top label-top - :to-top (:label-bottom config) - :font-size label-font-size - :to-font-size (:label-font-large config) - :line-width line-width - :to-line-width 0} - :onBlur onBlur}) - :onChangeText #(onChangeText %) - :onChange #(onChange %)} value] - [view {:style (st/underline-container lineColor) + [view (merge st/text-field-container wrapper-style) + [animated-text {:style (st/label label-top label-font-size label-color)} label] + [text-input {:style (merge st/text-input input-style) + :placeholder "" + :editable editable + :secure-text-entry secure-text-entry + :on-focus #(on-input-focus {:component component + :animation {:top label-top + :to-top (:label-top config) + :font-size label-font-size + :to-font-size (:label-font-small config) + :line-width line-width + :to-line-width max-line-width} + :onFocus on-focus}) + :on-blur #(on-input-blur {:component component + :value value + :animation {:top label-top + :to-top (:label-bottom config) + :font-size label-font-size + :to-font-size (:label-font-large config) + :line-width line-width + :to-line-width 0} + :onBlur on-blur}) + :on-change-text #(on-change-text %) + :on-change #(on-change %)} value] + [view {:style (st/underline-container line-color) :onLayout #(r/set-state component {:max-line-width (get-width %)})} - [animated-view {:style (st/underline focusLineColor line-width)}]] - [text {:style (st/error-text errorColor)} error]])) + [animated-view {:style (st/underline focus-line-color line-width)}]] + [text {:style (st/error-text error-color)} error]])) (defn text-field [data children] (let [component-data {:get-initial-state get-initial-state diff --git a/src/status_im/contacts/screen.cljs b/src/status_im/contacts/screen.cljs index afa572bdc7..3d675f1219 100644 --- a/src/status_im/contacts/screen.cljs +++ b/src/status_im/contacts/screen.cljs @@ -28,17 +28,15 @@ [status-im.components.styles :as cst])) (defn contact-list-toolbar [] - [view - [status-bar] - [toolbar {:nav-action {:image {:source {:uri :icon_hamburger} - :style hamburger-icon} - :handler open-drawer} - :title (label :t/contacts) - :background-color toolbar-background2 - :style {:elevation 0} - :action {:image {:source {:uri :icon_search} - :style icon-search} - :handler (fn [])}}]]) + [toolbar {:nav-action {:image {:source {:uri :icon_hamburger} + :style hamburger-icon} + :handler open-drawer} + :title (label :t/contacts) + :background-color toolbar-background2 + :style {:elevation 0} + :action {:image {:source {:uri :icon_search} + :style icon-search} + :handler (fn [])}}]) (def contacts-limit 10) diff --git a/src/status_im/contacts/styles.cljs b/src/status_im/contacts/styles.cljs index dedf4e8c40..79ca38f7f4 100644 --- a/src/status_im/contacts/styles.cljs +++ b/src/status_im/contacts/styles.cljs @@ -1,8 +1,5 @@ (ns status-im.contacts.styles - (:require [status-im.components.styles :refer [font - font-medium - title-font - text1-color + (:require [status-im.components.styles :refer [text1-color text2-color text3-color text5-color @@ -57,13 +54,11 @@ {:flex 1 :marginLeft 16 :fontSize 14 - :fontFamily font-medium :color text5-color}) (def contact-group-size-text {:marginRight 14 :fontSize 12 - :fontFamily font :color text2-color}) (def contact-group-header-gradient-top @@ -97,7 +92,6 @@ (def show-all-text {:marginLeft 72 :fontSize 14 - :fontFamily font-medium :color text3-color ;; ios only: :letterSpacing 0.5}) @@ -113,7 +107,6 @@ (def letter-text {:fontSize 24 - :fontFamily font :color text3-color}) (def contact-photo-container @@ -134,13 +127,11 @@ (def name-text {:fontSize 16 - :fontFamily font :color text1-color}) (def info-text {:marginTop 1 :fontSize 12 - :fontFamily font :color text2-color}) (def more-btn diff --git a/src/status_im/contacts/views/new_contact.cljs b/src/status_im/contacts/views/new_contact.cljs index 5efe031f6c..183b0d8131 100644 --- a/src/status_im/contacts/views/new_contact.cljs +++ b/src/status_im/contacts/views/new_contact.cljs @@ -12,7 +12,7 @@ [status-im.utils.identicon :refer [identicon]] [status-im.components.status-bar :refer [status-bar]] [status-im.components.toolbar :refer [toolbar]] - [status-im.utils.utils :refer [log on-error http-post toast]] + [status-im.utils.utils :refer [log http-post]] [status-im.components.styles :refer [color-purple color-white icon-search @@ -72,14 +72,14 @@ (label :t/enter-valid-address))] [view button-input-container [text-field - {:error error - :errorColor "#7099e6" - :value whisper-identity - :wrapperStyle (merge button-input) - :label (label :t/address) - :onChangeText #(do - (dispatch [:set-in [:new-contact-identity] %]) - (dispatch [:set :new-contact-address-error nil]))}] + {:error error + :error-color "#7099e6" + :value whisper-identity + :wrapper-style (merge button-input) + :label (label :t/address) + :on-change-text #(do + (dispatch [:set-in [:new-contact-identity] %]) + (dispatch [:set :new-contact-address-error nil]))}] [scan-button {:showLabel (zero? (count whisper-identity)) :handler #(dispatch [:scan-qr-code {:toolbar-title (label :t/new-contact)} :set-contact-identity-from-qr])}]])) diff --git a/src/status_im/discovery/screen.cljs b/src/status_im/discovery/screen.cljs index 0e6b468c66..e409baed0b 100644 --- a/src/status_im/discovery/screen.cljs +++ b/src/status_im/discovery/screen.cljs @@ -7,7 +7,6 @@ scroll-view text text-input]] - [status-im.components.status-bar :refer [status-bar]] [status-im.components.toolbar :refer [toolbar]] [status-im.components.drawer.view :refer [open-drawer]] [status-im.discovery.views.popular :refer [discovery-popular]] @@ -40,17 +39,15 @@ (dispatch [:set ::show-search? (not current-value)])) (defn discovery-toolbar [show-search?] - [view - [status-bar] - [toolbar - {:style st/discovery-toolbar - :nav-action {:image {:source {:uri :icon_hamburger} - :style st/hamburger-icon} - :handler open-drawer} - :custom-content [title-content show-search?] - :action {:image {:source {:uri :icon_search} - :style st/search-icon} - :handler #(toogle-search show-search?)}}]]) + [toolbar + {:style st/discovery-toolbar + :nav-action {:image {:source {:uri :icon_hamburger} + :style st/hamburger-icon} + :handler open-drawer} + :custom-content [title-content show-search?] + :action {:image {:source {:uri :icon_search} + :style st/search-icon} + :handler #(toogle-search show-search?)}}]) (defview discovery [] [show-search? [:get ::show-search?] diff --git a/src/status_im/group_settings/styles/group_settings.cljs b/src/status_im/group_settings/styles/group_settings.cljs index 6b7a79313e..f951648497 100644 --- a/src/status_im/group_settings/styles/group_settings.cljs +++ b/src/status_im/group_settings/styles/group_settings.cljs @@ -1,16 +1,13 @@ (ns status-im.group-settings.styles.group-settings - (:require [status-im.components.styles :refer [font - font-medium - title-font - color-white - color-purple - chat-background - online-color - selected-message-color - separator-color - text1-color - text2-color - toolbar-background1]])) + (:require [status-im.components.styles :refer [color-white + color-purple + chat-background + online-color + selected-message-color + separator-color + text1-color + text2-color + toolbar-background1]])) (def modal-container {:flex 1 @@ -25,14 +22,12 @@ (def modal-member-name {:color text2-color - :fontFamily font :fontSize 14 :lineHeight 20}) (def modal-remove-text {:margin 10 :color text1-color - :fontFamily font :fontSize 14 :lineHeight 20}) @@ -45,7 +40,6 @@ {:margin 10 :alignSelf :center :color text1-color - :fontFamily font :fontSize 14 :lineHeight 20}) @@ -72,7 +66,6 @@ :marginLeft 16 :marginBottom 16 :color text2-color - :fontFamily font-medium :fontSize 14 :lineHeight 20}) @@ -88,7 +81,6 @@ (def chat-name-value {:flex 1 :fontSize 16 - :fontFamily font :color text1-color}) (def chat-name-validation-message @@ -103,7 +95,6 @@ (def chat-name-btn-edit-text {:color text2-color - :fontFamily font :fontSize 16 :lineHeight 20}) @@ -112,7 +103,6 @@ :marginLeft 16 :marginBottom 16 :color text2-color - :fontFamily font-medium :fontSize 14 :lineHeight 20}) @@ -130,7 +120,6 @@ {:marginTop 18 :marginLeft 32 :color text2-color - :fontFamily font :fontSize 16 :lineHeight 20}) @@ -139,7 +128,6 @@ :marginLeft 16 :marginBottom 16 :color text2-color - :fontFamily font-medium :fontSize 14 :lineHeight 20}) @@ -165,14 +153,12 @@ (def setting-title {:marginTop -2.5 :color text1-color - :fontSize 16 - :fontFamily font}) + :fontSize 16}) (def setting-subtitle {:marginTop 1 :color text2-color - :fontSize 12 - :fontFamily font}) + :fontSize 12}) (defn chat-color-icon [color] {:borderRadius 12 diff --git a/src/status_im/handlers/server.cljs b/src/status_im/handlers/server.cljs index 2eaee570fe..b01777c94e 100644 --- a/src/status_im/handlers/server.cljs +++ b/src/status_im/handlers/server.cljs @@ -1,6 +1,6 @@ (ns status-im.handlers.server (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] - [status-im.utils.utils :refer [on-error http-post]] + [status-im.utils.utils :refer [http-post]] [taoensso.timbre :as log])) (defn sign-up diff --git a/src/status_im/ios/core.cljs b/src/status_im/ios/core.cljs index 03b722179f..776c31c8b1 100644 --- a/src/status_im/ios/core.cljs +++ b/src/status_im/ios/core.cljs @@ -22,7 +22,6 @@ [status-im.group-settings.screen :refer [group-settings]] [status-im.profile.screen :refer [profile my-profile]] [status-im.profile.photo-capture.screen :refer [profile-photo-capture]] - [status-im.utils.utils :refer [toast]] status-im.persistence.realm.core [taoensso.timbre :as log])) @@ -46,13 +45,13 @@ #(dispatch [:set :orientation (orientation->keyword %)])) (.lockToPortrait orientation) (.addListener keyboard - "keyboardDidShow" + "keyboardWillShow" (fn [e] (let [h (.. e -endCoordinates -height)] (when-not (= h @keyboard-height) (dispatch [:set :keyboard-height h]))))) (.addListener keyboard - "keyboardDidHide" + "keyboardWillHide" (when-not (= 0 @keyboard-height) #(dispatch [:set :keyboard-height 0])))) :render diff --git a/src/status_im/ios/platform.cljs b/src/status_im/ios/platform.cljs index 03de3a16e2..dabfb79eec 100644 --- a/src/status_im/ios/platform.cljs +++ b/src/status_im/ios/platform.cljs @@ -1,12 +1,14 @@ (ns status-im.ios.platform (:require [status-im.components.styles :as styles] - [status-im.utils.utils :as u] - [reagent.core :as r])) + [status-im.utils.utils :as u])) (def component-styles {:status-bar {:default {:height 20 :bar-style "default" :color styles/color-white} + :main {:height 20 + :bar-style "default" + :color styles/toolbar-background2} :transparent {:height 20 :bar-style "light-content" :color styles/color-transparent}} @@ -15,7 +17,8 @@ :actions-list-view {:border-bottom-color styles/color-gray3 :border-bottom-width 0.5} :chat {:new-message {:border-top-color styles/color-gray3 - :border-top-width 0.5}}}) + :border-top-width 0.5}} + :bottom-gradient {:height 1}}) (def fonts {:default {:font-family "SFUIDisplay-Regular"} @@ -27,7 +30,7 @@ (def react-native (u/require "react-native")) (defn show-action-sheet [{:keys [options callback cancel-text]}] - (.showActionSheetWithOptions (r/adapt-react-class (.-ActionSheetIOS react-native)) + (.showActionSheetWithOptions (.-ActionSheetIOS react-native) (clj->js {:options (conj options cancel-text) :cancelButtonIndex (count options)}) callback)) diff --git a/src/status_im/navigation/handlers.cljs b/src/status_im/navigation/handlers.cljs index 73a9717b75..675b47d3f9 100644 --- a/src/status_im/navigation/handlers.cljs +++ b/src/status_im/navigation/handlers.cljs @@ -78,7 +78,7 @@ (register-handler :show-profile show-profile) (defn show-profile-photo-capture - [db [_ image-captured-fn]] + [db _] (push-view db :profile-photo-capture)) (register-handler :show-profile-photo-capture show-profile-photo-capture) diff --git a/src/status_im/new_group/styles.cljs b/src/status_im/new_group/styles.cljs index 3d15673453..6473fbda41 100644 --- a/src/status_im/new_group/styles.cljs +++ b/src/status_im/new_group/styles.cljs @@ -1,11 +1,9 @@ (ns status-im.new-group.styles - (:require [status-im.components.styles :refer [font - title-font - color-white - color-purple - text1-color - text2-color - toolbar-background1]])) + (:require [status-im.components.styles :refer [color-white + color-purple + text1-color + text2-color + toolbar-background1]])) (defn toolbar-icon [enabled?] {:width 20 @@ -24,14 +22,12 @@ {:marginTop 24 :marginBottom 16 :color text2-color - :fontFamily font :fontSize 14 :lineHeight 20}) (def group-name-input {:marginLeft -4 :fontSize 14 - :fontFamily font :color text1-color}) (def group-name-validation-message @@ -41,7 +37,6 @@ {:marginTop 24 :marginBottom 16 :color text2-color - :fontFamily font :fontSize 14 :lineHeight 20}) @@ -59,7 +54,6 @@ {:marginTop 18 :marginLeft 32 :color text2-color - :fontFamily font :fontSize 14 :lineHeight 20}) diff --git a/src/status_im/profile/handlers.cljs b/src/status_im/profile/handlers.cljs index e54d6eeff4..9e7ee756a4 100644 --- a/src/status_im/profile/handlers.cljs +++ b/src/status_im/profile/handlers.cljs @@ -5,6 +5,7 @@ [status-im.utils.image-processing :refer [img->base64]] [status-im.i18n :refer [label]] [status-im.utils.handlers :as u :refer [get-hashtags]] + [status-im.utils.platform :refer [ios?]] [clojure.string :as str])) (defn message-user [identity] @@ -36,9 +37,8 @@ (fn [_ _] (show-image-picker (fn [image] - (let [path (-> (js->clj image) - (get "path") - (subs 7)) + (let [path (get (js->clj image) "path") + path (if ios? path (subs path 12)) on-success (fn [base64] (dispatch [:set-in [:profile-edit :photo-path] (str "data:image/jpeg;base64," base64)])) on-error (fn [type error] diff --git a/src/status_im/profile/photo_capture/screen.cljs b/src/status_im/profile/photo_capture/screen.cljs index f555f7d736..548d3479d9 100644 --- a/src/status_im/profile/photo_capture/screen.cljs +++ b/src/status_im/profile/photo_capture/screen.cljs @@ -2,6 +2,7 @@ (:require [re-frame.core :refer [subscribe dispatch dispatch-sync]] [clojure.walk :refer [keywordize-keys]] [status-im.components.react :refer [view + text image touchable-highlight]] [status-im.components.camera :refer [camera diff --git a/src/status_im/profile/styles.cljs b/src/status_im/profile/styles.cljs index ea52973aae..1972032348 100644 --- a/src/status_im/profile/styles.cljs +++ b/src/status_im/profile/styles.cljs @@ -1,6 +1,5 @@ (ns status-im.profile.styles - (:require [status-im.components.styles :refer [font - color-light-blue-transparent + (:require [status-im.components.styles :refer [color-light-blue-transparent color-white color-black color-blue @@ -66,7 +65,9 @@ (def status-block {:flex-direction "column" :align-items "center" - :justifyContent "center"}) + :justifyContent "center" + :margin-left 100 + :margin-right 100}) (def status-input {:align-self "stretch" @@ -94,7 +95,6 @@ (def message-btn-text {:margin-top -2.5 :font-size 14 - :font-family font :color color-white}) (def more-btn @@ -144,7 +144,6 @@ (def report-user-text {:font-size 14 - :font-family font :line-height 21 :color text2-color ;; IOS: diff --git a/src/status_im/transactions/screen.cljs b/src/status_im/transactions/screen.cljs index bcce69049d..b3ce433604 100644 --- a/src/status_im/transactions/screen.cljs +++ b/src/status_im/transactions/screen.cljs @@ -48,15 +48,15 @@ [transaction-page transaction]))]] [view st/form-container [text-field - {:inputStyle st/password-style - :secureTextEntry true - :error (when wrong-password? (label :t/wrong-password)) - :errorColor :#ffffff80 #_:#7099e6 - :lineColor :white - :labelColor :#ffffff80 - :value password - :label (label :t/password) - :onChangeText #(dispatch [:set-in [:confirm-transactions :password] %])}]]]) + {:input-style st/password-style + :secure-text-entry true + :error (when wrong-password? (label :t/wrong-password)) + :error-color :#ffffff80 #_:#7099e6 + :line-color :white + :label-color :#ffffff80 + :value password + :label (label :t/password) + :on-change-text #(dispatch [:set-in [:confirm-transactions :password] %])}]]]) ;(re-frame.core/dispatch [:set :view-id :confirm]) diff --git a/src/status_im/transactions/styles.cljs b/src/status_im/transactions/styles.cljs index 1b105fedac..cc0b3704d0 100644 --- a/src/status_im/transactions/styles.cljs +++ b/src/status_im/transactions/styles.cljs @@ -37,8 +37,7 @@ :justifyContent :center}) (def title-bar-text - {:fontFamily "sans-serif-medium" - :color "#838c93" + {:color "#838c93" :fontSize 13 :marginLeft 12}) diff --git a/src/status_im/utils/image_processing.cljs b/src/status_im/utils/image_processing.cljs index 075e1c9b80..36927fefbd 100644 --- a/src/status_im/utils/image_processing.cljs +++ b/src/status_im/utils/image_processing.cljs @@ -19,7 +19,7 @@ (defn img->base64 [path on-success on-error] (let [on-resized (fn [path] - (image-base64-encode (subs path 5) on-success on-error)) + (image-base64-encode path on-success on-error)) on-error (fn [error] (on-error :resize error))] (resize path 150 150 on-resized on-error))) \ No newline at end of file diff --git a/src/status_im/utils/utils.cljs b/src/status_im/utils/utils.cljs index 91b19d43cd..c49642af28 100644 --- a/src/status_im/utils/utils.cljs +++ b/src/status_im/utils/utils.cljs @@ -1,8 +1,6 @@ (ns status-im.utils.utils (:require-macros - [natal-shell.async-storage :refer [get-item set-item]] - [natal-shell.alert :refer [alert]] - [natal-shell.toast-android :as toast]) + [natal-shell.async-storage :refer [get-item set-item]]) (:require [status-im.constants :as const])) (defn require [module] @@ -13,11 +11,12 @@ (defn log [obj] (.log js/console obj)) -(defn toast [s] - (toast/show s (toast/long))) +(def react-native (require "react-native")) -(defn on-error [error] - (toast (str "error: " error))) +(defn show-popup [title content] + (.alert (.-Alert react-native) + title + content)) (defn http-post ([action data on-success] @@ -38,7 +37,7 @@ (on-success obj)))) (.catch (or on-error (fn [error] - (toast (str error)))))))) + (show-popup "Error" (str error)))))))) (defn http-get ([url on-success on-error] @@ -49,7 +48,7 @@ (.then on-success) (.catch (or on-error (fn [error] - (toast (str error)))))))) + (show-popup "Error" (str error)))))))) (defn truncate-str [s max] (if (and (< max (count s)) s)