Upgrade to React Native 0.43 (#1079)

* React Native 0.40 migration (#1076)
This commit is contained in:
Alexander Pantyuhov 2017-04-24 17:50:16 +03:00 committed by Roman Volosovskyi
parent 19748e0455
commit 8c262d0b07
33 changed files with 199 additions and 150 deletions

View File

@ -36,7 +36,6 @@
"eccjs",
"chance",
"react-native-swiper",
"react-native-share",
"react-native-emoji-picker",
"react-native-autolink",
"instabug-reactnative",

View File

@ -181,7 +181,6 @@ dependencies {
compile project(':react-native-fs')
compile project(':react-native-image-crop-picker')
compile project(':react-native-webview-bridge')
compile project(':react-native-share')
compile fileTree(dir: "node_modules/realm/android/libs", include: ["*.jar"])
}

View File

@ -27,7 +27,6 @@ import com.aakashns.reactnativedialogs.ReactNativeDialogsPackage;
import fr.bamlab.rnimageresizer.ImageResizerPackage;
import com.reactnative.ivpusic.imagepicker.PickerPackage;
import com.github.alinz.reactnativewebviewbridge.WebViewBridgePackage;
import cl.json.RNSharePackage;
import java.util.Arrays;
import java.util.List;
@ -36,7 +35,7 @@ public class MainApplication extends Application implements ReactApplication {
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
public boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}
@ -63,8 +62,7 @@ public class MainApplication extends Application implements ReactApplication {
new ReactNativeDialogsPackage(),
new ImageResizerPackage(),
new PickerPackage(),
new WebViewBridgePackage(),
new RNSharePackage()
new WebViewBridgePackage()
);
}
};

View File

@ -43,6 +43,3 @@ project(':react-native-image-crop-picker').projectDir = new File(settingsDir, '.
include ':react-native-webview-bridge'
project(':react-native-webview-bridge').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-webview-bridge/android')
include ':react-native-share'
project(':react-native-share').projectDir = new File(rootProject.projectDir, '../node_modules/react-native-share/android')

View File

@ -51,7 +51,6 @@
9ED2F45F1D9D535A00B36508 /* SF-UI-Text-Medium.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9ED2F45C1D9D52C100B36508 /* SF-UI-Text-Medium.otf */; };
9ED2F4611D9D579900B36508 /* SF-UI-Text-Bold.otf in Resources */ = {isa = PBXBuildFile; fileRef = 9ED2F4601D9D577B00B36508 /* SF-UI-Text-Bold.otf */; };
9EE89E271E03FCB7007D3C25 /* libSplashScreen.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B24FC7F21DE718EF00D694FF /* libSplashScreen.a */; };
9EE89E291E03FD3D007D3C25 /* libRNShare.a in Frameworks */ = {isa = PBXBuildFile; fileRef = B24FC7FA1DE7190C00D694FF /* libRNShare.a */; };
9EE89E2D1E03FD9F007D3C25 /* libimageCropPicker.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 20A5C9531D927137002C4965 /* libimageCropPicker.a */; };
A6AF670051B842249D520C7B /* Foundation.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 7ED174A34D7D42358313368B /* Foundation.ttf */; };
AD5063BC2B2A4C52ACE0A0B4 /* libUdpSockets.a in Frameworks */ = {isa = PBXBuildFile; fileRef = A96279092BEC4C4B93914F48 /* libUdpSockets.a */; };
@ -326,13 +325,6 @@
remoteGlobalIDString = 3D7682761D8E76B80014119E;
remoteInfo = SplashScreen;
};
B24FC7F91DE7190C00D694FF /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B24FC7F51DE7190C00D694FF /* RNShare.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 134814201AA4EA6300B7C361;
remoteInfo = RNShare;
};
B2A5F4371DEC36B200174F4D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = B2A5F42F1DEC36B200174F4D /* RCTAnimation.xcodeproj */;
@ -347,6 +339,48 @@
remoteGlobalIDString = 2D2A28201D9B03D100D4039D;
remoteInfo = "RCTAnimation-tvOS";
};
B2BC5D881EADD18B00A140D0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3C059A1DE3340900C268FA;
remoteInfo = yoga;
};
B2BC5D8A1EADD18B00A140D0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3C06751DE3340C00C268FA;
remoteInfo = "yoga-tvOS";
};
B2BC5D8C1EADD18B00A140D0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3CD9251DE5FBEC00167DC4;
remoteInfo = cxxreact;
};
B2BC5D8E1EADD18B00A140D0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3CD9321DE5FBEE00167DC4;
remoteInfo = "cxxreact-tvOS";
};
B2BC5D901EADD18B00A140D0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3CD90B1DE5FBD600167DC4;
remoteInfo = jschelpers;
};
B2BC5D921EADD18B00A140D0 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 146833FF1AC3E56700842450 /* React.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 3D3CD9181DE5FBD800167DC4;
remoteInfo = "jschelpers-tvOS";
};
B2D090C71E6839D7005BD157 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = F93B6663A59F4B26BD4DA525 /* RNNetworkInfo.xcodeproj */;
@ -455,7 +489,6 @@
A96279092BEC4C4B93914F48 /* libUdpSockets.a */ = {isa = PBXFileReference; explicitFileType = undefined; fileEncoding = 9; includeInIndex = 0; lastKnownFileType = archive.ar; path = libUdpSockets.a; sourceTree = "<group>"; };
ACA66A8F16CD2FE21F38738B /* Pods-StatusIm.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-StatusIm.debug.xcconfig"; path = "Pods/Target Support Files/Pods-StatusIm/Pods-StatusIm.debug.xcconfig"; sourceTree = "<group>"; };
B23B48FE1E76917B006D4535 /* RobotoMono-Medium.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "RobotoMono-Medium.ttf"; sourceTree = "<group>"; };
B24FC7F51DE7190C00D694FF /* RNShare.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RNShare.xcodeproj; path = "../node_modules/react-native-share/ios/RNShare.xcodeproj"; sourceTree = "<group>"; };
B24FC7FC1DE7195700D694FF /* Social.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Social.framework; path = System/Library/Frameworks/Social.framework; sourceTree = SDKROOT; };
B24FC7FE1DE7195F00D694FF /* MessageUI.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = MessageUI.framework; path = System/Library/Frameworks/MessageUI.framework; sourceTree = SDKROOT; };
B2A5F42F1DEC36B200174F4D /* RCTAnimation.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTAnimation.xcodeproj; path = "../node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj"; sourceTree = "<group>"; };
@ -493,7 +526,6 @@
B2A5F45C1DEC36BB00174F4D /* libRCTAnimation.a in Frameworks */,
B24FC7FF1DE7195F00D694FF /* MessageUI.framework in Frameworks */,
B24FC7FD1DE7195700D694FF /* Social.framework in Frameworks */,
9EE89E291E03FD3D007D3C25 /* libRNShare.a in Frameworks */,
9EE89E2D1E03FD9F007D3C25 /* libimageCropPicker.a in Frameworks */,
9E3AB6D01D87DB2B008846B4 /* libReact-Native-Webview-Bridge.a in Frameworks */,
20B6B6841D92C42600CC5C6A /* RSKImageCropper.framework in Frameworks */,
@ -627,7 +659,13 @@
isa = PBXGroup;
children = (
146834041AC3E56700842450 /* libReact.a */,
9E3F1C0B1DDAE781005E4779 /* libReact-tvOS.a */,
9E3F1C0B1DDAE781005E4779 /* libReact.a */,
B2BC5D891EADD18B00A140D0 /* libyoga.a */,
B2BC5D8B1EADD18B00A140D0 /* libyoga.a */,
B2BC5D8D1EADD18B00A140D0 /* libcxxreact.a */,
B2BC5D8F1EADD18B00A140D0 /* libcxxreact.a */,
B2BC5D911EADD18B00A140D0 /* libjschelpers.a */,
B2BC5D931EADD18B00A140D0 /* libjschelpers.a */,
);
name = Products;
sourceTree = "<group>";
@ -796,7 +834,6 @@
B2DEA0A41E49E32000FA28D6 /* RCTHttpServer.xcodeproj */,
9EC0135C1E06FB1900155B5C /* RCTWKWebView.xcodeproj */,
B2A5F42F1DEC36B200174F4D /* RCTAnimation.xcodeproj */,
B24FC7F51DE7190C00D694FF /* RNShare.xcodeproj */,
3A7EB0491DD9CABC00A4FCC8 /* SplashScreen.xcodeproj */,
20A5C94B1D927137002C4965 /* imageCropPicker.xcodeproj */,
9E3AB6B21D87DA2A008846B4 /* React-Native-Webview-Bridge.xcodeproj */,
@ -912,14 +949,6 @@
name = Products;
sourceTree = "<group>";
};
B24FC7F61DE7190C00D694FF /* Products */ = {
isa = PBXGroup;
children = (
B24FC7FA1DE7190C00D694FF /* libRNShare.a */,
);
name = Products;
sourceTree = "<group>";
};
B2A5F4301DEC36B200174F4D /* Products */ = {
isa = PBXGroup;
children = (
@ -989,7 +1018,7 @@
20B6B6891D92C42700CC5C6A /* Embed Frameworks */,
9E71BA90038083A3D24E18E9 /* [CP] Embed Pods Frameworks */,
E883D1F9B22B8292CC879292 /* [CP] Copy Pods Resources */,
E3914A731DF919ED00EBB515 /* ShellScript */,
E3914A731DF919ED00EBB515 /* Run Script */,
);
buildRules = (
);
@ -1140,10 +1169,6 @@
ProductGroup = 20B7D0F01D3F74CC00B70F14 /* Products */;
ProjectRef = 45FB5F523DE04BDE9877869C /* RNRandomBytes.xcodeproj */;
},
{
ProductGroup = B24FC7F61DE7190C00D694FF /* Products */;
ProjectRef = B24FC7F51DE7190C00D694FF /* RNShare.xcodeproj */;
},
{
ProductGroup = 20B7D0FF1D3F74CD00B70F14 /* Products */;
ProjectRef = 8AE71EE8751F4652B13BFE83 /* RNVectorIcons.xcodeproj */;
@ -1387,10 +1412,10 @@
remoteRef = 9E3F1C051DDAE781005E4779 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
9E3F1C0B1DDAE781005E4779 /* libReact-tvOS.a */ = {
9E3F1C0B1DDAE781005E4779 /* libReact.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libReact-tvOS.a";
path = libReact.a;
remoteRef = 9E3F1C0A1DDAE781005E4779 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
@ -1415,13 +1440,6 @@
remoteRef = B24FC7F11DE718EF00D694FF /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B24FC7FA1DE7190C00D694FF /* libRNShare.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libRNShare.a;
remoteRef = B24FC7F91DE7190C00D694FF /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B2A5F4381DEC36B200174F4D /* libRCTAnimation.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1436,6 +1454,48 @@
remoteRef = B2A5F4391DEC36B200174F4D /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B2BC5D891EADD18B00A140D0 /* libyoga.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libyoga.a;
remoteRef = B2BC5D881EADD18B00A140D0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B2BC5D8B1EADD18B00A140D0 /* libyoga.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libyoga.a;
remoteRef = B2BC5D8A1EADD18B00A140D0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B2BC5D8D1EADD18B00A140D0 /* libcxxreact.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libcxxreact.a;
remoteRef = B2BC5D8C1EADD18B00A140D0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B2BC5D8F1EADD18B00A140D0 /* libcxxreact.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libcxxreact.a;
remoteRef = B2BC5D8E1EADD18B00A140D0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B2BC5D911EADD18B00A140D0 /* libjschelpers.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libjschelpers.a;
remoteRef = B2BC5D901EADD18B00A140D0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B2BC5D931EADD18B00A140D0 /* libjschelpers.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = libjschelpers.a;
remoteRef = B2BC5D921EADD18B00A140D0 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
B2D090C81E6839D7005BD157 /* libRNNetworkInfo.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
@ -1585,13 +1645,14 @@
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-StatusIm/Pods-StatusIm-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
E3914A731DF919ED00EBB515 /* ShellScript */ = {
E3914A731DF919ED00EBB515 /* Run Script */ = {
isa = PBXShellScriptBuildPhase;
buildActionMask = 2147483647;
files = (
);
inputPaths = (
);
name = "Run Script";
outputPaths = (
);
runOnlyForDeploymentPostprocessing = 0;

View File

@ -3,9 +3,23 @@
LastUpgradeVersion = "0620"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
parallelizeBuildables = "NO"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "83CBBA2D1A601D0E00E9B192"
BuildableName = "libReact.a"
BlueprintName = "React"
ReferencedContainer = "container:../node_modules/react-native/React/React.xcodeproj">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"

View File

@ -1,6 +1,6 @@
#import "RCTStatus.h"
#import "RCTBridge.h"
#import "RCTEventDispatcher.h"
#import "React/RCTBridge.h"
#import "React/RCTEventDispatcher.h"
#import <Statusgo/Statusgo.h>
static bool isStatusInitialized;

View File

@ -12,8 +12,8 @@
"dependencies": {
"assert": "^1.4.1",
"awesome-phonenumber": "^1.0.13",
"babel-core": "6.20.0",
"babel-generator": "6.20.0",
"babel-core": "6.24.1",
"babel-generator": "6.24.1",
"babel-helper-builder-react-jsx": "6.18.0",
"babel-plugin-transform-es2015-block-scoping": "6.15.0",
"babel-plugin-transform-es2015-parameters": "6.18.0",
@ -40,45 +40,45 @@
"process": "^0.11.5",
"punycode": "^1.4.1",
"querystring-es3": "^0.2.1",
"re-natal": "0.2.38",
"react": "^15.3.1",
"react-dom": "15.3.1",
"react-native": "^0.38.0",
"react-native-action-button": "2.0.13",
"re-natal": "^0.3.7",
"react": "^16.0.0-alpha.6",
"react-dom": "15.5.4",
"react-native": "^0.43.4",
"react-native-action-button": "^2.0.13",
"react-native-android-sms-listener": "github:adrian-tiberius/react-native-android-sms-listener#listener-bugfix",
"react-native-autolink": "^0.10.0",
"react-native-camera": "git+https://github.com/alwx/react-native-camera.git",
"react-native-camera": "^0.7.0",
"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.3",
"react-native-emoji-picker": "git+https://github.com/alwx/react-native-emoji-picker.git",
"react-native-fs": "^1.5.1",
"react-native-fs": "^2.1.0-rc.1",
"react-native-http": "github:tradle/react-native-http#834492d",
"react-native-http-bridge": "^0.2.2",
"react-native-http-bridge": "^0.3.0",
"react-native-i18n": "0.0.8",
"react-native-image-crop-picker": "^0.9.4",
"react-native-image-resizer": "github:danieldunderfelt/react-native-image-resizer",
"react-native-image-crop-picker": "^0.12.10",
"react-native-image-resizer": "^0.1.0",
"react-native-invertible-scroll-view": "^1.0.0",
"react-native-level-fs": "^2.0.1",
"react-native-linear-gradient": "1.5.7",
"react-native-linear-gradient": "2.0.0",
"react-native-network-info": "github:alwx/react-native-network-info",
"react-native-orientation": "github:youennPennarun/react-native-orientation",
"react-native-popup-menu": "^0.7.1",
"react-native-qrcode": "^0.2.2",
"react-native-randombytes": "^2.1.0",
"react-native-share": "1.0.17",
"react-native-sortable-listview": "^0.1.1",
"react-native-splash-screen": "1.0.9",
"react-native-swiper": "1.5.3",
"react-native-tcp": "^2.0.4",
"react-native-udp": "^1.2.6",
"react-native-vector-icons": "^2.0.3",
"react-native-webview-bridge": "github:status-im/react-native-webview-bridge#0.33.10",
"react-native-tcp": "^3.2.1",
"react-native-udp": "^2.0.0",
"react-native-vector-icons": "^4.0.1",
"react-native-webview-bridge": "github:status-im/react-native-webview-bridge#react-native-0.40",
"readable-stream": "^1.0.33",
"realm": "^0.14.3",
"stream-browserify": "^1.0.0",
"string_decoder": "^0.10.31",
"timers-browserify": "^1.4.2",
"tty-browserify": "0.0.0",
"url": "^0.10.3",

View File

@ -3,8 +3,9 @@
# 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@15.3.1;
npm install --save react-native-tcp@2.0.4;
npm install --save react@16.0.0-alpha.6;
npm install --save react-native-tcp@3.2.1;
npm install --save react-native-udp@2.0.0;
# symlink for re-natal
if ! [ -f re-natal ]; then

View File

@ -173,7 +173,7 @@
:renderScrollComponent #(invertible-scroll-view (js->clj %))
:onEndReached (when-not loaded? #(dispatch [:load-more-messages]))
:enableEmptySections true
:keyboardShouldPersistTaps true
:keyboardShouldPersistTaps :always
:dataSource (to-datasource-inverted messages)}]))
(defview chat []

View File

@ -49,7 +49,7 @@
[icon :input_list style/commands-list-icon])]]]
[scroll-view {:horizontal true
:showsHorizontalScrollIndicator false
:keyboardShouldPersistTaps true}
:keyboardShouldPersistTaps :always}
(let [requests-names (map :type requests)
all-commands (merge (into {} commands) (select-keys responses requests-names))
all-commands-indexed (map-indexed vector (vals all-commands))]

View File

@ -58,7 +58,7 @@
:draggable? false
:height 212}
[view {:flex 1}
[scroll-view {:keyboardShouldPersistTaps true}
[scroll-view {:keyboardShouldPersistTaps :always}
(when (seq requests)
[view
[item-title false (label :t/suggestions-requests)]

View File

@ -10,7 +10,6 @@
text
icon
image
linear-gradient
touchable-highlight]]
[status-im.components.native-action-button :refer [native-action-button]]
[status-im.components.drawer.view :refer [open-drawer]]
@ -69,8 +68,8 @@
[native-action-button {:button-color color-blue
:offset-x 16
:offset-y 22
:hide-shadow true
:spacing 13
:hide-shadow true
:on-press #(dispatch [:navigate-to :new-chat])}])
(defview chats-list []
@ -89,7 +88,7 @@
:renderHeader renderers/list-header-renderer
:renderFooter #(list-item [view
[common/list-footer]
[common/bottom-shaddow]])
[common/bottom-shadow]])
:renderSeparator renderers/list-separator-renderer
:style (st/list-container tabs-hidden?)}]
(when (and (not edit?)

View File

@ -5,7 +5,6 @@
text
image
icon]]
[status-im.components.icons.custom-icons :refer [oct-icon]]
[status-im.components.chat-icon.styles :as st]
[status-im.components.styles :refer [default-chat-color]]
[status-im.resources :as resources]
@ -33,17 +32,6 @@
[view online-dot-left]
[view online-dot-right]]]])
(defn contact-badge [type styles]
(when (= type :edit)
[view (:online-view styles)
(case type
:online [view
[view (:online-dot-left styles)]
[view (:online-dot-right styles)]]
:edit [view
[oct-icon {:name :pencil
:style st/photo-pencil}]])]))
(defview pending-contact-badge
[chat-id {:keys [pending-wrapper pending-outer-circle pending-inner-circle]}]
[pending-contact? [:get-in [:contacts chat-id :pending?]]]

View File

@ -4,17 +4,17 @@
[status-im.utils.platform :as p]
[status-im.components.common.styles :as st]))
(defn top-shaddow []
(defn top-shadow []
(when p/android?
[linear-gradient
{:style st/gradient-bottom
:colors st/gradient-bottom-colors}]))
:colors st/gradient-top-colors}]))
(defn bottom-shaddow []
(defn bottom-shadow []
(when p/android?
[linear-gradient
{:style st/gradient-top
:colors st/gradient-top-colors}]))
:colors st/gradient-bottom-colors}]))
(defn separator [style & [wrapper-style]]
[view (merge st/separator-wrapper wrapper-style)
@ -22,9 +22,9 @@
(defn form-spacer []
[view
[bottom-shaddow]
[bottom-shadow]
[view st/form-spacer]
[top-shaddow]])
[top-shadow]])
(defn list-separator []
[separator st/list-separator])
@ -54,4 +54,4 @@
[context-menu
[icon :options_gray]
options]])]
[top-shaddow]])
[top-shadow]])

View File

@ -13,9 +13,8 @@
:backgroundColor color-light-gray})
(def gradient-top-colors
["rgba(24, 52, 76, 0.165)"
"rgba(24, 52, 76, 0.03)"
"rgba(24, 52, 76, 0.01)"])
["rgba(25, 53, 76, 0.01)"
"rgba(25, 53, 76, 0.1)"])
(def gradient-bottom
{:flexDirection :row
@ -23,8 +22,8 @@
:backgroundColor color-light-gray})
(def gradient-bottom-colors
["rgba(24, 52, 76, 0.01)"
"rgba(24, 52, 76, 0.05)"])
["rgba(25, 53, 76, 0.1)"
"rgba(25, 53, 76, 0.01)"])
(def separator-wrapper
{:background-color color-white})

View File

@ -2,7 +2,4 @@
(:require [reagent.core :as r]))
(def ion-icon
(r/adapt-react-class (js/require "react-native-vector-icons/Ionicons")))
(def oct-icon
(r/adapt-react-class (js/require "react-native-vector-icons/Octicons")))
(r/adapt-react-class (.-default (js/require "react-native-vector-icons/Ionicons"))))

View File

@ -1,18 +1,19 @@
(ns status-im.components.list-selection
(:require [re-frame.core :refer [dispatch]]
[status-im.components.react :refer [copy-to-clipboard
sharing
linking]]
[status-im.utils.platform :refer [platform-specific]]
[status-im.i18n :refer [label]]))
(def class (js/require "react-native-share"))
(defn open [opts]
(.open class (clj->js opts)))
(.share sharing (clj->js opts)))
(defn share-options [text]
[{:text (label :t/sharing-copy-to-clipboard) :value #(copy-to-clipboard text)}
{:text (label :t/sharing-share) :value #(open {:message text})}])
[{:text (label :t/sharing-copy-to-clipboard)
:value #(copy-to-clipboard text)}
{:text (label :t/sharing-share)
:value #(open {:message text})}])
(defn share [text dialog-title]
(let [list-selection-fn (:list-selection-fn platform-specific)]

View File

@ -9,8 +9,6 @@
(def react-native (js/require "react-native"))
(def native-modules (.-NativeModules react-native))
(def device-event-emitter (.-DeviceEventEmitter react-native))
(def linear-gradient-module (js/require "react-native-linear-gradient"))
(def dismiss-keyboard! (js/require "dismissKeyboard"))
(def orientation (js/require "react-native-orientation"))
(def back-android (get-react-property "BackAndroid"))
@ -23,7 +21,6 @@
(def app-registry (get-react-property "AppRegistry"))
(def navigator (get-class "Navigator"))
(def view (get-class "View"))
(def linear-gradient-class (adapt-class linear-gradient-module))
(def status-bar (get-class "StatusBar"))
(def drawer-layout (adapt-class drawer))
@ -108,9 +105,10 @@
(defn get-dimensions [name]
(js->clj (.get dimensions name) :keywordize-keys true))
(defn linear-gradient
[props & children]
(vec (concat [linear-gradient-class (merge {:inverted true} props)] children)))
(defn linear-gradient [props]
(let [class (js/require "react-native-linear-gradient")
gradient (adapt-class (.-default class))]
[gradient props]))
(defn list-item [component]
(r/as-element component))
@ -129,10 +127,12 @@
;; Clipboard
(def sharing
(.-Share js/ReactNative))
(defn copy-to-clipboard [text]
(.setString (.-Clipboard react-native) text))
;; Emoji
(def emoji-picker-class (js/require "react-native-emoji-picker"))

View File

@ -111,8 +111,8 @@
[animated-view {:style (st/loading-wrapper sync-state-opacity)}
[animated-view {:style (st/gradient-wrapper in-progress-opacity gradient-position)}
[linear-gradient {:colors ["#89b1fe" "#8b5fe4" "#8b5fe4" "#89b1fe"]
:start [0, 1]
:end [1, 1]
:start {:x 0 :y 1}
:end {:x 1 :y 1}
:locations [0 0.3 0.7 1]
:style (st/gradient gradient-width)}]]
(when (not= @sync-state :in-progress)

View File

@ -4,7 +4,6 @@
[status-im.components.react :refer [view
text
animated-view
linear-gradient
get-dimensions]]
[status-im.components.sync-state.styles :as st]
[status-im.components.animation :as anim]

View File

@ -6,8 +6,7 @@
text-input
text
image
touchable-highlight
linear-gradient]]
touchable-highlight]]
[reagent.core :as r]
[status-im.components.tabs.styles :as st]
[status-im.components.tabs.tab :refer [tab]]

View File

@ -19,7 +19,7 @@
:letter-spacing -0.2}})
(defstyle component-container
{:padding-left 16
{:margin-left 16
:android {:min-height 76}
:ios {:min-height 78}})

View File

@ -95,7 +95,7 @@
:uppercase? (get-in platform-specific [:uppercase?])
:font (get-in platform-specific [:component-styles :contacts :show-all-text-font])}
(str (- contacts-count contacts-limit) " " (label :t/more))]]]]])
[common/bottom-shaddow]]))
[common/bottom-shadow]]))
(defview contact-group-view [{:keys [group] :as params}]
[contacts [:all-added-group-contacts-with-limit (:group-id group) contacts-limit]

View File

@ -57,7 +57,7 @@
[list-view {:dataSource (lw/to-datasource contacts)
:enableEmptySections true
:renderRow (render-row group edit?)
:keyboardShouldPersistTaps true
:keyboardShouldPersistTaps :always
:renderHeader renderers/list-header-renderer
:renderFooter renderers/list-footer-renderer
:renderSeparator renderers/list-separator-renderer

View File

@ -69,16 +69,16 @@
:enableEmptySections true
:renderRow (render-row click-handler action params)
:bounces false
:keyboardShouldPersistTaps true
:keyboardShouldPersistTaps :always
:renderHeader #(list-item
[view
[actions-view action click-handler]
[common/bottom-shaddow]
[common/bottom-shadow]
[common/form-title (label :t/choose-from-contacts)
{:count-value (count contacts)}]
[common/list-header]])
:renderFooter #(list-item [view
[common/list-footer]
[common/bottom-shaddow]])
[common/bottom-shadow]])
:renderSeparator renderers/list-separator-renderer
:style st/contacts-list-modal}]]])

View File

@ -5,7 +5,6 @@
[status-im.components.react :refer [view
text
image
linear-gradient
touchable-highlight]]
[status-im.components.text-field.view :refer [text-field]]
[status-im.utils.identicon :refer [identicon]]

View File

@ -7,7 +7,6 @@
action-separator]]
[status-im.components.action-button.styles :refer [actions-list]]
[status-im.components.react :refer [view text
linear-gradient
image
touchable-highlight
list-view
@ -63,16 +62,16 @@
:enableEmptySections true
:renderRow (contact-list-row)
:bounces false
:keyboardShouldPersistTaps true
:keyboardShouldPersistTaps :always
:renderHeader #(list-item
[view
[options-list]
[common/bottom-shaddow]
[common/bottom-shadow]
[common/form-title (label :t/choose-from-contacts)
{:count-value (count contacts)}]
[common/list-header]])
:renderSeparator renderers/list-separator-renderer
:renderFooter #(list-item [view
[common/list-footer]
[common/bottom-shaddow]])
[common/bottom-shadow]])
:style st/contacts-list}])]])

View File

@ -87,7 +87,7 @@
:enableEmptySections true
:renderRow render-row
:bounces false
:keyboardShouldPersistTaps true
:keyboardShouldPersistTaps :always
:renderSeparator renderers/list-separator-renderer}]]
(when save-btn-enabled?
[sticky-button (label :t/save)

View File

@ -29,7 +29,7 @@
:enableEmptySections true
:renderRow renderer-function
:bounces false
:keyboardShouldPersistTaps true
:keyboardShouldPersistTaps :always
:renderSeparator renderers/list-separator-renderer
:renderFooter renderers/list-footer-renderer
:renderHeader renderers/list-header-renderer}]])

View File

@ -51,7 +51,7 @@
:renderFooter renderers/list-footer-renderer
:renderHeader renderers/list-header-renderer
:style cst/contacts-list
:keyboardShouldPersistTaps true}]])
:keyboardShouldPersistTaps :always}]])
(defview contact-toggle-list []
[contacts [:all-added-group-contacts-filtered]

View File

@ -38,8 +38,8 @@
(fn [_ row-id _]
(list-item
(if (= row-id last)
^{:key "bottom-shaddow"}
[common/bottom-shaddow]
^{:key "bottom-shadow"}
[common/bottom-shadow]
^{:key row-id}
[view st/order-item-separator-wrapper
[view st/order-item-separator]]))))
@ -52,7 +52,7 @@
[status-bar]
[toolbar-view]
[view st/reorder-list-container
[common/top-shaddow]
[common/top-shadow]
[sortable-list-view
{:data groups
:order order

View File

@ -6,8 +6,8 @@
[status-im.contacts.styles :as cst]
[status-im.components.common.common :refer [separator
form-spacer
top-shaddow
bottom-shaddow]]
top-shadow
bottom-shadow]]
[status-im.components.styles :refer [color-blue color-gray5]]
[status-im.components.context-menu :refer [context-menu]]
[status-im.components.action-button.action-button :refer [action-button
@ -202,7 +202,7 @@
[form-spacer]
[view st/profile-info-container
[my-profile-info current-account]
[bottom-shaddow]]])
[bottom-shadow]]])
(defview profile []
[{:keys [pending?
@ -223,4 +223,4 @@
[form-spacer]
[view st/profile-info-container
[profile-info contact]
[bottom-shaddow]]]])
[bottom-shadow]]]])