RAM bundle basic setup
This commit is contained in:
parent
9b04dc6530
commit
c7c7b50281
|
@ -80,6 +80,8 @@ project.ext.react = [
|
|||
nodeExecutableAndArgs: ["node", "--max-old-space-size=16384"],
|
||||
entryFile: "index.android.js",
|
||||
bundleInPr: true,
|
||||
bundleCommand: "ram-bundle",
|
||||
bundleConfig: "packager/config.js"
|
||||
]
|
||||
|
||||
apply from: "../../node_modules/react-native/react.gradle"
|
||||
|
|
|
@ -46,7 +46,6 @@
|
|||
"hi-base32"
|
||||
"react-native-mail"
|
||||
"react-native-shake"]
|
||||
|
||||
;; Desktop modules
|
||||
:desktop-modules ["realm"
|
||||
"react-native-languages"
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
(ns status-im.ui.components.react
|
||||
(:require-macros [status-im.utils.views :as views])
|
||||
(:require [clojure.string :as string]
|
||||
[goog.object :as object]
|
||||
(:require [goog.object :as object]
|
||||
[reagent.core :as reagent]
|
||||
[status-im.ui.components.styles :as styles]
|
||||
[status-im.utils.utils :as utils]
|
||||
|
@ -17,31 +16,42 @@
|
|||
(or (object/get js-dependencies/react-native name) {})
|
||||
#js {}))
|
||||
|
||||
(defn lazy-get-react-property [name]
|
||||
(let [react-property (atom nil)]
|
||||
(fn []
|
||||
(if @react-property
|
||||
@react-property
|
||||
(reset! react-property (get-react-property name))))))
|
||||
|
||||
(defn adapt-class [class]
|
||||
(when class
|
||||
(reagent/adapt-react-class class)))
|
||||
|
||||
(defn get-class [name]
|
||||
(adapt-class (get-react-property name)))
|
||||
(let [react-class (atom nil)]
|
||||
(fn []
|
||||
(if @react-class
|
||||
@react-class
|
||||
(reset! react-class
|
||||
(adapt-class (get-react-property name)))))))
|
||||
|
||||
(def native-modules (.-NativeModules js-dependencies/react-native))
|
||||
(def device-event-emitter (.-DeviceEventEmitter js-dependencies/react-native))
|
||||
(def dismiss-keyboard! js-dependencies/dismiss-keyboard)
|
||||
(def back-handler (get-react-property "BackHandler"))
|
||||
|
||||
(defn dismiss-keyboard! [] ((js-dependencies/dismiss-keyboard)))
|
||||
|
||||
(def splash-screen (.-SplashScreen native-modules))
|
||||
|
||||
;; React Components
|
||||
|
||||
(def app-registry (get-react-property "AppRegistry"))
|
||||
(def app-state (get-react-property "AppState"))
|
||||
(def net-info (get-react-property "NetInfo"))
|
||||
(def view (get-class "View"))
|
||||
(def app-state (lazy-get-react-property "AppState"))
|
||||
(def net-info (lazy-get-react-property "NetInfo"))
|
||||
(def view ((get-class "View")))
|
||||
(def safe-area-view (get-class "SafeAreaView"))
|
||||
(def progress-bar (get-class "ProgressBarAndroid"))
|
||||
|
||||
(def status-bar-class (when-not platform/desktop? (get-react-property "StatusBar")))
|
||||
(def status-bar (get-class (if platform/desktop? "View" "StatusBar")))
|
||||
|
||||
(def scroll-view (get-class "ScrollView"))
|
||||
(def web-view (get-class "WebView"))
|
||||
|
@ -49,11 +59,12 @@
|
|||
|
||||
(def refresh-control (get-class "RefreshControl"))
|
||||
|
||||
(def text-class (get-class "Text"))
|
||||
(def text-class ((get-class "Text")))
|
||||
(def text-input-class (get-class "TextInput"))
|
||||
(def image-class (get-class "Image"))
|
||||
(def picker-class (get-class "Picker"))
|
||||
(def picker-item-class (adapt-class (.-Item (get-react-property "Picker"))))
|
||||
(def picker-obj (lazy-get-react-property "Picker"))
|
||||
(defn picker-class [] (adapt-class (picker-obj)))
|
||||
(defn picker-item-class [] (adapt-class (.-Item (picker-obj))))
|
||||
|
||||
(defn valid-source? [source]
|
||||
(or (not (map? source))
|
||||
|
@ -63,30 +74,34 @@
|
|||
|
||||
(defn image [{:keys [source] :as props}]
|
||||
(when (valid-source? source)
|
||||
[image-class props]))
|
||||
(let [source (if (fn? source) (source) source)]
|
||||
[(image-class) (assoc props :source source)])))
|
||||
|
||||
(def switch (get-class "Switch"))
|
||||
(def check-box (get-class "CheckBox"))
|
||||
(def switch-class (get-class "Switch"))
|
||||
|
||||
(defn switch [props]
|
||||
[(switch-class) props])
|
||||
|
||||
(def touchable-highlight-class (get-class "TouchableHighlight"))
|
||||
(def touchable-without-feedback-class (get-class "TouchableWithoutFeedback"))
|
||||
(def touchable-opacity (get-class "TouchableOpacity"))
|
||||
(def activity-indicator (get-class "ActivityIndicator"))
|
||||
(def activity-indicator-class (get-class "ActivityIndicator"))
|
||||
|
||||
(defn activity-indicator [props]
|
||||
[(activity-indicator-class) props])
|
||||
|
||||
(def modal (get-class "Modal"))
|
||||
|
||||
(def pan-responder (.-PanResponder js-dependencies/react-native))
|
||||
(def animated (.-Animated js-dependencies/react-native))
|
||||
(def animated-view (reagent/adapt-react-class (.-View animated)))
|
||||
(def animated-text (reagent/adapt-react-class (.-Text animated)))
|
||||
(def pan-responder (lazy-get-react-property "PanResponder"))
|
||||
(def animated (lazy-get-react-property "Animated"))
|
||||
(defn animated-view []
|
||||
(reagent/adapt-react-class (.-View (animated))))
|
||||
|
||||
(def dimensions (.-Dimensions js-dependencies/react-native))
|
||||
(def keyboard (.-Keyboard js-dependencies/react-native))
|
||||
(def linking (.-Linking js-dependencies/react-native))
|
||||
(def dimensions (lazy-get-react-property "Dimensions"))
|
||||
(def keyboard (lazy-get-react-property "Keyboard"))
|
||||
(def linking (lazy-get-react-property "Linking"))
|
||||
(def desktop-notification (.-DesktopNotification (.-NativeModules js-dependencies/react-native)))
|
||||
|
||||
(def slider (get-class "Slider"))
|
||||
|
||||
(def max-font-size-multiplier 1.25)
|
||||
|
||||
(defn prepare-text-props [props]
|
||||
|
@ -122,7 +137,7 @@
|
|||
|
||||
(defn text-input
|
||||
[options text]
|
||||
[text-input-class
|
||||
[(text-input-class)
|
||||
(merge
|
||||
{:underline-color-android :transparent
|
||||
:max-font-size-multiplier max-font-size-multiplier
|
||||
|
@ -145,30 +160,30 @@
|
|||
:style style}]))
|
||||
|
||||
(defn touchable-highlight [props content]
|
||||
[touchable-highlight-class
|
||||
[(touchable-highlight-class)
|
||||
(merge {:underlay-color :transparent} props)
|
||||
content])
|
||||
|
||||
(defn touchable-without-feedback [props content]
|
||||
[touchable-without-feedback-class
|
||||
[(touchable-without-feedback-class)
|
||||
props
|
||||
content])
|
||||
|
||||
(defn get-dimensions [name]
|
||||
(js->clj (.get dimensions name) :keywordize-keys true))
|
||||
(js->clj (.get (dimensions) name) :keywordize-keys true))
|
||||
|
||||
(defn list-item [component]
|
||||
(reagent/as-element component))
|
||||
|
||||
(defn value->picker-item [{:keys [value label]}]
|
||||
[picker-item-class {:value (or value "") :label (or label value "")}])
|
||||
[(picker-item-class) {:value (or value "") :label (or label value "")}])
|
||||
|
||||
(defn picker [{:keys [style on-change selected enabled data]}]
|
||||
(into
|
||||
[picker-class (merge (when style {:style style})
|
||||
(when enabled {:enabled enabled})
|
||||
(when on-change {:on-value-change on-change})
|
||||
(when selected {:selected-value selected}))]
|
||||
[(picker-class) (merge (when style {:style style})
|
||||
(when enabled {:enabled enabled})
|
||||
(when on-change {:on-value-change on-change})
|
||||
(when selected {:selected-value selected}))]
|
||||
(map value->picker-item data)))
|
||||
|
||||
;; Image picker
|
||||
|
@ -184,7 +199,7 @@
|
|||
([images-fn]
|
||||
(show-image-picker images-fn nil))
|
||||
([images-fn media-type]
|
||||
(let [image-picker (.-default image-picker-class)]
|
||||
(let [image-picker (.-default (image-picker-class))]
|
||||
(-> image-picker
|
||||
(.openPicker (clj->js {:multiple false :mediaType (or media-type "any")}))
|
||||
(.then images-fn)
|
||||
|
@ -210,7 +225,7 @@
|
|||
|
||||
(defn keyboard-avoiding-view [props & children]
|
||||
(let [view-element (if platform/ios?
|
||||
[keyboard-avoiding-view-class (merge {:behavior :padding} props)]
|
||||
[(keyboard-avoiding-view-class) (merge {:behavior :padding} props)]
|
||||
[view props])]
|
||||
(vec (concat view-element children))))
|
||||
|
||||
|
@ -309,7 +324,7 @@
|
|||
:height 100
|
||||
:z-index -1000}])
|
||||
children (conj children bottom-background)]
|
||||
(apply vector safe-area-view props children))))
|
||||
(apply vector (safe-area-view) props children))))
|
||||
|
||||
(defmethod create-main-screen-view :default [_]
|
||||
view)
|
||||
|
|
|
@ -1837,7 +1837,7 @@
|
|||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
shellPath = /bin/sh;
|
||||
shellScript = "set -o errexit\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --max-old-space-size=16384 \"\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
|
||||
shellScript = "set -o errexit\nexport BUNDLE_COMMAND=\"ram-bundle\"\nexport BUNDLE_CONFIG=\"packager/config.js\"\nexport NODE_BINARY=\"node\"\nexport NODE_ARGS=\" --max-old-space-size=16384 \"\n\n../node_modules/react-native/scripts/react-native-xcode.sh\n";
|
||||
};
|
||||
2EAC54E16AB243C3EBBFE1BA /* [CP] Check Pods Manifest.lock */ = {
|
||||
isa = PBXShellScriptBuildPhase;
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
const modulePaths = require('./modulePaths');
|
||||
const resolve = require('path').resolve;
|
||||
const fs = require('fs');
|
||||
const { getDefaultConfig } = require("metro-config");
|
||||
|
||||
// Update the following line if the root folder of your app is somewhere else.
|
||||
const ROOT_FOLDER = resolve(__dirname, '..');
|
||||
|
||||
module.exports = (async () => {
|
||||
const {
|
||||
resolver: { sourceExts, assetExts }
|
||||
} = await getDefaultConfig();
|
||||
return {
|
||||
transformer: {
|
||||
babelTransformerPath: require.resolve("react-native-svg-transformer"),
|
||||
getTransformOptions: async () => {
|
||||
const moduleMap = {};
|
||||
modulePaths.forEach(path => {
|
||||
if (fs.existsSync(path)) {
|
||||
moduleMap[resolve(path)] = true;
|
||||
}
|
||||
});
|
||||
return {
|
||||
preloadedModules: moduleMap,
|
||||
transform: { inlineRequires: { blacklist: moduleMap } },
|
||||
}
|
||||
},
|
||||
},
|
||||
projectRoot:ROOT_FOLDER,
|
||||
resolver: {
|
||||
assetExts: assetExts.filter(ext => ext !== "svg"),
|
||||
sourceExts: [...sourceExts, "svg"]
|
||||
}
|
||||
};
|
||||
})();
|
|
@ -0,0 +1,415 @@
|
|||
module.exports = [
|
||||
"node_modules/react-native/Libraries/Core/InitializeCore.js",
|
||||
"index.android.js",
|
||||
"index.ios.js",
|
||||
"node_modules/react-native-config/index.js",
|
||||
"node_modules/react-native/Libraries/react-native/react-native-implementation.js",
|
||||
"node_modules/react-native/Libraries/BatchedBridge/NativeModules.js",
|
||||
"node_modules/invariant/browser.js",
|
||||
"node_modules/react-native/Libraries/BatchedBridge/BatchedBridge.js",
|
||||
"node_modules/react-native/Libraries/BatchedBridge/MessageQueue.js",
|
||||
"node_modules/react-native/Libraries/Utilities/stringifySafe.js",
|
||||
"node_modules/react-native/Libraries/Utilities/defineLazyObjectProperty.js",
|
||||
"node_modules/react-native/Libraries/EventEmitter/RCTDeviceEventEmitter.js",
|
||||
"node_modules/react-native/Libraries/vendor/emitter/EventSubscriptionVendor.js",
|
||||
"node_modules/react-native/Libraries/vendor/emitter/EventEmitter.js",
|
||||
"node_modules/react-native/Libraries/vendor/emitter/EmitterSubscription.js",
|
||||
"node_modules/react-native/Libraries/vendor/emitter/EventSubscription.js",
|
||||
"node_modules/react-native/Libraries/ReactNative/UIManager.js",
|
||||
"node_modules/react-native/Libraries/Utilities/Platform.android.js",
|
||||
"node_modules/react-native/Libraries/ReactNative/UIManagerProperties.js",
|
||||
"node_modules/react-native/Libraries/Components/ActivityIndicator/ActivityIndicator.js",
|
||||
"node_modules/react-native/Libraries/Components/ProgressBarAndroid/ProgressBarAndroid.android.js",
|
||||
"node_modules/react-native/Libraries/react-native/React.js",
|
||||
"node_modules/react/index.js",
|
||||
"node_modules/object-assign/index.js",
|
||||
"node_modules/react/cjs/react.production.min.js",
|
||||
"node_modules/react/node_modules/prop-types/checkPropTypes.js",
|
||||
"node_modules/react/node_modules/prop-types/lib/ReactPropTypesSecret.js",
|
||||
"node_modules/react-native/Libraries/ReactNative/requireNativeComponent.js",
|
||||
"node_modules/react-native/Libraries/Renderer/shims/createReactNativeComponentClass.js",
|
||||
"node_modules/react-native/Libraries/Renderer/shims/ReactNativeViewConfigRegistry.js",
|
||||
"node_modules/react-native/Libraries/ReactNative/getNativeComponentAttributes.js",
|
||||
"node_modules/react-native/node_modules/fbjs/lib/warning.js",
|
||||
"node_modules/@babel/runtime/helpers/objectSpread.js",
|
||||
"node_modules/@babel/runtime/helpers/defineProperty.js",
|
||||
"node_modules/react-native/Libraries/Components/View/ReactNativeStyleAttributes.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewStylePropTypes.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedLayoutPropTypes.js",
|
||||
"node_modules/react-native/node_modules/prop-types/index.js",
|
||||
"node_modules/react-native/node_modules/prop-types/factoryWithTypeCheckers.js",
|
||||
"node_modules/react-native/node_modules/prop-types/lib/ReactPropTypesSecret.js",
|
||||
"node_modules/react-native/node_modules/prop-types/checkPropTypes.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedShadowPropTypesIOS.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedColorPropType.js",
|
||||
"node_modules/react-native/Libraries/Color/normalizeColor.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTransformPropTypes.js",
|
||||
"node_modules/react-native/Libraries/Utilities/deprecatedPropType.js",
|
||||
"node_modules/react-native/Libraries/Text/TextStylePropTypes.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedImageStylePropTypes.js",
|
||||
"node_modules/react-native/Libraries/StyleSheet/processTransform.js",
|
||||
"node_modules/react-native/Libraries/Utilities/differ/sizesDiffer.js",
|
||||
"node_modules/react-native/Libraries/StyleSheet/processColor.js",
|
||||
"node_modules/react-native/Libraries/Image/AssetRegistry.js",
|
||||
"node_modules/react-native/Libraries/Utilities/PixelRatio.js",
|
||||
"node_modules/react-native/Libraries/Utilities/Dimensions.js",
|
||||
"node_modules/react-native/Libraries/Utilities/DeviceInfo.js",
|
||||
"node_modules/react-native/Libraries/Components/View/View.js",
|
||||
"node_modules/react-native/Libraries/Components/View/ViewNativeComponent.js",
|
||||
"node_modules/react-native/Libraries/Text/TextAncestor.js",
|
||||
"node_modules/react-native/Libraries/StyleSheet/StyleSheet.js",
|
||||
"node_modules/react-native/Libraries/StyleSheet/flattenStyle.js",
|
||||
"node_modules/react-native/Libraries/StyleSheet/StyleSheetValidation.js",
|
||||
"node_modules/react-native/Libraries/vendor/core/merge.js",
|
||||
"node_modules/react-native/Libraries/vendor/core/mergeInto.js",
|
||||
"node_modules/react-native/Libraries/vendor/core/mergeHelpers.js",
|
||||
"node_modules/react-native/Libraries/Components/View/ReactNativeViewAttributes.js",
|
||||
"node_modules/react-native/Libraries/Components/Touchable/Touchable.js",
|
||||
"node_modules/react-native/node_modules/fbjs/lib/keyMirror.js",
|
||||
"node_modules/react-native/Libraries/EventEmitter/NativeEventEmitter.js",
|
||||
"node_modules/react-native/Libraries/Renderer/shims/ReactNative.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpGlobals.js",
|
||||
"node_modules/react-native/Libraries/Core/polyfillES6Collections.js",
|
||||
"node_modules/react-native/Libraries/vendor/core/_shouldPolyfillES6Collection.js",
|
||||
"node_modules/react-native/Libraries/Utilities/PolyfillFunctions.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpSystrace.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpErrorHandling.js",
|
||||
"node_modules/react-native/Libraries/Core/ExceptionsManager.js",
|
||||
"node_modules/stacktrace-parser/index.js",
|
||||
"node_modules/stacktrace-parser/lib/stacktrace-parser.js",
|
||||
"node_modules/react-native/Libraries/Network/fetch.js",
|
||||
"node_modules/react-native/Libraries/vendor/core/whatwg-fetch.js",
|
||||
"node_modules/react-native/Libraries/Core/checkNativeVersion.js",
|
||||
"node_modules/react-native/Libraries/Core/ReactNativeVersionCheck.js",
|
||||
"node_modules/react-native/Libraries/Core/ReactNativeVersion.js",
|
||||
"node_modules/react-native/Libraries/Core/polyfillPromise.js",
|
||||
"node_modules/react-native/Libraries/Promise.js",
|
||||
"node_modules/promise/setimmediate/done.js",
|
||||
"node_modules/promise/setimmediate/core.js",
|
||||
"node_modules/promise/setimmediate/es6-extensions.js",
|
||||
"node_modules/promise/setimmediate/rejection-tracking.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpRegeneratorRuntime.js",
|
||||
"node_modules/regenerator-runtime/runtime.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpTimers.js",
|
||||
"node_modules/react-native/Libraries/Core/Timers/JSTimers.js",
|
||||
"node_modules/react-native/node_modules/fbjs/lib/ExecutionEnvironment.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpXHR.js",
|
||||
"node_modules/react-native/Libraries/Blob/BlobManager.js",
|
||||
"node_modules/react-native/Libraries/Blob/Blob.js",
|
||||
"node_modules/react-native/Libraries/Blob/BlobRegistry.js",
|
||||
"node_modules/event-target-shim/lib/event-target.js",
|
||||
"node_modules/event-target-shim/lib/commons.js",
|
||||
"node_modules/event-target-shim/lib/custom-event-target.js",
|
||||
"node_modules/event-target-shim/lib/event-wrapper.js",
|
||||
"node_modules/react-native/Libraries/Network/FormData.js",
|
||||
"node_modules/base64-js/index.js",
|
||||
"node_modules/react-native/Libraries/WebSocket/WebSocket.js",
|
||||
"node_modules/react-native/Libraries/WebSocket/WebSocketEvent.js",
|
||||
"node_modules/react-native/Libraries/Blob/File.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpAlert.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpGeolocation.js",
|
||||
"node_modules/react-native/Libraries/Utilities/logError.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpBatchedBridge.js",
|
||||
"node_modules/react-native/Libraries/Utilities/RCTLog.js",
|
||||
"node_modules/react-native/Libraries/Utilities/infoLog.js",
|
||||
"node_modules/react-native/Libraries/Core/setUpSegmentFetcher.js",
|
||||
"node_modules/react-native/Libraries/AppState/AppState.js",
|
||||
"node_modules/react-native/Libraries/JSInspector/JSInspector.js",
|
||||
"node_modules/react-native/Libraries/JSInspector/NetworkAgent.js",
|
||||
"node_modules/react-native/Libraries/JSInspector/InspectorAgent.js",
|
||||
"node_modules/react-native/Libraries/EventEmitter/RCTEventEmitter.js",
|
||||
"node_modules/react-native/Libraries/Utilities/differ/deepDiffer.js",
|
||||
"node_modules/react-native/Libraries/Components/TextInput/TextInputState.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewAccessibility.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedEdgeInsetsPropType.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/Animated.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedValue.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedInterpolation.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedWithChildren.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedNode.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedValueXY.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/AnimatedImplementation.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/Easing.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/AnimatedEvent.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/createAnimatedComponent.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedProps.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedStyle.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/nodes/AnimatedTransform.js",
|
||||
"node_modules/react-native/Libraries/Components/Keyboard/Keyboard.js",
|
||||
"node_modules/react-native/Libraries/Utilities/dismissKeyboard.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedViewPropTypes.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedStyleSheetPropType.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/deprecatedCreateStrictShapeTypeChecker.js",
|
||||
"node_modules/react-native/Libraries/Components/View/PlatformViewPropTypes.android.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/components/AnimatedText.js",
|
||||
"node_modules/react-native/Libraries/Text/Text.js",
|
||||
"node_modules/react-native/Libraries/DeprecatedPropTypes/DeprecatedTextPropTypes.js",
|
||||
"node_modules/react-native/Libraries/Animated/src/components/AnimatedView.js",
|
||||
"node_modules/react-native/Libraries/Components/DrawerAndroid/DrawerLayoutAndroid.android.js",
|
||||
"node_modules/react-native/Libraries/Components/StatusBar/StatusBar.js",
|
||||
"node_modules/react-native/Libraries/Utilities/warnOnce.js",
|
||||
"node_modules/react-native/Libraries/ReactNative/AppContainer.js",
|
||||
"node_modules/react-native/Libraries/ReactNative/I18nManager.js",
|
||||
"node_modules/react-native/Libraries/Interaction/PanResponder.js",
|
||||
"node_modules/react-native/Libraries/ReactNative/AppRegistry.js",
|
||||
"node_modules/react-native/Libraries/ReactNative/renderApplication.js",
|
||||
"node_modules/react-native/Libraries/Utilities/BackHandler.android.js",
|
||||
"node_modules/react-native/Libraries/BugReporting/BugReporting.js",
|
||||
"node_modules/react-native/Libraries/Utilities/SceneTracker.js",
|
||||
"node_modules/react-native/Libraries/Linking/Linking.js",
|
||||
"node_modules/react-native/Libraries/Network/NetInfo.js",
|
||||
"node_modules/react-native/Libraries/Share/Share.js",
|
||||
"node_modules/react-native-fs/FS.common.js",
|
||||
"node_modules/react-native-keychain/index.js",
|
||||
"node_modules/fbjs/lib/warning.js",
|
||||
"node_modules/fbjs/lib/emptyFunction.js",
|
||||
"node_modules/fbjs/lib/invariant.js",
|
||||
"node_modules/fbjs/lib/emptyObject.js",
|
||||
"node_modules/realm/lib/index.js",
|
||||
"node_modules/realm/lib/user-methods.js",
|
||||
"node_modules/realm/lib/errors.js",
|
||||
"node_modules/realm/lib/permission-api.js",
|
||||
"node_modules/realm/lib/extensions.js",
|
||||
"node_modules/realm/lib/collection-methods.js",
|
||||
"node_modules/create-react-class/index.js",
|
||||
"node_modules/create-react-class/factory.js",
|
||||
"node_modules/prop-types/index.js",
|
||||
"node_modules/prop-types/factoryWithTypeCheckers.js",
|
||||
"node_modules/prop-types/lib/ReactPropTypesSecret.js",
|
||||
"node_modules/prop-types/checkPropTypes.js",
|
||||
"node_modules/react-native-securerandom/index.js",
|
||||
"node_modules/i18n-js/app/assets/javascripts/i18n.js",
|
||||
"node_modules/react-native-languages/index.js",
|
||||
"node_modules/react-native-camera/src/index.js",
|
||||
"node_modules/react-native-camera/src/Camera.js",
|
||||
"node_modules/react-native-camera/node_modules/prop-types/index.js",
|
||||
"node_modules/react-native-camera/node_modules/prop-types/factoryWithTypeCheckers.js",
|
||||
"node_modules/react-native-camera/node_modules/prop-types/lib/ReactPropTypesSecret.js",
|
||||
"node_modules/react-native-camera/node_modules/prop-types/checkPropTypes.js",
|
||||
"node_modules/react-native-camera/src/RNCamera.js",
|
||||
"node_modules/react-native-camera/src/FaceDetector.js",
|
||||
"node_modules/react-native-svg/index.js",
|
||||
"node_modules/react-native-svg/elements/Rect.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractProps.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractFill.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractBrush.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractColor.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractOpacity.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractStroke.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractLengthList.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractClipPath.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractResponder.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractTransform.js",
|
||||
"node_modules/react-native-svg/lib/Matrix2D.js",
|
||||
"node_modules/react-native-svg/lib/extract/transform.js",
|
||||
"node_modules/react-native-svg/elements/Shape.js",
|
||||
"node_modules/react-native-svg/lib/SvgTouchableMixin.js",
|
||||
"node_modules/react-native-svg/elements/Circle.js",
|
||||
"node_modules/react-native-svg/elements/Ellipse.js",
|
||||
"node_modules/react-native-svg/elements/Polygon.js",
|
||||
"node_modules/react-native-svg/elements/Path.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractPolyPoints.js",
|
||||
"node_modules/react-native-svg/elements/Polyline.js",
|
||||
"node_modules/react-native-svg/elements/Line.js",
|
||||
"node_modules/react-native-svg/elements/Svg.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractViewBox.js",
|
||||
"node_modules/react-native-svg/elements/G.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractText.js",
|
||||
"node_modules/react-native-svg/elements/Text.js",
|
||||
"node_modules/react-native-svg/elements/TSpan.js",
|
||||
"node_modules/react-native-svg/elements/TextPath.js",
|
||||
"node_modules/react-native-svg/elements/Use.js",
|
||||
"node_modules/react-native-svg/elements/Image.js",
|
||||
"node_modules/react-native-svg/elements/Symbol.js",
|
||||
"node_modules/react-native-svg/elements/Defs.js",
|
||||
"node_modules/react-native-svg/elements/LinearGradient.js",
|
||||
"node_modules/react-native-svg/lib/extract/extractGradient.js",
|
||||
"node_modules/react-native-svg/lib/units.js",
|
||||
"node_modules/react-native-svg/elements/RadialGradient.js",
|
||||
"node_modules/react-native-svg/elements/Stop.js",
|
||||
"node_modules/react-native-svg/elements/ClipPath.js",
|
||||
"node_modules/react-native-svg/elements/Pattern.js",
|
||||
"node_modules/react-native-svg/elements/Mask.js",
|
||||
"node_modules/react-native-firebase/dist/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/core/firebase.js",
|
||||
"node_modules/react-native-firebase/dist/utils/apps.js",
|
||||
"node_modules/react-native-firebase/dist/modules/core/app.js",
|
||||
"node_modules/react-native-firebase/dist/utils/internals.js",
|
||||
"node_modules/react-native-firebase/dist/modules/admob/index.js",
|
||||
"node_modules/react-native-firebase/dist/utils/ModuleBase.js",
|
||||
"node_modules/react-native-firebase/dist/utils/native.js",
|
||||
"node_modules/react-native-firebase/dist/utils/events.js",
|
||||
"node_modules/react-native-firebase/dist/utils/emitter/EventEmitter.js",
|
||||
"node_modules/react-native-firebase/dist/utils/emitter/EventSubscriptionVendor.js",
|
||||
"node_modules/react-native-firebase/dist/utils/emitter/EmitterSubscription.js",
|
||||
"node_modules/react-native-firebase/dist/utils/emitter/EventSubscription.js",
|
||||
"node_modules/react-native-firebase/dist/utils/log.js",
|
||||
"node_modules/react-native-firebase/dist/modules/admob/Interstitial.js",
|
||||
"node_modules/react-native-firebase/dist/modules/admob/AdRequest.js",
|
||||
"node_modules/react-native-firebase/dist/utils/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/admob/RewardedVideo.js",
|
||||
"node_modules/react-native-firebase/dist/modules/admob/VideoOptions.js",
|
||||
"node_modules/react-native-firebase/dist/modules/admob/Banner.js",
|
||||
"node_modules/react-native-firebase/dist/modules/admob/AdMobComponent.js",
|
||||
"node_modules/react-native-firebase/node_modules/prop-types/index.js",
|
||||
"node_modules/react-native-firebase/node_modules/prop-types/factoryWithTypeCheckers.js",
|
||||
"node_modules/react-native-firebase/node_modules/prop-types/lib/ReactPropTypesSecret.js",
|
||||
"node_modules/react-native-firebase/node_modules/prop-types/checkPropTypes.js",
|
||||
"node_modules/react-native-firebase/dist/modules/admob/EventTypes.js",
|
||||
"node_modules/react-native-firebase/dist/modules/admob/NativeExpress.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/User.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/phone/ConfirmationResult.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/phone/PhoneAuthListener.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/providers/EmailAuthProvider.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/providers/PhoneAuthProvider.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/providers/GoogleAuthProvider.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/providers/GithubAuthProvider.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/providers/OAuthProvider.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/providers/TwitterAuthProvider.js",
|
||||
"node_modules/react-native-firebase/dist/modules/auth/providers/FacebookAuthProvider.js",
|
||||
"node_modules/react-native-firebase/dist/modules/analytics/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/config/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/crashlytics/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/database/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/database/Reference.js",
|
||||
"node_modules/react-native-firebase/dist/modules/database/Query.js",
|
||||
"node_modules/react-native-firebase/dist/modules/database/DataSnapshot.js",
|
||||
"node_modules/react-native-firebase/dist/modules/database/OnDisconnect.js",
|
||||
"node_modules/react-native-firebase/dist/utils/ReferenceBase.js",
|
||||
"node_modules/react-native-firebase/dist/utils/SyncTree.js",
|
||||
"node_modules/react-native-firebase/dist/modules/database/transaction.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/CollectionReference.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/DocumentReference.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/DocumentSnapshot.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/FieldPath.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/Path.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/Blob.js",
|
||||
"node_modules/react-native-firebase/dist/utils/Base64.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/GeoPoint.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/FieldValue.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/Query.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/QuerySnapshot.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/DocumentChange.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/WriteBatch.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/TransactionHandler.js",
|
||||
"node_modules/react-native-firebase/dist/modules/firestore/Transaction.js",
|
||||
"node_modules/react-native-firebase/dist/modules/functions/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/functions/HttpsError.js",
|
||||
"node_modules/react-native-firebase/dist/modules/iid/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/invites/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/invites/Invitation.js",
|
||||
"node_modules/react-native-firebase/dist/modules/invites/AndroidInvitation.js",
|
||||
"node_modules/react-native-firebase/dist/modules/links/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/links/DynamicLink.js",
|
||||
"node_modules/react-native-firebase/dist/modules/links/AnalyticsParameters.js",
|
||||
"node_modules/react-native-firebase/dist/modules/links/AndroidParameters.js",
|
||||
"node_modules/react-native-firebase/dist/modules/links/IOSParameters.js",
|
||||
"node_modules/react-native-firebase/dist/modules/links/ITunesParameters.js",
|
||||
"node_modules/react-native-firebase/dist/modules/links/NavigationParameters.js",
|
||||
"node_modules/react-native-firebase/dist/modules/links/SocialParameters.js",
|
||||
"node_modules/react-native-firebase/dist/modules/messaging/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/messaging/RemoteMessage.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/AndroidAction.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/AndroidRemoteInput.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/types.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/AndroidChannel.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/AndroidChannelGroup.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/AndroidNotifications.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/IOSNotifications.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/Notification.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/AndroidNotification.js",
|
||||
"node_modules/react-native-firebase/dist/modules/notifications/IOSNotification.js",
|
||||
"node_modules/react-native-firebase/dist/modules/perf/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/perf/Trace.js",
|
||||
"node_modules/react-native-firebase/dist/modules/perf/HttpMetric.js",
|
||||
"node_modules/react-native-firebase/dist/modules/storage/index.js",
|
||||
"node_modules/react-native-firebase/dist/modules/storage/reference.js",
|
||||
"node_modules/react-native-firebase/dist/modules/storage/task.js",
|
||||
"node_modules/react-native-firebase/dist/modules/utils/index.js",
|
||||
"node_modules/react-native-firebase/dist/version.js",
|
||||
"node_modules/react-navigation/src/react-navigation.js",
|
||||
"node_modules/react-navigation/src/createNavigationContainer.js",
|
||||
"node_modules/react-navigation/src/NavigationActions.js",
|
||||
"node_modules/react-navigation/src/getNavigation.js",
|
||||
"node_modules/react-navigation/src/routers/getNavigationActionCreators.js",
|
||||
"node_modules/react-navigation/src/utils/invariant.js",
|
||||
"node_modules/react-navigation/src/getChildNavigation.js",
|
||||
"node_modules/react-navigation/src/getChildEventSubscriber.js",
|
||||
"node_modules/react-navigation/src/getChildRouter.js",
|
||||
"node_modules/react-navigation/src/utils/docsUrl.js",
|
||||
"node_modules/react-navigation/src/routers/pathUtils.js",
|
||||
"node_modules/path-to-regexp/index.js",
|
||||
"node_modules/path-to-regexp/node_modules/isarray/index.js",
|
||||
"node_modules/react-lifecycles-compat/react-lifecycles-compat.cjs.js",
|
||||
"node_modules/react-navigation/src/StateUtils.js",
|
||||
"node_modules/react-navigation/src/navigators/createNavigator.js",
|
||||
"node_modules/react-navigation/src/navigators/createKeyboardAwareNavigator.js",
|
||||
"node_modules/react-navigation/src/views/NavigationContext.js",
|
||||
"node_modules/create-react-context/lib/index.js",
|
||||
"node_modules/create-react-context/lib/implementation.js",
|
||||
"node_modules/gud/index.js",
|
||||
"node_modules/react-navigation-stack/dist/index.js",
|
||||
"node_modules/react-navigation-stack/dist/navigators/createContainedStackNavigator.js",
|
||||
"node_modules/react-navigation-stack/dist/navigators/createStackNavigator.js",
|
||||
"node_modules/react-navigation-stack/dist/views/StackView/StackView.js",
|
||||
"node_modules/react-navigation-stack/dist/views/StackView/StackViewLayout.js",
|
||||
"node_modules/react-navigation-stack/dist/utils/clamp.js",
|
||||
"node_modules/react-navigation-stack/dist/views/StackView/StackViewCard.js",
|
||||
"node_modules/react-navigation-stack/dist/views/StackView/createPointerEventsContainer.js",
|
||||
"node_modules/react-navigation-stack/dist/utils/invariant.js",
|
||||
"node_modules/react-native-screens/src/screens.native.js",
|
||||
"node_modules/react-navigation-stack/dist/views/Header/Header.js",
|
||||
"node_modules/react-navigation-stack/dist/views/Header/HeaderTitle.js",
|
||||
"node_modules/react-navigation-stack/dist/views/Header/HeaderBackButton.js",
|
||||
"node_modules/react-navigation-stack/dist/views/TouchableItem.js",
|
||||
"node_modules/react-navigation-stack/dist/views/assets/back-icon.png",
|
||||
"node_modules/react-navigation-stack/dist/views/Header/ModularHeaderBackButton.js",
|
||||
"node_modules/react-navigation-stack/dist/views/Header/HeaderStyleInterpolator.js",
|
||||
"node_modules/react-navigation-stack/dist/utils/getSceneIndicesForInterpolationInputRange.js",
|
||||
"node_modules/react-navigation-stack/dist/views/StackView/StackViewTransitionConfigs.js",
|
||||
"node_modules/react-navigation-stack/dist/views/StackView/StackViewStyleInterpolator.js",
|
||||
"node_modules/react-navigation-stack/dist/utils/ReactNativeFeatures.js",
|
||||
"node_modules/react-navigation-stack/dist/views/Transitioner.js",
|
||||
"node_modules/react-navigation-stack/dist/views/ScenesReducer.js",
|
||||
"node_modules/react-navigation-stack/dist/utils/shallowEqual.js",
|
||||
"node_modules/react-navigation/src/navigators/createContainedSwitchNavigator.js",
|
||||
"node_modules/react-navigation/src/navigators/createSwitchNavigator.js",
|
||||
"node_modules/react-navigation/src/routers/SwitchRouter.js",
|
||||
"node_modules/react-navigation/src/routers/getScreenForRouteName.js",
|
||||
"node_modules/react-is/index.js",
|
||||
"node_modules/react-is/cjs/react-is.production.min.js",
|
||||
"node_modules/react-navigation/src/routers/createConfigGetter.js",
|
||||
"node_modules/react-navigation/src/routers/validateScreenOptions.js",
|
||||
"node_modules/react-navigation/src/routers/StackActions.js",
|
||||
"node_modules/react-navigation/src/routers/validateRouteConfigMap.js",
|
||||
"node_modules/react-navigation/src/views/SwitchView/SwitchView.js",
|
||||
"node_modules/react-navigation/src/views/SceneView.js",
|
||||
"node_modules/react-navigation-drawer/dist/index.js",
|
||||
"node_modules/react-navigation-drawer/dist/navigators/createDrawerNavigator.js",
|
||||
"node_modules/react-navigation-drawer/dist/routers/DrawerRouter.js",
|
||||
"node_modules/react-navigation-drawer/dist/routers/DrawerActions.js",
|
||||
"node_modules/react-navigation-drawer/dist/views/DrawerView.js",
|
||||
"node_modules/react-native-drawer-layout-polyfill/dist/index.android.js",
|
||||
"node_modules/react-navigation-drawer/dist/views/DrawerSidebar.js",
|
||||
"node_modules/react-navigation-drawer/dist/utils/invariant.js",
|
||||
"node_modules/react-navigation-drawer/dist/views/DrawerNavigatorItems.js",
|
||||
"node_modules/react-navigation-drawer/dist/views/TouchableItem.js",
|
||||
"node_modules/react-navigation-tabs/src/index.js",
|
||||
"node_modules/react-navigation-tabs/src/navigators/createBottomTabNavigator.js",
|
||||
"node_modules/react-navigation-tabs/src/utils/createTabNavigator.js",
|
||||
"node_modules/react-navigation-tabs/src/views/BottomTabBar.js",
|
||||
"node_modules/react-navigation-tabs/src/views/CrossFadeIcon.js",
|
||||
"node_modules/react-navigation-tabs/src/utils/withDimensions.js",
|
||||
"node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js",
|
||||
"node_modules/react-navigation-tabs/src/views/ResourceSavingScene.js",
|
||||
"node_modules/react-navigation/src/routers/StackRouter.js",
|
||||
"node_modules/react-navigation/src/routers/KeyGenerator.js",
|
||||
"node_modules/react-navigation/src/routers/TabRouter.js",
|
||||
"node_modules/react-navigation/src/utils/withDefaultValue.js",
|
||||
"node_modules/react-navigation/src/views/NavigationEvents.js",
|
||||
"node_modules/react-navigation/src/views/withNavigation.js",
|
||||
"node_modules/react-navigation/src/views/withOrientation.js",
|
||||
"resources/images/ui/dapp-store.png"];
|
|
@ -1,37 +1,38 @@
|
|||
(ns status-im.react-native.js-dependencies)
|
||||
(ns status-im.react-native.js-dependencies
|
||||
(:require-macros [status-im.utils.js-require :as js-require]))
|
||||
|
||||
(def config (js/require "react-native-config"))
|
||||
(def fs (js/require "react-native-fs"))
|
||||
(def http-bridge (js/require "react-native-http-bridge"))
|
||||
(def keychain (js/require "react-native-keychain"))
|
||||
(def qr-code (js/require "react-native-qrcode"))
|
||||
(def config (js-require/js-require "react-native-config"))
|
||||
(def fs (js-require/js-require "react-native-fs"))
|
||||
(def http-bridge (js-require/js-require "react-native-http-bridge"))
|
||||
(def keychain (js-require/js-require "react-native-keychain"))
|
||||
(def qr-code (js-require/js-require "react-native-qrcode"))
|
||||
(def react-native (js/require "react-native"))
|
||||
(def realm (js/require "realm"))
|
||||
(def webview-bridge (js/require "react-native-webview-bridge"))
|
||||
(def webview #js {:WebView #js {}})
|
||||
(def secure-random (.-generateSecureRandom (js/require "react-native-securerandom")))
|
||||
(def EventEmmiter (js/require "react-native/Libraries/vendor/emitter/EventEmitter"))
|
||||
(def fetch (.-default (js/require "react-native-fetch-polyfill")))
|
||||
(def securerandom (js-require/js-require "react-native-securerandom"))
|
||||
(defn secure-random [] (.-generateSecureRandom (securerandom)))
|
||||
(def fetch-polyfill (js-require/js-require "react-native-fetch-polyfill"))
|
||||
(defn fetch [] (.-default (fetch-polyfill)))
|
||||
(def i18n (js/require "i18n-js"))
|
||||
(def react-native-languages (.-default (js/require "react-native-languages")))
|
||||
(def desktop-linking (.-DesktopLinking (.-NativeModules react-native)))
|
||||
(def desktop-menu (js/require "react-native-desktop-menu"))
|
||||
(def desktop-config (js/require "react-native-desktop-config"))
|
||||
(def desktop-shortcuts (js/require "react-native-desktop-shortcuts"))
|
||||
(def react-native-firebase #js {})
|
||||
(def camera #js {:default #js {:constants {:Aspect "Portrait"}}})
|
||||
(def status-keycard #js {:default #js {}})
|
||||
(def dialogs #js {})
|
||||
(def dismiss-keyboard #js {})
|
||||
(def image-crop-picker #js {})
|
||||
(def image-resizer #js {})
|
||||
(def nfc #js {})
|
||||
(def react-native-firebase (fn [] #js {}))
|
||||
(def camera (fn [] #js {:default #js {:constants {:Aspect "Portrait"}}}))
|
||||
(def status-keycard (fn [] #js {:default #js {}}))
|
||||
(def dialogs (fn [] #js {}))
|
||||
(def dismiss-keyboard (fn [] #js {}))
|
||||
(def image-crop-picker (fn [] #js {}))
|
||||
(def image-resizer (fn [] #js {}))
|
||||
(def svg #js {})
|
||||
(def snoopy #js {})
|
||||
(def snoopy-filter #js {})
|
||||
(def snoopy-bars #js {})
|
||||
(def snoopy-buffer #js {})
|
||||
(def background-timer #js {:setTimeout (fn [cb ms] (js/setTimeout cb ms))})
|
||||
(def snoopy (fn [] #js {}))
|
||||
(def snoopy-filter (fn [] #js {}))
|
||||
(def snoopy-bars (fn [] #js {}))
|
||||
(def snoopy-buffer (fn [] #js {}))
|
||||
(def background-timer (fn [] #js {:setTimeout (fn [cb ms] (js/setTimeout cb ms))}))
|
||||
(def react-navigation (js/require "react-navigation"))
|
||||
(def react-native-shake #js {})
|
||||
(def react-native-mail #js {:mail (fn [])})
|
||||
(def react-native-shake (fn [] #js {}))
|
||||
(def react-native-mail (fn [] #js {:mail (fn [])}))
|
||||
|
|
|
@ -1,35 +1,39 @@
|
|||
(ns status-im.react-native.js-dependencies)
|
||||
(ns status-im.react-native.js-dependencies
|
||||
(:require-macros [status-im.utils.js-require :as js-require]))
|
||||
|
||||
(def config (js/require "react-native-config"))
|
||||
(def fs (js/require "react-native-fs"))
|
||||
(def http-bridge (js/require "react-native-http-bridge"))
|
||||
(def keychain (js/require "react-native-keychain"))
|
||||
(def qr-code (js/require "react-native-qrcode"))
|
||||
(def config (js-require/js-require "react-native-config"))
|
||||
(def fs (js-require/js-require "react-native-fs"))
|
||||
(def http-bridge (js-require/js-require "react-native-http-bridge"))
|
||||
(def keychain (js-require/js-require "react-native-keychain"))
|
||||
(def qr-code (js-require/js-require "react-native-qrcode"))
|
||||
(def react-native (js/require "react-native"))
|
||||
(def status-keycard (js/require "react-native-status-keycard"))
|
||||
(def status-keycard (js-require/js-require "react-native-status-keycard"))
|
||||
(def realm (js/require "realm"))
|
||||
(def webview-bridge (js/require "react-native-webview-bridge"))
|
||||
(def webview (js/require "react-native-webview"))
|
||||
(def secure-random (.-generateSecureRandom (js/require "react-native-securerandom")))
|
||||
(def EventEmmiter (js/require "react-native/Libraries/vendor/emitter/EventEmitter"))
|
||||
(def fetch (.-default (js/require "react-native-fetch-polyfill")))
|
||||
(def webview-bridge (js-require/js-require "react-native-webview-bridge"))
|
||||
(def webview (js-require/js-require "react-native-webview"))
|
||||
(def securerandom (js-require/js-require "react-native-securerandom"))
|
||||
(defn secure-random [] (.-generateSecureRandom (securerandom)))
|
||||
(def fetch-polyfill (js-require/js-require "react-native-fetch-polyfill"))
|
||||
(defn fetch [] (.-default (fetch-polyfill)))
|
||||
(def i18n (js/require "i18n-js"))
|
||||
(def react-native-languages (.-default (js/require "react-native-languages")))
|
||||
(def camera (js/require "react-native-camera"))
|
||||
(def dialogs (js/require "react-native-dialogs"))
|
||||
(def dismiss-keyboard (js/require "dismissKeyboard"))
|
||||
(def image-crop-picker (js/require "react-native-image-crop-picker"))
|
||||
(def image-resizer (js/require "react-native-image-resizer"))
|
||||
(def camera (js-require/js-require "react-native-camera"))
|
||||
(def dialogs (js-require/js-require "react-native-dialogs"))
|
||||
(def dismiss-keyboard (js-require/js-require "dismissKeyboard"))
|
||||
(def image-crop-picker (js-require/js-require "react-native-image-crop-picker"))
|
||||
(def image-resizer (js-require/js-require "react-native-image-resizer"))
|
||||
(def svg (js/require "react-native-svg"))
|
||||
(def react-native-firebase (js/require "react-native-firebase"))
|
||||
(def snoopy (js/require "rn-snoopy"))
|
||||
(def snoopy-filter (js/require "rn-snoopy/stream/filter"))
|
||||
(def snoopy-bars (js/require "rn-snoopy/stream/bars"))
|
||||
(def snoopy-buffer (js/require "rn-snoopy/stream/buffer"))
|
||||
(def background-timer (.-default (js/require "react-native-background-timer")))
|
||||
(def react-native-firebase (js-require/js-require "react-native-firebase"))
|
||||
(def snoopy (js-require/js-require "rn-snoopy"))
|
||||
(def snoopy-filter (js-require/js-require "rn-snoopy/stream/filter"))
|
||||
(def snoopy-bars (js-require/js-require "rn-snoopy/stream/bars"))
|
||||
(def snoopy-buffer (js-require/js-require "rn-snoopy/stream/buffer"))
|
||||
(def background-timer-class (js-require/js-require "react-native-background-timer"))
|
||||
(defn background-timer [] (.-default (background-timer-class)))
|
||||
(def react-navigation (js/require "react-navigation"))
|
||||
(def react-native-shake (js/require "react-native-shake"))
|
||||
(def react-native-mail (.-default (js/require "react-native-mail")))
|
||||
(def react-native-shake (js-require/js-require "react-native-shake"))
|
||||
(def mail-class (js-require/js-require "react-native-mail"))
|
||||
(defn react-native-mail [] (.-default (mail-class)))
|
||||
(def desktop-linking #js {:addEventListener (fn [])})
|
||||
(def desktop-menu #js {:addEventListener (fn [])})
|
||||
(def desktop-config #js {:addEventListener (fn [])})
|
||||
|
|
|
@ -15,4 +15,4 @@ if [ ! -z "$METRO_PID" ]; then
|
|||
[[ $term == 'y' ]] && kill $METRO_PID
|
||||
fi
|
||||
|
||||
react-native start
|
||||
react-native start --config packager/config.js
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
(reagent/create-class
|
||||
{:component-will-mount
|
||||
(fn []
|
||||
(.addListener react/keyboard
|
||||
(.addListener (react/keyboard)
|
||||
"keyboardDidShow"
|
||||
(fn [e]
|
||||
(let [h (.. e -endCoordinates -height)]
|
||||
|
@ -37,16 +37,16 @@
|
|||
(when-not (= h @keyboard-height)
|
||||
(dispatch [:set :keyboard-height h])
|
||||
(dispatch [:set :keyboard-max-height h])))))
|
||||
(.addListener react/keyboard
|
||||
(.addListener (react/keyboard)
|
||||
"keyboardDidHide"
|
||||
(fn [_]
|
||||
(dispatch [:show-tab-bar])
|
||||
(when-not (zero? @keyboard-height)
|
||||
(dispatch [:set :keyboard-height 0]))))
|
||||
(.hide react/splash-screen)
|
||||
(.addEventListener react/app-state "change" app-state-change-handler)
|
||||
(.addEventListener (react/app-state) "change" app-state-change-handler)
|
||||
(.addEventListener rn-dependencies/react-native-languages "change" on-languages-change)
|
||||
(.addEventListener rn-dependencies/react-native-shake
|
||||
(.addEventListener (rn-dependencies/react-native-shake)
|
||||
"ShakeEvent"
|
||||
on-shake))
|
||||
:component-did-mount
|
||||
|
@ -54,10 +54,10 @@
|
|||
(dispatch [:set-initial-props (reagent/props this)]))
|
||||
:component-will-unmount
|
||||
(fn []
|
||||
(.stop react/http-bridge)
|
||||
(.removeEventListener react/app-state "change" app-state-change-handler)
|
||||
(.stop (react/http-bridge))
|
||||
(.removeEventListener (react/app-state) "change" app-state-change-handler)
|
||||
(.removeEventListener rn-dependencies/react-native-languages "change" on-languages-change)
|
||||
(.removeEventListener rn-dependencies/react-native-shake
|
||||
(.removeEventListener (rn-dependencies/react-native-shake)
|
||||
"ShakeEvent"
|
||||
on-shake))
|
||||
:display-name "root"
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
|
||||
(defn check-if-phishing-url [{:keys [history history-index] :as browser}]
|
||||
(let [history-host (http/url-host (try (nth history history-index) (catch js/Error _)))]
|
||||
(cond-> browser history-host (assoc :unsafe? (js-dependencies/phishing-detect history-host)))))
|
||||
(cond-> browser history-host (assoc :unsafe? ((js-dependencies/phishing-detect) history-host)))))
|
||||
|
||||
(defn- content->hash [hex]
|
||||
(when (and hex (not= hex "0x"))
|
||||
|
@ -155,7 +155,7 @@
|
|||
|
||||
(defmethod storage-gateway :ipfs
|
||||
[{:keys [hash]}]
|
||||
(let [base32hash (-> (.encode js-dependencies/hi-base32 (alphabase.base58/decode hash))
|
||||
(let [base32hash (-> (.encode (js-dependencies/hi-base32) (alphabase.base58/decode hash))
|
||||
(string/replace #"=" "")
|
||||
(string/lower-case))]
|
||||
(str base32hash ".infura.status.im")))
|
||||
|
|
|
@ -401,7 +401,7 @@
|
|||
{:on-press on-press-handler
|
||||
:style transactions-styles/command-request-image-touchable
|
||||
:accessibility-label (request-button-label (:name command))}
|
||||
[react/animated-view {:style (transactions-styles/command-request-image-view command scale-anim-val)}
|
||||
[(react/animated-view) {:style (transactions-styles/command-request-image-view command scale-anim-val)}
|
||||
(when command-icon
|
||||
[react/icon command-icon transactions-styles/command-request-image])]]))})))
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
(string/replace text
|
||||
#":([a-z_\-+0-9]*):"
|
||||
(fn [[original emoji-id]]
|
||||
(if-let [emoji-map (object/get (object/get dependencies/emojis "lib") emoji-id)]
|
||||
(if-let [emoji-map (object/get (object/get (dependencies/emojis) "lib") emoji-id)]
|
||||
(object/get emoji-map "char")
|
||||
original)))))
|
||||
|
||||
|
|
|
@ -365,8 +365,17 @@
|
|||
|
||||
(def ^:private transport-keys [:content :content-type :message-type :clock-value :timestamp])
|
||||
|
||||
(defn remove-icon
|
||||
"Coin's icon's resource is represented as a function,
|
||||
can't be properly de/serialised and has to be removed."
|
||||
[message]
|
||||
(cond-> message
|
||||
(get-in message [:content :params :coin :icon :source])
|
||||
(update-in [:content :params :coin] dissoc :icon)))
|
||||
|
||||
(fx/defn upsert-and-send [{:keys [now] :as cofx} {:keys [chat-id from] :as message}]
|
||||
(let [send-record (protocol/map->Message (select-keys message transport-keys))
|
||||
(let [message (remove-icon message)
|
||||
send-record (protocol/map->Message (select-keys message transport-keys))
|
||||
old-message-id (transport.utils/old-message-id send-record)
|
||||
wrapped-record (if (= (:message-type send-record) :group-user-message)
|
||||
(wrap-group-message cofx chat-id send-record)
|
||||
|
|
|
@ -222,8 +222,14 @@
|
|||
|
||||
(def ^:const status-create-address "status_createaddress")
|
||||
|
||||
(def ^:const event-transfer-hash
|
||||
(ethereum/sha3 "Transfer(address,address,uint256)"))
|
||||
(def event-transfer-hash
|
||||
(let [hash (atom nil)]
|
||||
(fn []
|
||||
(if @hash
|
||||
@hash
|
||||
(reset!
|
||||
hash
|
||||
(ethereum/sha3 "Transfer(address,address,uint256)"))))))
|
||||
|
||||
(def regx-emoji #"^((?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC69\uDC6E\uDC70-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD18-\uDD1C\uDD1E\uDD1F\uDD26\uDD30-\uDD39\uDD3D\uDD3E\uDDD1-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])?|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDEEB\uDEEC\uDEF4-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u2660\u2663\u2665\u2666\u2668\u267B\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEF8]|\uD83E[\uDD10-\uDD3A\uDD3C-\uDD3E\uDD40-\uDD45\uDD47-\uDD4C\uDD50-\uDD6B\uDD80-\uDD97\uDDC0\uDDD0-\uDDE6])\uFE0F|[\t-\r \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000\uFEFF])+$")
|
||||
(def regx-rtl-characters #"[^\u0591-\u06EF\u06FA-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]*?[\u0591-\u06EF\u06FA-\u07FF\u200F\u202B\u202E\uFB1D-\uFDFD\uFE70-\uFEFC]")
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
(upsert-contact contact)
|
||||
(mailserver/upsert-mailserver-topic
|
||||
{:chat-ids [public-key]
|
||||
:topic transport.topic/discovery-topic-hash
|
||||
:topic (transport.topic/discovery-topic-hash)
|
||||
:fetch? false})
|
||||
(send-contact-request contact)
|
||||
(mailserver/process-next-messages-request)))))
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
128 public-key
|
||||
nil)]
|
||||
(when normalized-key
|
||||
(subs (.sha3 js-dependencies/Web3.prototype normalized-key #js {:encoding "hex"}) 26))))
|
||||
(subs (.sha3 (js-dependencies/web3-prototype) normalized-key #js {:encoding "hex"}) 26))))
|
||||
|
||||
(defn public-key->new-contact [public-key]
|
||||
{:name (gfycat/generate-gfy public-key)
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
[status-im.constants :as constants]
|
||||
[status-im.data-store.realm.core :as core]
|
||||
[status-im.utils.core :as utils]
|
||||
[status-im.js-dependencies :as dependencies]))
|
||||
[status-im.js-dependencies :as dependencies]
|
||||
[taoensso.timbre :as log]))
|
||||
|
||||
(defn- transform-message [{:keys [content] :as message}]
|
||||
(when-let [parsed-content (utils/safe-read-message-content content)]
|
||||
|
@ -78,7 +79,7 @@
|
|||
(assoc cofx :get-stored-messages get-by-chat-id)))
|
||||
|
||||
(defn- sha3 [s]
|
||||
(.sha3 dependencies/Web3.prototype s))
|
||||
(.sha3 (dependencies/web3-prototype) s))
|
||||
|
||||
(re-frame/reg-cofx
|
||||
:data-store/get-referenced-messages
|
||||
|
|
|
@ -154,7 +154,7 @@
|
|||
(open-realm (last schemas) file-name encryption-key))
|
||||
|
||||
(defn keccak512-array [key]
|
||||
(.array (.-keccak512 js-dependencies/js-sha3) key))
|
||||
(.array (.-keccak512 (js-dependencies/js-sha3)) key))
|
||||
|
||||
(defn merge-Uint8Arrays [arr1 arr2]
|
||||
(let [arr1-length (.-length arr1)
|
||||
|
@ -165,8 +165,9 @@
|
|||
arr))
|
||||
|
||||
(defn db-encryption-key [password encryption-key]
|
||||
(let [password-array (.encode
|
||||
(new (.-TextEncoder js-dependencies/text-encoding))
|
||||
(let [TextEncoder (.-TextEncoder (js-dependencies/text-encoding))
|
||||
password-array (.encode
|
||||
(new TextEncoder)
|
||||
password)]
|
||||
(keccak512-array (merge-Uint8Arrays encryption-key password-array))))
|
||||
|
||||
|
|
|
@ -191,7 +191,7 @@
|
|||
"status-im.transport.message.protocol"))
|
||||
|
||||
(defn sha3 [s]
|
||||
(.sha3 dependencies/Web3.prototype s))
|
||||
(.sha3 (dependencies/web3-prototype) s))
|
||||
|
||||
(defn old-message-id
|
||||
"Calculates the same `message-id` as was used in `0.9.31`"
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
(reagent/create-class
|
||||
{:component-will-mount
|
||||
(fn []
|
||||
(.addEventListener react/app-state "change" app-state-change-handler))
|
||||
(.addEventListener (react/app-state) "change" app-state-change-handler))
|
||||
:component-did-mount
|
||||
(fn [this]
|
||||
(re-frame/dispatch [:set-initial-props (reagent/props this)]))
|
||||
:component-will-unmount
|
||||
(fn []
|
||||
(.stop react/http-bridge)
|
||||
(.removeEventListener react/app-state "change" app-state-change-handler))
|
||||
(.stop (react/http-bridge))
|
||||
(.removeEventListener (react/app-state) "change" app-state-change-handler))
|
||||
:display-name "root"
|
||||
:reagent-render views/main})
|
||||
(reagent/create-class
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
"Status Android"))
|
||||
|
||||
(defn respond! [request-id status-code data]
|
||||
(.respond react/http-bridge
|
||||
(.respond (react/http-bridge)
|
||||
request-id
|
||||
status-code
|
||||
"application/json"
|
||||
(types/clj->json data)))
|
||||
|
||||
(defn start! []
|
||||
(.start react/http-bridge
|
||||
(.start (react/http-bridge)
|
||||
port
|
||||
server-name
|
||||
(fn [req]
|
||||
|
@ -33,4 +33,4 @@
|
|||
(log/debug "Error: " e))))))
|
||||
|
||||
(defn stop! []
|
||||
(.stop react/http-bridge))
|
||||
(.stop (react/http-bridge)))
|
||||
|
|
|
@ -4,54 +4,54 @@
|
|||
[status-im.js-dependencies :as dependencies]))
|
||||
;; Utility functions for encoding
|
||||
|
||||
(def utils dependencies/web3-utils)
|
||||
(defn utils [] (dependencies/web3-utils))
|
||||
|
||||
(defn right-pad [x]
|
||||
(let [len (count x)
|
||||
to-pad (- 64 (mod len 64))]
|
||||
(if (= 64 to-pad)
|
||||
x
|
||||
(.rightPad utils x (+ len to-pad)))))
|
||||
(.rightPad (utils) x (+ len to-pad)))))
|
||||
|
||||
(defn left-pad [x]
|
||||
(let [len (count x)
|
||||
to-pad (- 64 (mod len 64))]
|
||||
(if (= 64 to-pad)
|
||||
x
|
||||
(.leftPad utils x (+ len to-pad)))))
|
||||
(.leftPad (utils) x (+ len to-pad)))))
|
||||
|
||||
(defn to-two-complement [x]
|
||||
(when x
|
||||
(subs (.toTwosComplement utils x) 2)))
|
||||
(subs (.toTwosComplement (utils) x) 2)))
|
||||
|
||||
(defn from-utf8 [x]
|
||||
(when x
|
||||
(subs (.fromUtf8 utils x) 2)))
|
||||
(subs (.fromUtf8 (utils) x) 2)))
|
||||
|
||||
(defn hex-to-boolean [x]
|
||||
(= x "0x0"))
|
||||
|
||||
(defn bytes-to-hex [x]
|
||||
(when x
|
||||
(subs (.bytesToHex utils x) 2)))
|
||||
(subs (.bytesToHex (utils) x) 2)))
|
||||
|
||||
(defn number-to-hex [x]
|
||||
(when x
|
||||
(subs (.numberToHex utils x) 2)))
|
||||
(subs (.numberToHex (utils) x) 2)))
|
||||
|
||||
(defn hex-to-utf8 [x]
|
||||
(.hexToUtf8 utils (str "0x" x)))
|
||||
(.hexToUtf8 (utils) (str "0x" x)))
|
||||
|
||||
(defn hex-to-number [x]
|
||||
(when x
|
||||
(let [hex-x (str "0x" x)]
|
||||
(try
|
||||
(.hexToNumber utils hex-x)
|
||||
(.hexToNumber (utils) hex-x)
|
||||
(catch :default err
|
||||
(.hexToNumberString utils hex-x))))))
|
||||
(.hexToNumberString (utils) hex-x))))))
|
||||
|
||||
(defn sha3 [s]
|
||||
(.sha3 utils (str s)))
|
||||
(.sha3 (utils) (str s)))
|
||||
|
||||
(defn is-hex? [value]
|
||||
(when value
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
|
||||
(defn address? [s]
|
||||
(when s
|
||||
(.isAddress dependencies/Web3.prototype s)))
|
||||
(.isAddress (dependencies/web3-prototype) s)))
|
||||
|
||||
(defn network->chain-id [network]
|
||||
(get-in network [:config :NetworkId]))
|
||||
|
@ -70,9 +70,9 @@
|
|||
|
||||
(defn sha3
|
||||
([s]
|
||||
(.sha3 dependencies/Web3.prototype (str s)))
|
||||
(.sha3 (dependencies/web3-prototype) (str s)))
|
||||
([s opts]
|
||||
(.sha3 dependencies/Web3.prototype (str s) (clj->js opts))))
|
||||
(.sha3 (dependencies/web3-prototype) (str s) (clj->js opts))))
|
||||
|
||||
(def default-transaction-gas (money/bignumber 21000))
|
||||
|
||||
|
|
|
@ -7,15 +7,15 @@
|
|||
(:require [clojure.string :as string]
|
||||
[status-im.js-dependencies :as dependencies]))
|
||||
|
||||
(def utils dependencies/web3-utils)
|
||||
(defn utils [] (dependencies/web3-utils))
|
||||
|
||||
(defn address->checksum
|
||||
"Converts an arbitrary case address to one with correct checksum case."
|
||||
[address]
|
||||
(when address
|
||||
(.toChecksumAddress utils address)))
|
||||
(.toChecksumAddress (utils) address)))
|
||||
|
||||
(defn valid-address-checksum?
|
||||
"Checks address checksum validity."
|
||||
[address]
|
||||
(.checkAddressChecksum utils address))
|
||||
(.checkAddressChecksum (utils) address))
|
||||
|
|
|
@ -4,10 +4,19 @@
|
|||
|
||||
(defn token-icon-path
|
||||
[network symbol]
|
||||
(let [s (str "./resources/images/tokens/" (name network) "/" (name symbol) ".png")]
|
||||
(let [s (str "./resources/images/tokens/" (name network) "/" (name symbol) ".png")
|
||||
image (gensym)]
|
||||
(if (.exists (io/file s))
|
||||
`(js/require ~s)
|
||||
`(js/require "./resources/images/tokens/default-token.png"))))
|
||||
`(let [~image (atom nil)]
|
||||
(fn []
|
||||
(or @~image
|
||||
(reset! ~image (js/require ~s)))))
|
||||
`(let [~image (atom nil)]
|
||||
(fn []
|
||||
(or
|
||||
@~image
|
||||
(reset! ~image
|
||||
(js/require "./resources/images/tokens/default-token.png"))))))))
|
||||
|
||||
(defn- token->icon [network {:keys [icon symbol]}]
|
||||
;; Tokens can define their own icons.
|
||||
|
@ -21,10 +30,19 @@
|
|||
(mapv #(assoc-in % [:icon :source] (token->icon network %)) tokens))
|
||||
|
||||
(defn network->icon [network]
|
||||
(let [s (str "./resources/images/tokens/" (name network) "/0-native.png")]
|
||||
(let [s (str "./resources/images/tokens/" (name network) "/0-native.png")
|
||||
image (gensym)]
|
||||
(if (.exists (io/file s))
|
||||
`(js/require ~s)
|
||||
`(js/require "./resources/images/tokens/default-native.png"))))
|
||||
`(let [~image (atom nil)]
|
||||
(fn []
|
||||
(or @~image
|
||||
(reset! ~image (js/require ~s)))))
|
||||
`(let [~image (atom nil)]
|
||||
(fn []
|
||||
(or
|
||||
@~image
|
||||
(reset! ~image
|
||||
(js/require "./resources/images/tokens/default-native.png"))))))))
|
||||
|
||||
(defmacro resolve-native-currency-icons
|
||||
"In react-native arguments to require must be static strings.
|
||||
|
|
|
@ -7,10 +7,12 @@
|
|||
{:border-color color :border-width 1 :border-radius 32})
|
||||
|
||||
(def default-native-currency
|
||||
{:name "Native"
|
||||
:symbol :ETH
|
||||
:decimals 18
|
||||
:icon {:source (js/require "./resources/images/tokens/default-native.png")}})
|
||||
(memoize
|
||||
(fn []
|
||||
{:name "Native"
|
||||
:symbol :ETH
|
||||
:decimals 18
|
||||
:icon {:source (js/require "./resources/images/tokens/default-native.png")}})))
|
||||
|
||||
(def all-native-currencies
|
||||
(ethereum.macros/resolve-native-currency-icons
|
||||
|
@ -40,7 +42,7 @@
|
|||
(set (map #(-> % val :symbol) all-native-currencies)))
|
||||
|
||||
(defn native-currency [chain]
|
||||
(-> (get all-native-currencies chain default-native-currency)))
|
||||
(-> (get all-native-currencies chain (default-native-currency))))
|
||||
|
||||
(defn ethereum? [symbol]
|
||||
(native-currency-symbols symbol))
|
||||
|
|
|
@ -184,7 +184,7 @@
|
|||
(def CUD-url "https://chaos-unicorn-day.org")
|
||||
|
||||
(defn open-chaos-unicorn-day-link []
|
||||
(.openURL react/linking CUD-url))
|
||||
(.openURL (react/linking) CUD-url))
|
||||
|
||||
(handlers/register-handler-fx
|
||||
:accounts.ui/chaos-mode-switched
|
||||
|
|
|
@ -47,8 +47,8 @@
|
|||
[tooltip/tooltip error (styles/error error)])])
|
||||
|
||||
(defn touchable-opacity [{:keys [style on-press]} & children]
|
||||
(into [react/touchable-opacity (merge (when on-press {:on-press #(on-press {})})
|
||||
(when style {:style style}))] children))
|
||||
(into [(react/touchable-opacity) (merge (when on-press {:on-press #(on-press {})})
|
||||
(when style {:style style}))] children))
|
||||
|
||||
(defn image [{:keys [source uri style]}]
|
||||
[react/image (merge {:style (merge {:width 100 :height 100} style)} {:source (if source source {:uri uri})})])
|
||||
|
@ -57,7 +57,7 @@
|
|||
[react/text (merge {:style {:color colors/white
|
||||
:text-decoration-line :underline}
|
||||
:on-press (case open-in
|
||||
:device #(.openURL react/linking uri)
|
||||
:device #(.openURL (react/linking) uri)
|
||||
:status #(re-frame/dispatch [:browser.ui/open-in-status-option-selected uri])
|
||||
#(re-frame/dispatch [:browser.ui/message-link-pressed uri]))}
|
||||
(when style {:style style}))
|
||||
|
@ -119,7 +119,7 @@
|
|||
(apply abstract-view react/view o children))
|
||||
|
||||
(defn scroll-view [o & children]
|
||||
(apply abstract-view react/scroll-view o children))
|
||||
(apply abstract-view (react/scroll-view) o children))
|
||||
|
||||
(defn keyboard-avoiding-view [o & children]
|
||||
(apply abstract-view react/keyboard-avoiding-view o children))
|
||||
|
@ -158,4 +158,4 @@
|
|||
:fly? :boolean
|
||||
:interactive? :boolean
|
||||
:on-change :event}}
|
||||
'map-link {:data map-link :properties {:text :string :lng :any :lat :any}}})
|
||||
'map-link {:data map-link :properties {:text :string :lng :any :lat :any}}})
|
||||
|
|
|
@ -14,7 +14,9 @@
|
|||
(def mapview-html (slurp "resources/mapview/mapview.html"))
|
||||
|
||||
(def webview-class
|
||||
(reagent/adapt-react-class (.-WebView js-dependencies/webview)))
|
||||
(memoize
|
||||
(fn []
|
||||
(reagent/adapt-react-class (.-WebView js-dependencies/webview)))))
|
||||
|
||||
(defn map-component
|
||||
"creates a webview reagent component which cause webview to be updated only when style changes.
|
||||
|
@ -32,7 +34,7 @@
|
|||
false)))
|
||||
:reagent-render
|
||||
(fn [opts]
|
||||
[webview-class opts])}))
|
||||
[(webview-class) opts])}))
|
||||
|
||||
(defn- on-map-message [map-event on-change]
|
||||
(let [data (-> map-event
|
||||
|
@ -69,7 +71,7 @@
|
|||
:on-should-start-load-with-request #(let [url (.-url %)]
|
||||
(if (string/starts-with? url "file")
|
||||
true
|
||||
(do (.openURL react/linking url) false)))
|
||||
(do (.openURL (react/linking) url) false)))
|
||||
|
||||
:ref #(reset! webview %)
|
||||
:on-message #(when on-change (on-map-message % on-change))
|
||||
|
@ -78,4 +80,4 @@
|
|||
(if (map? marker)
|
||||
(str "update(" (types/clj->json (assoc marker :fly fly? :interactive interactive?)) ");")
|
||||
(str "init(" (types/clj->json {:interactive interactive?}) ");")))}
|
||||
webview]))
|
||||
webview]))
|
||||
|
|
|
@ -220,7 +220,7 @@
|
|||
:db (assoc db :group/selected-contacts #{})}
|
||||
(mailserver/upsert-mailserver-topic
|
||||
{:chat-ids [chat-id]
|
||||
:topic transport.topic/discovery-topic-hash
|
||||
:topic (transport.topic/discovery-topic-hash)
|
||||
:fetch? false})
|
||||
(mailserver/process-next-messages-request))))
|
||||
|
||||
|
@ -257,7 +257,7 @@
|
|||
:events [event]}}
|
||||
(mailserver/upsert-mailserver-topic
|
||||
{:chat-ids [chat-id]
|
||||
:topic transport.topic/discovery-topic-hash
|
||||
:topic (transport.topic/discovery-topic-hash)
|
||||
:fetch false})
|
||||
(mailserver/process-next-messages-request)))))
|
||||
|
||||
|
|
|
@ -2,11 +2,11 @@
|
|||
(:require [re-frame.core :as re-frame]
|
||||
[status-im.react-native.js-dependencies :as js-dependencies]
|
||||
[status-im.utils.config :as config]
|
||||
[status-im.utils.platform :as platform]
|
||||
[taoensso.timbre :as log]))
|
||||
[status-im.utils.platform :as platform]))
|
||||
|
||||
(defonce keycard (.-default js-dependencies/status-keycard))
|
||||
(defonce event-emitter (.-DeviceEventEmitter js-dependencies/react-native))
|
||||
(defn keycard [] (.-default (js-dependencies/status-keycard)))
|
||||
(defn event-emitter []
|
||||
(.-DeviceEventEmitter js-dependencies/react-native))
|
||||
|
||||
(defn- error-object->map [object]
|
||||
{:code (.-code object)
|
||||
|
@ -15,24 +15,24 @@
|
|||
(defn check-nfc-support []
|
||||
(when (and config/hardwallet-enabled?
|
||||
platform/android?)
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
nfcIsSupported
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/check-nfc-support-success %])))))
|
||||
|
||||
(defn check-nfc-enabled []
|
||||
(when (and config/hardwallet-enabled?
|
||||
platform/android?)
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
nfcIsEnabled
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/check-nfc-enabled-success %])))))
|
||||
|
||||
(defn open-nfc-settings []
|
||||
(when platform/android?
|
||||
(.openNfcSettings keycard)))
|
||||
(.openNfcSettings (keycard))))
|
||||
|
||||
(defn remove-event-listeners []
|
||||
(doseq [event ["keyCardOnConnected" "keyCardOnDisconnected"]]
|
||||
(.removeAllListeners event-emitter event)))
|
||||
(.removeAllListeners (event-emitter) event)))
|
||||
|
||||
(defn register-card-events []
|
||||
(when (and config/hardwallet-enabled?)
|
||||
|
@ -41,38 +41,38 @@
|
|||
|
||||
(re-frame/dispatch [:hardwallet.callback/on-register-card-events
|
||||
{:on-card-connected
|
||||
(.addListener event-emitter
|
||||
(.addListener (event-emitter)
|
||||
"keyCardOnConnected"
|
||||
#(re-frame/dispatch [:hardwallet.callback/on-card-connected %]))
|
||||
|
||||
:on-card-disconnected
|
||||
(.addListener event-emitter
|
||||
(.addListener (event-emitter)
|
||||
"keyCardOnDisconnected"
|
||||
#(re-frame/dispatch [:hardwallet.callback/on-card-disconnected %]))}])))
|
||||
|
||||
(defn get-application-info [{:keys [pairing on-success]}]
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(getApplicationInfo (str pairing))
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-get-application-info-success % on-success]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-get-application-info-error (error-object->map %)]))))
|
||||
|
||||
(defn install-applet []
|
||||
(when config/hardwallet-enabled?
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
installApplet
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-install-applet-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-install-applet-error (error-object->map %)])))))
|
||||
|
||||
(defn init-card [pin]
|
||||
(when config/hardwallet-enabled?
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(init pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-init-card-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-init-card-error (error-object->map %)])))))
|
||||
|
||||
(defn install-applet-and-init-card [pin]
|
||||
(when config/hardwallet-enabled?
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(installAppletAndInitCard pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-install-applet-and-init-card-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-install-applet-and-init-card-error (error-object->map %)])))))
|
||||
|
@ -80,7 +80,7 @@
|
|||
(defn pair
|
||||
[{:keys [password]}]
|
||||
(when password
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(pair password)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-pairing-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-pairing-error (error-object->map %)])))))
|
||||
|
@ -88,7 +88,7 @@
|
|||
(defn generate-mnemonic
|
||||
[{:keys [pairing words]}]
|
||||
(when pairing
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(generateMnemonic pairing words)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-generate-mnemonic-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-generate-mnemonic-error (error-object->map %)])))))
|
||||
|
@ -96,7 +96,7 @@
|
|||
(defn generate-and-load-key
|
||||
[{:keys [mnemonic pairing pin]}]
|
||||
(when pairing
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(generateAndLoadKey mnemonic pairing pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-generate-and-load-key-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-generate-and-load-key-error (error-object->map %)])))))
|
||||
|
@ -104,7 +104,7 @@
|
|||
(defn unblock-pin
|
||||
[{:keys [puk new-pin pairing]}]
|
||||
(when (and pairing new-pin puk)
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(unblockPin pairing puk new-pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-unblock-pin-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-unblock-pin-error (error-object->map %)])))))
|
||||
|
@ -112,7 +112,7 @@
|
|||
(defn verify-pin
|
||||
[{:keys [pin pairing]}]
|
||||
(when (and pairing (not-empty pin))
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(verifyPin pairing pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-verify-pin-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-verify-pin-error (error-object->map %)])))))
|
||||
|
@ -120,7 +120,7 @@
|
|||
(defn change-pin
|
||||
[{:keys [current-pin new-pin pairing]}]
|
||||
(when (and pairing current-pin new-pin)
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(changePin pairing current-pin new-pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-change-pin-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-change-pin-error (error-object->map %)])))))
|
||||
|
@ -128,28 +128,28 @@
|
|||
(defn unpair
|
||||
[{:keys [pin pairing]}]
|
||||
(when (and pairing pin)
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(unpair pairing pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-unpair-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-unpair-error (error-object->map %)])))))
|
||||
|
||||
(defn delete
|
||||
[]
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(delete)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-delete-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-delete-error (error-object->map %)]))))
|
||||
|
||||
(defn remove-key
|
||||
[{:keys [pin pairing]}]
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(removeKey pairing pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-remove-key-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-remove-key-error (error-object->map %)]))))
|
||||
|
||||
(defn remove-key-with-unpair
|
||||
[{:keys [pin pairing]}]
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(removeKeyWithUnpair pairing pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-remove-key-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-remove-key-error (error-object->map %)]))))
|
||||
|
@ -157,7 +157,7 @@
|
|||
(defn unpair-and-delete
|
||||
[{:keys [pin pairing]}]
|
||||
(when (and pairing pin)
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(unpairAndDelete pairing pin)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-delete-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-delete-error (error-object->map %)])))))
|
||||
|
@ -165,7 +165,7 @@
|
|||
(defn get-keys
|
||||
[{:keys [pairing pin on-success]}]
|
||||
(when (and pairing (not-empty pin))
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(getKeys pairing pin)
|
||||
(then #(re-frame/dispatch [(or on-success :hardwallet.callback/on-get-keys-success) %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-get-keys-error (error-object->map %)])))))
|
||||
|
@ -173,7 +173,7 @@
|
|||
(defn sign
|
||||
[{:keys [pairing pin hash]}]
|
||||
(when (and pairing pin hash)
|
||||
(.. keycard
|
||||
(.. (keycard)
|
||||
(sign pairing pin hash)
|
||||
(then #(re-frame/dispatch [:hardwallet.callback/on-sign-success %]))
|
||||
(catch #(re-frame/dispatch [:hardwallet.callback/on-sign-error (error-object->map %)])))))
|
||||
|
|
|
@ -27,21 +27,21 @@
|
|||
(reagent/create-class
|
||||
{:component-will-mount
|
||||
(fn []
|
||||
(.addListener react/keyboard
|
||||
(.addListener (react/keyboard)
|
||||
"keyboardWillShow"
|
||||
(fn [e]
|
||||
(let [h (.. e -endCoordinates -height)]
|
||||
(when-not (= h @keyboard-height)
|
||||
(dispatch [:set :keyboard-height h])
|
||||
(dispatch [:set :keyboard-max-height h])))))
|
||||
(.addListener react/keyboard
|
||||
(.addListener (react/keyboard)
|
||||
"keyboardWillHide"
|
||||
#(when-not (= 0 @keyboard-height)
|
||||
(dispatch [:set :keyboard-height 0])))
|
||||
(.hide react/splash-screen)
|
||||
(.addEventListener react/app-state "change" app-state-change-handler)
|
||||
(.addEventListener (react/app-state) "change" app-state-change-handler)
|
||||
(.addEventListener rn-dependencies/react-native-languages "change" on-languages-change)
|
||||
(.addEventListener rn-dependencies/react-native-shake
|
||||
(.addEventListener (rn-dependencies/react-native-shake)
|
||||
"ShakeEvent"
|
||||
on-shake))
|
||||
:component-did-mount
|
||||
|
@ -49,10 +49,10 @@
|
|||
(dispatch [:set-initial-props (reagent/props this)]))
|
||||
:component-will-unmount
|
||||
(fn []
|
||||
(.stop react/http-bridge)
|
||||
(.removeEventListener react/app-state "change" app-state-change-handler)
|
||||
(.stop (react/http-bridge))
|
||||
(.removeEventListener (react/app-state) "change" app-state-change-handler)
|
||||
(.removeEventListener rn-dependencies/react-native-languages "change" on-languages-change)
|
||||
(.removeEventListener rn-dependencies/react-native-shake
|
||||
(.removeEventListener (rn-dependencies/react-native-shake)
|
||||
"ShakeEvent"
|
||||
on-shake))
|
||||
:display-name "root"
|
||||
|
|
|
@ -1,12 +1,14 @@
|
|||
(ns status-im.js-dependencies)
|
||||
(ns status-im.js-dependencies
|
||||
(:require-macros [status-im.utils.js-require :as js-require]))
|
||||
|
||||
(def Chance (js/require "chance"))
|
||||
(def emojis (js/require "emojilib"))
|
||||
(def phishing-detect (js/require "eth-phishing-detect"))
|
||||
(def homoglyph-finder (js/require "homoglyph-finder"))
|
||||
(def identicon-js (js/require "identicon.js"))
|
||||
(def Web3 (js/require "web3"))
|
||||
(def text-encoding (js/require "text-encoding"))
|
||||
(def js-sha3 (js/require "js-sha3"))
|
||||
(def web3-utils (js/require "web3-utils"))
|
||||
(def hi-base32 (js/require "hi-base32"))
|
||||
(def Chance (js-require/js-require "chance"))
|
||||
(def emojis (js-require/js-require "emojilib"))
|
||||
(def phishing-detect (js-require/js-require "eth-phishing-detect"))
|
||||
(def homoglyph-finder (js-require/js-require "homoglyph-finder"))
|
||||
(def identicon-js (js-require/js-require "identicon.js"))
|
||||
(def Web3 (js-require/js-require "web3"))
|
||||
(defn web3-prototype [] (.-prototype (Web3)))
|
||||
(def text-encoding (js-require/js-require "text-encoding"))
|
||||
(def js-sha3 (js-require/js-require "js-sha3"))
|
||||
(def web3-utils (js-require/js-require "web3-utils"))
|
||||
(def hi-base32 (js-require/js-require "hi-base32"))
|
||||
|
|
|
@ -517,7 +517,7 @@
|
|||
[{:keys [db] :as cofx} chat-id]
|
||||
(let [{:keys [public?] :as chat} (get-in db [:chats chat-id])
|
||||
topic (if (and chat (not public?))
|
||||
transport.topic/discovery-topic-hash
|
||||
(transport.topic/discovery-topic-hash)
|
||||
(get-in db [:transport/chats chat-id :topic]))
|
||||
{:keys [chat-ids] :as mailserver-topic} (update (get-in db [:mailserver/topics topic])
|
||||
:chat-ids
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
[clojure.string :as string]
|
||||
[status-im.utils.platform :as platform]))
|
||||
|
||||
(def status
|
||||
(defn status []
|
||||
(when (exists? (.-NativeModules rn-dependencies/react-native))
|
||||
(.-Status (.-NativeModules rn-dependencies/react-native))))
|
||||
|
||||
|
@ -20,20 +20,20 @@
|
|||
|
||||
(defn stop-node []
|
||||
(reset! node-started false)
|
||||
(when status
|
||||
(.stopNode status)))
|
||||
(when (status)
|
||||
(.stopNode (status))))
|
||||
|
||||
(defn node-ready []
|
||||
(reset! node-started true))
|
||||
|
||||
(defn start-node [config]
|
||||
(when status
|
||||
(.startNode status config)))
|
||||
(when (status)
|
||||
(.startNode (status) config)))
|
||||
|
||||
(defonce account-creation? (atom false))
|
||||
|
||||
(defn create-account [password on-result]
|
||||
(when status
|
||||
(when (status)
|
||||
(let [callback (fn [data]
|
||||
(reset! account-creation? false)
|
||||
(on-result data))]
|
||||
|
@ -41,132 +41,132 @@
|
|||
(fn [creation?]
|
||||
(if-not creation?
|
||||
(do
|
||||
(.createAccount status password callback)
|
||||
(.createAccount (status) password callback)
|
||||
true)
|
||||
false))))))
|
||||
|
||||
(defn send-data-notification [{:keys [data-payload tokens] :as m} on-result]
|
||||
(when status
|
||||
(.sendDataNotification status data-payload tokens on-result)))
|
||||
(when (status)
|
||||
(.sendDataNotification (status) data-payload tokens on-result)))
|
||||
|
||||
(defn send-logs [dbJson js-logs callback]
|
||||
(when status
|
||||
(.sendLogs status dbJson js-logs callback)))
|
||||
(when (status)
|
||||
(.sendLogs (status) dbJson js-logs callback)))
|
||||
|
||||
(defn add-peer [enode on-result]
|
||||
(when (and @node-started status)
|
||||
(.addPeer status enode on-result)))
|
||||
(when (and @node-started (status))
|
||||
(.addPeer (status) enode on-result)))
|
||||
|
||||
(defn recover-account [passphrase password on-result]
|
||||
(when (and @node-started status)
|
||||
(.recoverAccount status passphrase password on-result)))
|
||||
(when (and @node-started (status))
|
||||
(.recoverAccount (status) passphrase password on-result)))
|
||||
|
||||
(defn login [address password on-result]
|
||||
(when (and @node-started status)
|
||||
(.login status address password on-result)))
|
||||
(when (and @node-started (status))
|
||||
(.login (status) address password on-result)))
|
||||
|
||||
(defn verify [address password on-result]
|
||||
(when (and @node-started status)
|
||||
(.verify status address password on-result)))
|
||||
(when (and @node-started (status))
|
||||
(.verify (status) address password on-result)))
|
||||
|
||||
(defn login-with-keycard [whisper-private-key encryption-public-key on-result]
|
||||
(when (and @node-started status)
|
||||
(.loginWithKeycard status whisper-private-key encryption-public-key on-result)))
|
||||
(when (and @node-started (status))
|
||||
(.loginWithKeycard (status) whisper-private-key encryption-public-key on-result)))
|
||||
|
||||
(defn set-soft-input-mode [mode]
|
||||
(when status
|
||||
(.setSoftInputMode status mode)))
|
||||
(when (status)
|
||||
(.setSoftInputMode (status) mode)))
|
||||
|
||||
(defn clear-web-data []
|
||||
(when status
|
||||
(.clearCookies status)
|
||||
(.clearStorageAPIs status)))
|
||||
(when (status)
|
||||
(.clearCookies (status))
|
||||
(.clearStorageAPIs (status))))
|
||||
|
||||
(defn call-rpc [payload callback]
|
||||
(when (and @node-started status)
|
||||
(.callRPC status payload callback)))
|
||||
(when (and @node-started (status))
|
||||
(.callRPC (status) payload callback)))
|
||||
|
||||
(defn call-private-rpc [payload callback]
|
||||
(when (and @node-started status)
|
||||
(.callPrivateRPC status payload callback)))
|
||||
(when (and @node-started (status))
|
||||
(.callPrivateRPC (status) payload callback)))
|
||||
|
||||
(defn sign-message [rpcParams callback]
|
||||
(when (and @node-started status)
|
||||
(.signMessage status rpcParams callback)))
|
||||
(when (and @node-started (status))
|
||||
(.signMessage (status) rpcParams callback)))
|
||||
|
||||
(defn hash-transaction [rpcParams callback]
|
||||
(when (and @node-started status)
|
||||
(.hashTransaction status rpcParams callback)))
|
||||
(when (and @node-started (status))
|
||||
(.hashTransaction (status) rpcParams callback)))
|
||||
|
||||
(defn hash-message [message callback]
|
||||
(when (and @node-started status)
|
||||
(.hashMessage status message callback)))
|
||||
(when (and @node-started (status))
|
||||
(.hashMessage (status) message callback)))
|
||||
|
||||
(defn hash-typed-data [data callback]
|
||||
(when (and @node-started status)
|
||||
(.hashTypedData status data callback)))
|
||||
(when (and @node-started (status))
|
||||
(.hashTypedData (status) data callback)))
|
||||
|
||||
(defn sign-typed-data [data password callback]
|
||||
(when (and @node-started status)
|
||||
(.signTypedData status data password callback)))
|
||||
(when (and @node-started (status))
|
||||
(.signTypedData (status) data password callback)))
|
||||
|
||||
(defn send-transaction [rpcParams password callback]
|
||||
(when (and @node-started status)
|
||||
(.sendTransaction status rpcParams password callback)))
|
||||
(when (and @node-started (status))
|
||||
(.sendTransaction (status) rpcParams password callback)))
|
||||
|
||||
(defn send-transaction-with-signature [rpcParams sig callback]
|
||||
(when (and @node-started status)
|
||||
(.sendTransactionWithSignature status rpcParams sig callback)))
|
||||
(when (and @node-started (status))
|
||||
(.sendTransactionWithSignature (status) rpcParams sig callback)))
|
||||
|
||||
(defn close-application []
|
||||
(.closeApplication status))
|
||||
(.closeApplication (status)))
|
||||
|
||||
(defn connection-change [{:keys [type expensive?]}]
|
||||
(.connectionChange status type expensive?))
|
||||
(.connectionChange (status) type expensive?))
|
||||
|
||||
(defn app-state-change [state]
|
||||
(.appStateChange status state))
|
||||
(.appStateChange (status) state))
|
||||
|
||||
(defn get-device-UUID [callback]
|
||||
(.getDeviceUUID
|
||||
status
|
||||
(status)
|
||||
(fn [UUID]
|
||||
(callback (string/upper-case UUID)))))
|
||||
|
||||
(defn set-blank-preview-flag [flag]
|
||||
(.setBlankPreviewFlag status flag))
|
||||
(.setBlankPreviewFlag (status) flag))
|
||||
|
||||
(defn extract-group-membership-signatures [signature-pairs callback]
|
||||
(when status
|
||||
(.extractGroupMembershipSignatures status signature-pairs callback)))
|
||||
(when (status)
|
||||
(.extractGroupMembershipSignatures (status) signature-pairs callback)))
|
||||
|
||||
(defn sign-group-membership [content callback]
|
||||
(when status
|
||||
(.signGroupMembership status content callback)))
|
||||
(when (status)
|
||||
(.signGroupMembership (status) content callback)))
|
||||
|
||||
(defn enable-installation [installation-id callback]
|
||||
(when status
|
||||
(.enableInstallation status installation-id callback)))
|
||||
(when (status)
|
||||
(.enableInstallation (status) installation-id callback)))
|
||||
|
||||
(defn disable-installation [installation-id callback]
|
||||
(when status
|
||||
(.disableInstallation status installation-id callback)))
|
||||
(when (status)
|
||||
(.disableInstallation (status) installation-id callback)))
|
||||
|
||||
(defn is24Hour []
|
||||
(when status
|
||||
(.-is24Hour status)))
|
||||
(when (status)
|
||||
(.-is24Hour (status))))
|
||||
|
||||
(defn update-mailservers [enodes on-result]
|
||||
(when status
|
||||
(.updateMailservers status enodes on-result)))
|
||||
(when (status)
|
||||
(.updateMailservers (status) enodes on-result)))
|
||||
|
||||
(defn chaos-mode-update [on on-result]
|
||||
(when status
|
||||
(.chaosModeUpdate status on on-result)))
|
||||
(when (status)
|
||||
(.chaosModeUpdate (status) on on-result)))
|
||||
|
||||
(defn get-nodes-from-contract [rpc-endpoint contract-address on-result]
|
||||
(when status
|
||||
(.getNodesFromContract status rpc-endpoint contract-address on-result)))
|
||||
(when (status)
|
||||
(.getNodesFromContract (status) rpc-endpoint contract-address on-result)))
|
||||
|
||||
(defn rooted-device? [callback]
|
||||
(cond
|
||||
|
@ -181,8 +181,8 @@
|
|||
|
||||
;; we check root on android
|
||||
platform/android?
|
||||
(if status
|
||||
(.isDeviceRooted status callback)
|
||||
(if (status)
|
||||
(.isDeviceRooted (status) callback)
|
||||
;; if module isn't initialized we return true to avoid degrading security
|
||||
(callback true))
|
||||
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
[status-im.utils.platform :as platform]))
|
||||
|
||||
(defn is-connected? [callback]
|
||||
(when react-components/net-info
|
||||
(.then (.fetch (.-isConnected react-components/net-info))
|
||||
(when (react-components/net-info)
|
||||
(.then (.fetch (.-isConnected (react-components/net-info)))
|
||||
(fn [is-connected?]
|
||||
(log/debug "Is connected?" is-connected?)
|
||||
(callback is-connected?)))))
|
||||
|
@ -16,21 +16,21 @@
|
|||
on-success #(callback {:type (:type info) :expensive? %})]
|
||||
(if platform/ios?
|
||||
(on-success false)
|
||||
(.. react-components/net-info
|
||||
(.. (react-components/net-info)
|
||||
isConnectionExpensive
|
||||
(then on-success)
|
||||
(catch (fn [error] (log/warn "isConnectionExpensive: " error))))))))
|
||||
|
||||
(defn net-info [callback]
|
||||
(when react-components/net-info
|
||||
(.then (.getConnectionInfo react-components/net-info)
|
||||
(when (react-components/net-info)
|
||||
(.then (.getConnectionInfo (react-components/net-info))
|
||||
(wrap-net-info callback))))
|
||||
|
||||
(defn add-connection-listener [listener]
|
||||
(when react-components/net-info
|
||||
(.addEventListener (.-isConnected react-components/net-info) "connectionChange" listener)))
|
||||
(when (react-components/net-info)
|
||||
(.addEventListener (.-isConnected (react-components/net-info)) "connectionChange" listener)))
|
||||
|
||||
(defn add-net-info-listener [listener]
|
||||
(when react-components/net-info
|
||||
(.addEventListener react-components/net-info "connectionChange"
|
||||
(when (react-components/net-info)
|
||||
(.addEventListener (react-components/net-info) "connectionChange"
|
||||
(wrap-net-info listener))))
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
[status-im.utils.platform :as platform]))
|
||||
|
||||
(when-not platform/desktop?
|
||||
(def firebase (object/get rn/react-native-firebase "default")))
|
||||
(def firebase (object/get (rn/react-native-firebase) "default")))
|
||||
|
||||
(defn message-handler-fn []
|
||||
;; message-js is firebase.messaging.RemoteMessage: https://github.com/invertase/react-native-firebase-docs/blob/master/docs/messaging/reference/RemoteMessage.md
|
||||
|
|
|
@ -22,13 +22,13 @@
|
|||
|
||||
(when-not platform/desktop?
|
||||
|
||||
(def firebase (object/get rn/react-native-firebase "default")))
|
||||
(defn firebase [] (object/get (rn/react-native-firebase) "default")))
|
||||
|
||||
;; NOTE: Only need to explicitly request permissions on iOS.
|
||||
(defn request-permissions []
|
||||
(if platform/desktop?
|
||||
(re-frame/dispatch [:notifications.callback/request-notifications-permissions-granted {}])
|
||||
(-> (.requestPermission (.messaging firebase))
|
||||
(-> (.requestPermission (.messaging (firebase)))
|
||||
(.then
|
||||
(fn [_]
|
||||
(log/debug "notifications-granted")
|
||||
|
@ -52,7 +52,7 @@
|
|||
(= (.-length to) pn-pubkey-hash-length)))))
|
||||
|
||||
(defn sha3 [s]
|
||||
(.sha3 dependencies/Web3.prototype s))
|
||||
(.sha3 (dependencies/web3-prototype) s))
|
||||
|
||||
(defn anonymize-pubkey
|
||||
[pubkey]
|
||||
|
@ -163,12 +163,14 @@
|
|||
(when-let [msg-id (:id decoded-payload)]
|
||||
;; We must prefix the notification ID, otherwise it will
|
||||
;; cause a crash in iOS
|
||||
{:notificationId (str "hash:" msg-id)})))]
|
||||
{:notificationId (str "hash:" msg-id)})))
|
||||
firebase (firebase)]
|
||||
(firebase.notifications.Notification.
|
||||
native-notification (.notifications firebase))))
|
||||
|
||||
(defn display-notification [{:keys [title body] :as params}]
|
||||
(let [notification (build-notification params)]
|
||||
(let [notification (build-notification params)
|
||||
firebase (firebase)]
|
||||
(when platform/android?
|
||||
(.. notification
|
||||
(-android.setChannelId channel-id)
|
||||
|
@ -185,14 +187,15 @@
|
|||
(log/debug "Display Notification error" title body error))))))
|
||||
|
||||
(defn get-fcm-token []
|
||||
(-> (.getToken (.messaging firebase))
|
||||
(-> (.getToken (.messaging (firebase)))
|
||||
(.then (fn [x]
|
||||
(log/debug "get-fcm-token:" x)
|
||||
(re-frame/dispatch
|
||||
[:notifications.callback/get-fcm-token-success x])))))
|
||||
|
||||
(defn create-notification-channel []
|
||||
(let [channel (firebase.notifications.Android.Channel.
|
||||
(let [firebase (firebase)
|
||||
channel (firebase.notifications.Android.Channel.
|
||||
channel-id
|
||||
channel-name
|
||||
firebase.notifications.Android.Importance.High)]
|
||||
|
@ -272,7 +275,7 @@
|
|||
It is only needed to handle PNs from legacy clients
|
||||
(which use firebase.notifications API)"
|
||||
(log/debug "Handle initial push notifications")
|
||||
(.. firebase
|
||||
(.. (firebase)
|
||||
notifications
|
||||
getInitialNotification
|
||||
(then (fn [event]
|
||||
|
@ -282,7 +285,7 @@
|
|||
|
||||
(defn setup-token-refresh-callback []
|
||||
(.onTokenRefresh
|
||||
(.messaging firebase)
|
||||
(.messaging (firebase))
|
||||
(fn [x]
|
||||
(log/debug "onTokenRefresh:" x)
|
||||
(re-frame/dispatch [:notifications.callback/get-fcm-token-success x]))))
|
||||
|
@ -294,7 +297,7 @@
|
|||
"we can remove this method"
|
||||
(log/debug "calling onNotification")
|
||||
(.onNotification
|
||||
(.notifications firebase)
|
||||
(.notifications (firebase))
|
||||
(fn [message-js]
|
||||
(log/debug "handle-on-notification-callback called")
|
||||
(let [decoded-payload (decode-notification-payload message-js)]
|
||||
|
@ -306,7 +309,7 @@
|
|||
(defn setup-on-message-callback []
|
||||
(log/debug "calling onMessage")
|
||||
(.onMessage
|
||||
(.messaging firebase)
|
||||
(.messaging (firebase))
|
||||
(fn [message-js]
|
||||
(log/debug "handle-on-message-callback called")
|
||||
(let [decoded-payload (decode-notification-payload message-js)]
|
||||
|
@ -318,7 +321,7 @@
|
|||
|
||||
(defn setup-on-notification-opened-callback []
|
||||
(log/debug "setup-on-notification-opened-callback")
|
||||
(.. firebase
|
||||
(.. (firebase)
|
||||
notifications
|
||||
(onNotificationOpened handle-notification-open-event)))
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
(def ^:const privacy-policy-link "https://www.iubenda.com/privacy-policy/45710059")
|
||||
|
||||
(defn open-privacy-policy-link! []
|
||||
(.openURL react/linking privacy-policy-link))
|
||||
(.openURL (react/linking) privacy-policy-link))
|
||||
|
||||
(re-frame/reg-fx
|
||||
:privacy-policy/open-privacy-policy-link
|
||||
|
|
|
@ -1,19 +1,27 @@
|
|||
(ns status-im.react-native.resources)
|
||||
(ns status-im.react-native.resources
|
||||
(:require-macros [status-im.utils.js-require :as js-require]))
|
||||
|
||||
(def ui
|
||||
{:empty-hashtags (js/require "./resources/images/ui/empty-hashtags.png")
|
||||
:empty-recent (js/require "./resources/images/ui/empty-recent.png")
|
||||
:analytics-image (js/require "./resources/images/ui/analytics-image.png")
|
||||
:welcome-image (js/require "./resources/images/ui/welcome-image.png")
|
||||
:lock (js/require "./resources/images/ui/lock.png")
|
||||
:tribute-to-talk (js/require "./resources/images/ui/tribute-to-talk.png")
|
||||
:wallet-welcome (js/require "./resources/images/ui/wallet-welcome.png")
|
||||
:hardwallet-card (js/require "./resources/images/ui/hardwallet-card.png")
|
||||
:secret-keys (js/require "./resources/images/ui/secret-keys.png")
|
||||
:keycard-lock (js/require "./resources/images/ui/keycard-lock.png")
|
||||
:hold-card-animation (try (js/require "./resources/images/ui/hold-card-animation.gif")
|
||||
(catch :default e))
|
||||
:warning-sign (js/require "./resources/images/ui/warning-sign.png")
|
||||
:phone-nfc-on (js/require "./resources/images/ui/phone-nfc-on.png")
|
||||
:phone-nfc-off (js/require "./resources/images/ui/phone-nfc-off.png")
|
||||
:dapp-store (js/require "./resources/images/ui/dapp-store.png")})
|
||||
{:empty-hashtags (js-require/js-require "./resources/images/ui/empty-hashtags.png")
|
||||
:empty-recent (js-require/js-require "./resources/images/ui/empty-recent.png")
|
||||
:analytics-image (js-require/js-require "./resources/images/ui/analytics-image.png")
|
||||
:welcome-image (js-require/js-require "./resources/images/ui/welcome-image.png")
|
||||
:lock (js-require/js-require "./resources/images/ui/lock.png")
|
||||
:tribute-to-talk (js-require/js-require "./resources/images/ui/tribute-to-talk.png")
|
||||
:wallet-welcome (js-require/js-require "./resources/images/ui/wallet-welcome.png")
|
||||
:hardwallet-card (js-require/js-require "./resources/images/ui/hardwallet-card.png")
|
||||
:secret-keys (js-require/js-require "./resources/images/ui/secret-keys.png")
|
||||
:keycard-lock (js-require/js-require "./resources/images/ui/keycard-lock.png")
|
||||
:hold-card-animation (js-require/js-require "./resources/images/ui/hold-card-animation.gif")
|
||||
:warning-sign (js-require/js-require "./resources/images/ui/warning-sign.png")
|
||||
:phone-nfc-on (js-require/js-require "./resources/images/ui/phone-nfc-on.png")
|
||||
:phone-nfc-off (js-require/js-require "./resources/images/ui/phone-nfc-off.png")
|
||||
:dapp-store (js-require/js-require "./resources/images/ui/dapp-store.png")})
|
||||
|
||||
(def loaded-images (atom {}))
|
||||
|
||||
(defn get-image [k]
|
||||
(if (contains? @loaded-images k)
|
||||
(get @loaded-images k)
|
||||
(get (swap! loaded-images assoc k
|
||||
((get ui k))) k)))
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
topics (db :mailserver/topics)
|
||||
topic-hash (if (contains? topics partitioned-topic-hash)
|
||||
partitioned-topic-hash
|
||||
transport.topic/discovery-topic-hash)]
|
||||
(transport.topic/discovery-topic-hash))]
|
||||
{:shh/post [{:web3 web3
|
||||
:success-event success-event
|
||||
:message (merge {:sig (accounts.db/current-public-key cofx)
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
utils/get-topic))
|
||||
|
||||
(def discovery-topic constants/contact-discovery)
|
||||
(def discovery-topic-hash (utils/get-topic constants/contact-discovery))
|
||||
(defn discovery-topic-hash [] (utils/get-topic constants/contact-discovery))
|
||||
|
||||
(defn public-key->discovery-topic
|
||||
[public-key]
|
||||
|
@ -50,10 +50,10 @@
|
|||
[public-key]
|
||||
(if config/partitioned-topic-enabled?
|
||||
(partitioned-topic-hash public-key)
|
||||
discovery-topic-hash))
|
||||
(discovery-topic-hash)))
|
||||
|
||||
(defn discovery-topics [public-key]
|
||||
[(partitioned-topic-hash public-key) discovery-topic-hash])
|
||||
[(partitioned-topic-hash public-key) (discovery-topic-hash)])
|
||||
|
||||
(defn contains-topic?
|
||||
[available-topics topic]
|
||||
|
|
|
@ -4,18 +4,18 @@
|
|||
[status-im.js-dependencies :as dependencies]))
|
||||
|
||||
(defn from-utf8 [s]
|
||||
(.fromUtf8 dependencies/Web3.prototype s))
|
||||
(.fromUtf8 (dependencies/web3-prototype) s))
|
||||
|
||||
(defn to-ascii [s]
|
||||
(.toAscii dependencies/Web3.prototype s))
|
||||
(.toAscii (dependencies/web3-prototype) s))
|
||||
|
||||
(defn to-utf8 [s]
|
||||
(try
|
||||
(.toUtf8 dependencies/Web3.prototype (str s))
|
||||
(.toUtf8 (dependencies/web3-prototype) (str s))
|
||||
(catch :default err nil)))
|
||||
|
||||
(defn sha3 [s]
|
||||
(.sha3 dependencies/Web3.prototype s))
|
||||
(.sha3 (dependencies/web3-prototype) s))
|
||||
|
||||
(defn old-message-id
|
||||
[message]
|
||||
|
|
|
@ -2,17 +2,17 @@
|
|||
(:require [status-im.ethereum.core :as ethereum]
|
||||
[status-im.js-dependencies :as dependencies]))
|
||||
|
||||
(def utils dependencies/web3-utils)
|
||||
(defn utils [] (dependencies/web3-utils))
|
||||
|
||||
(defn to-wei
|
||||
[s]
|
||||
(when s
|
||||
(.toWei utils s)))
|
||||
(.toWei (utils) s)))
|
||||
|
||||
(defn from-wei
|
||||
[s]
|
||||
(when s
|
||||
(.fromWei utils s)))
|
||||
(.fromWei (utils) s)))
|
||||
|
||||
(defn get-settings
|
||||
[db]
|
||||
|
|
|
@ -6,31 +6,31 @@
|
|||
([anim callback] (.start anim callback)))
|
||||
|
||||
(defn anim-loop [animation]
|
||||
(.loop react/animated animation))
|
||||
(.loop (react/animated) animation))
|
||||
|
||||
(defn interpolate [anim-value config]
|
||||
(.interpolate anim-value (clj->js config)))
|
||||
|
||||
(defn timing [anim-value config]
|
||||
(.timing react/animated anim-value (clj->js config)))
|
||||
(.timing (react/animated) anim-value (clj->js config)))
|
||||
|
||||
(defn spring [anim-value config]
|
||||
(.spring react/animated anim-value (clj->js config)))
|
||||
(.spring (react/animated) anim-value (clj->js config)))
|
||||
|
||||
(defn decay [anim-value config]
|
||||
(.decay react/animated anim-value (clj->js config)))
|
||||
(.decay (react/animated) anim-value (clj->js config)))
|
||||
|
||||
(defn anim-sequence [animations]
|
||||
(.sequence react/animated (clj->js animations)))
|
||||
(.sequence (react/animated) (clj->js animations)))
|
||||
|
||||
(defn parallel [animations]
|
||||
(.parallel react/animated (clj->js animations)))
|
||||
(.parallel (react/animated) (clj->js animations)))
|
||||
|
||||
(defn anim-delay [duration]
|
||||
(.delay react/animated duration))
|
||||
(.delay (react/animated) duration))
|
||||
|
||||
(defn event [config]
|
||||
(.event react/animated (clj->js [nil, config])))
|
||||
(.event (react/animated) (clj->js [nil, config])))
|
||||
|
||||
(defn add-listener [anim-value listener]
|
||||
(.addListener anim-value listener))
|
||||
|
|
|
@ -107,7 +107,7 @@
|
|||
(when platform/iphone-x?
|
||||
[react/view
|
||||
{:style tabs.styles/ios-titles-cover}])]
|
||||
[react/safe-area-view {:flex 1}]])
|
||||
[(react/safe-area-view) {:flex 1}]])
|
||||
|
||||
(defn tabs-animation-wrapper-android
|
||||
[keyboard-shown? view-id content]
|
||||
|
@ -134,13 +134,13 @@
|
|||
:enter-pin-settings} view-id)
|
||||
(if platform/ios?
|
||||
[tabs-animation-wrapper-ios
|
||||
[react/animated-view
|
||||
[(react/animated-view)
|
||||
{:style (tabs.styles/animated-container visible? keyboard-shown?)}
|
||||
[tabs tab]]]
|
||||
[tabs-animation-wrapper-android
|
||||
keyboard-shown?
|
||||
view-id
|
||||
[react/animated-view
|
||||
[(react/animated-view)
|
||||
{:style (tabs.styles/animated-container visible? keyboard-shown?)}
|
||||
[tabs tab]]])))}))
|
||||
|
||||
|
@ -156,12 +156,12 @@
|
|||
(when platform/android?
|
||||
(reset!
|
||||
listeners
|
||||
[(.addListener react/keyboard "keyboardDidShow"
|
||||
[(.addListener (react/keyboard) "keyboardDidShow"
|
||||
(fn []
|
||||
(reset! keyboard-shown? true)
|
||||
(animate visible?
|
||||
disappearance-duration 0)))
|
||||
(.addListener react/keyboard "keyboardDidHide"
|
||||
(.addListener (react/keyboard) "keyboardDidHide"
|
||||
(fn []
|
||||
(reset! keyboard-shown? false)
|
||||
(animate visible? appearance-duration
|
||||
|
|
|
@ -80,7 +80,7 @@
|
|||
|
||||
(defn swipe-pan-responder [opts]
|
||||
(.create
|
||||
react/pan-responder
|
||||
(react/pan-responder)
|
||||
(clj->js
|
||||
{:onMoveShouldSetPanResponder (fn [_ state]
|
||||
(or (< 10 (js/Math.abs (.-dx state)))
|
||||
|
@ -110,8 +110,8 @@
|
|||
{:on-press #(cancel opts on-cancel)
|
||||
:style styles/container}
|
||||
|
||||
[react/animated-view (styles/shadow opacity-value)]]
|
||||
[react/animated-view
|
||||
[(react/animated-view) (styles/shadow opacity-value)]]
|
||||
[(react/animated-view)
|
||||
{:style (styles/content-container height bottom-value)}
|
||||
[react/view styles/content-header
|
||||
[react/view styles/handle]]
|
||||
|
|
|
@ -4,10 +4,10 @@
|
|||
[clojure.walk :as walk]
|
||||
[status-im.react-native.js-dependencies :as js-dependecies]))
|
||||
|
||||
(def default-camera (.-default js-dependecies/camera))
|
||||
(defn default-camera [] (.-default (js-dependecies/camera)))
|
||||
|
||||
(defn constants [t]
|
||||
(-> default-camera
|
||||
(-> (default-camera)
|
||||
(object/get "constants")
|
||||
(object/get t)
|
||||
(js->clj)
|
||||
|
@ -18,15 +18,15 @@
|
|||
(def torch-modes (constants "TorchMode"))
|
||||
|
||||
(defn set-torch [state]
|
||||
(set! (.-torchMode default-camera) (get torch-modes state)))
|
||||
(set! (.-torchMode (default-camera)) (get torch-modes state)))
|
||||
|
||||
(defn request-access-ios [then else]
|
||||
(-> (.checkVideoAuthorizationStatus default-camera)
|
||||
(-> (.checkVideoAuthorizationStatus (default-camera))
|
||||
(.then (fn [allowed?] (if allowed? (then) (else))))
|
||||
(.catch else)))
|
||||
|
||||
(defn camera [props]
|
||||
(reagent/create-element default-camera (clj->js (merge {:inverted true} props))))
|
||||
(reagent/create-element (default-camera) (clj->js (merge {:inverted true} props))))
|
||||
|
||||
(defn get-qr-code-data [code]
|
||||
(.-data code))
|
||||
|
|
|
@ -53,13 +53,13 @@
|
|||
:top -3
|
||||
:height 3
|
||||
:background-color colors/white}}
|
||||
[react/animated-view {:style (animated-bar-style blue-bar-left-margin
|
||||
parent-width
|
||||
colors/blue)}]
|
||||
[react/animated-view {:style (assoc (animated-bar-style white-bar-left-margin
|
||||
parent-width
|
||||
colors/white)
|
||||
:left (* 0.15 parent-width))}]]))
|
||||
[(react/animated-view) {:style (animated-bar-style blue-bar-left-margin
|
||||
parent-width
|
||||
colors/blue)}]
|
||||
[(react/animated-view) {:style (assoc (animated-bar-style white-bar-left-margin
|
||||
parent-width
|
||||
colors/white)
|
||||
:left (* 0.15 parent-width))}]]))
|
||||
|
||||
(defonce show-connected? (reagent/atom true))
|
||||
|
||||
|
@ -108,15 +108,15 @@
|
|||
connected? connecting? loading-indicator?] :as opts}]
|
||||
(when (or (not connected?)
|
||||
@show-connected?)
|
||||
[react/animated-view {:style (styles/text-wrapper
|
||||
(assoc opts
|
||||
:height anim-height
|
||||
:background-color (if connected?
|
||||
colors/green
|
||||
colors/gray)
|
||||
:opacity anim-opacity
|
||||
:modal? (= view-id :chat-modal)))
|
||||
:accessibility-label :connection-status-text}
|
||||
[(react/animated-view) {:style (styles/text-wrapper
|
||||
(assoc opts
|
||||
:height anim-height
|
||||
:background-color (if connected?
|
||||
colors/green
|
||||
colors/gray)
|
||||
:opacity anim-opacity
|
||||
:modal? (= view-id :chat-modal)))
|
||||
:accessibility-label :connection-status-text}
|
||||
(when connecting?
|
||||
[react/activity-indicator {:animated true
|
||||
:color colors/white
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
(ns status-im.ui.components.dialog
|
||||
(:require [status-im.react-native.js-dependencies :as rn-dependencies]))
|
||||
|
||||
(def dialogs (.-default rn-dependencies/dialogs))
|
||||
(defn dialogs [] (.-default (rn-dependencies/dialogs)))
|
||||
|
||||
(defn show [{:keys [title options cancel-text on-cancel]}]
|
||||
(.. dialogs
|
||||
(.. (dialogs)
|
||||
(showPicker title nil (clj->js {:items (mapv #(select-keys % [:label])
|
||||
options)
|
||||
:negativeText cancel-text
|
||||
|
@ -20,4 +20,4 @@
|
|||
(filter #(= label (:label %)))
|
||||
first
|
||||
:action)]
|
||||
(action)))))))))
|
||||
(action)))))))))
|
||||
|
|
|
@ -258,8 +258,8 @@
|
|||
[name {:keys [color container-style accessibility-label width height]
|
||||
:or {accessibility-label :icon}}]
|
||||
^{:key name}
|
||||
[react/animated-view {:style container-style
|
||||
:accessibility-label accessibility-label}
|
||||
[(react/animated-view) {:style container-style
|
||||
:accessibility-label accessibility-label}
|
||||
(if-let [icon-fn (get icons name)]
|
||||
(let [icon-vec (icon-fn (match-color color))]
|
||||
(if width
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
(defn item-image
|
||||
[{:keys [source style image-style]}]
|
||||
[react/view {:style style}
|
||||
[react/image {:source source
|
||||
[react/image {:source (if (fn? source) (source) source)
|
||||
:style (merge styles/item-image image-style)}]])
|
||||
|
||||
(defn item-primary
|
||||
|
@ -220,7 +220,7 @@
|
|||
[{:keys [data] :as props}]
|
||||
{:pre [(or (nil? data)
|
||||
(sequential? data))]}
|
||||
[flat-list-class
|
||||
[(flat-list-class)
|
||||
(merge (base-list-props props)
|
||||
props
|
||||
{:data (wrap-data data)})])
|
||||
|
@ -251,7 +251,7 @@
|
|||
See https://facebook.github.io/react-native/docs/sectionlist.html"
|
||||
[{:keys [sections render-section-header-fn render-section-footer-fn] :as props
|
||||
:or {render-section-header-fn default-render-section-header}}]
|
||||
[section-list-class
|
||||
[(section-list-class)
|
||||
(merge (base-list-props props)
|
||||
props
|
||||
(when render-section-footer-fn
|
||||
|
@ -310,7 +310,7 @@
|
|||
swipe-pan-responder (responder/swipe-pan-responder offset-x styles/delete-button-width id swiped?)
|
||||
swipe-pan-handler (responder/pan-handlers swipe-pan-responder)]
|
||||
[react/view swipe-pan-handler
|
||||
[react/animated-view {:style {:flex 1 :right offset-x}}
|
||||
[(react/animated-view) {:style {:flex 1 :right offset-x}}
|
||||
body
|
||||
[react/touchable-highlight {:style styles/delete-icon-highlight
|
||||
:on-press on-delete}
|
||||
|
|
|
@ -41,13 +41,13 @@
|
|||
:options [{:label (i18n/label :t/browsing-open-in-status)
|
||||
:action #(re-frame/dispatch [:browser.ui/open-in-status-option-selected link])}
|
||||
{:label (i18n/label (platform-web-browser))
|
||||
:action #(.openURL react/linking (http/normalize-url link))}]
|
||||
:action #(.openURL (react/linking) (http/normalize-url link))}]
|
||||
:cancel-text (i18n/label :t/browsing-cancel)}))
|
||||
|
||||
(defn browse-in-web-browser [link]
|
||||
(show {:title (i18n/label :t/browsing-title)
|
||||
:options [{:label (i18n/label (platform-web-browser))
|
||||
:action #(.openURL react/linking (http/normalize-url link))}]
|
||||
:action #(.openURL (react/linking) (http/normalize-url link))}]
|
||||
:cancel-text (i18n/label :t/browsing-cancel)}))
|
||||
|
||||
(defn browse-dapp [link]
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
[status-im.ui.components.camera :as camera]
|
||||
[status-im.react-native.js-dependencies :as js-dependencies]))
|
||||
|
||||
(def permissions-class (.-PermissionsAndroid js-dependencies/react-native))
|
||||
(defn permissions-class [] (.-PermissionsAndroid js-dependencies/react-native))
|
||||
|
||||
(def permissions-map
|
||||
{:read-external-storage "android.permission.READ_EXTERNAL_STORAGE"
|
||||
|
@ -22,7 +22,7 @@
|
|||
:as options}]
|
||||
(if platform/android?
|
||||
(let [permissions (mapv #(get permissions-map %) permissions)]
|
||||
(-> (.requestMultiple permissions-class (clj->js permissions))
|
||||
(-> (.requestMultiple (permissions-class) (clj->js permissions))
|
||||
(.then #(if (all-granted? (js->clj %))
|
||||
(on-allowed)
|
||||
(on-denied)))
|
||||
|
|
|
@ -8,16 +8,16 @@
|
|||
|
||||
(defn qr-code [props]
|
||||
(reagent/create-element
|
||||
rn-dependencies/qr-code
|
||||
(rn-dependencies/qr-code)
|
||||
(clj->js (merge {:inverted true} props))))
|
||||
|
||||
(defview qr-code-viewer-component [{:keys [style hint-style footer-style footer-button value hint legend]}]
|
||||
(letsubs [{:keys [width]} [:dimensions/window]
|
||||
{:keys [disabled?]} [:tribute-to-talk/ui]]
|
||||
[react/scroll-view {:content-container-style {:align-items :center
|
||||
:margin-top 16
|
||||
:justify-content :center}
|
||||
:style (merge {:flex 1} style)}
|
||||
[(react/scroll-view) {:content-container-style {:align-items :center
|
||||
:margin-top 16
|
||||
:justify-content :center}
|
||||
:style (merge {:flex 1} style)}
|
||||
(when-not disabled?
|
||||
[react/view {:style {:margin-horizontal 16}}
|
||||
[tr-to-talk/enabled-note]])
|
||||
|
|
|
@ -43,7 +43,7 @@
|
|||
(fn []
|
||||
[react/view {:style style
|
||||
:on-layout #(reset! width (-> % .-nativeEvent .-layout .-width))}
|
||||
[react/web-view
|
||||
[(react/web-view)
|
||||
{:java-script-enabled false
|
||||
:third-party-cookies-enabled false
|
||||
:scroll-enabled false
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
opacity-value (animation/create-value 0)]
|
||||
{:component-did-mount (animations/animate-tooltip bottom-value bottom-anim-value opacity-value 10)}
|
||||
[react/view (merge styles/tooltip-container container-style)
|
||||
[react/animated-view {:style (styles/tooltip-animated bottom-anim-value opacity-value)}
|
||||
[(react/animated-view) {:style (styles/tooltip-animated bottom-anim-value opacity-value)}
|
||||
[react/view (styles/tooltip-text-container color)
|
||||
[react/text {:style (styles/tooltip-text font-size)} label]]
|
||||
[vector-icons/icon :icons/tooltip-triangle {:color color :style styles/tooltip-triangle}]]]))
|
||||
|
@ -24,7 +24,7 @@
|
|||
opacity-value (animation/create-value 0)]
|
||||
{:component-did-mount (animations/animate-tooltip -150 bottom-anim-value opacity-value -10)}
|
||||
[react/view styles/bottom-tooltip-container
|
||||
[react/animated-view {:style (styles/tooltip-animated bottom-anim-value opacity-value)}
|
||||
[(react/animated-view) {:style (styles/tooltip-animated bottom-anim-value opacity-value)}
|
||||
[vector-icons/icon :icons/tooltip-triangle {:color colors/gray
|
||||
:style styles/tooltip-triangle
|
||||
:container-style {:transform [{:rotate "180deg"}]}}]
|
||||
|
|
|
@ -6,9 +6,11 @@
|
|||
[status-im.utils.config :as config]))
|
||||
|
||||
(def webview-bridge-class
|
||||
(reagent/adapt-react-class (.-default js-dependencies/webview-bridge)))
|
||||
(memoize
|
||||
(fn []
|
||||
(reagent/adapt-react-class (.-default (js-dependencies/webview-bridge))))))
|
||||
|
||||
(def module (.-WebViewBridgeModule (.-NativeModules js-dependencies/react-native)))
|
||||
(defn module [] (.-WebViewBridgeModule (.-NativeModules js-dependencies/react-native)))
|
||||
|
||||
(defn webview-bridge [{:keys [dapp? dapp-name] :as opts}]
|
||||
(if (and config/cached-webviews-enabled? platform/android? dapp?)
|
||||
|
@ -19,10 +21,10 @@
|
|||
;; unfortunately it's impossible to pass some initial params
|
||||
;; to view, that's why we have to pass dapp-name to the module
|
||||
;; before showing webview
|
||||
(.setCurrentDapp module dapp-name
|
||||
(.setCurrentDapp (module) dapp-name
|
||||
(fn [] (reset! dapp-name-sent? true))))
|
||||
:reagent-render
|
||||
(fn [opts]
|
||||
(when @dapp-name-sent?
|
||||
[webview-bridge-class opts]))}))
|
||||
[webview-bridge-class opts]))
|
||||
[(webview-bridge-class) opts]))}))
|
||||
[(webview-bridge-class) opts]))
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
[react/view {:flex 1}
|
||||
[status-bar/status-bar]
|
||||
[toolbar/simple-toolbar (i18n/label :t/about-app)]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view
|
||||
[profile.components/settings-item-separator]
|
||||
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
[react/text {:style styles/account-creating-text}
|
||||
(i18n/label :t/creating-your-account)]]])
|
||||
(when (#{:enter-password :confirm-password :enter-name} step)
|
||||
[react/scroll-view {:flex 1}
|
||||
[(react/scroll-view) {:flex 1}
|
||||
[react/view {:style styles/logo-container}
|
||||
[components.common/logo styles/logo]]
|
||||
^{:key (str "step" step)}
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
[react/keyboard-avoiding-view {:style ast/accounts-view}
|
||||
[status-bar/status-bar]
|
||||
[login-toolbar can-navigate-back?]
|
||||
[react/scroll-view styles/login-view
|
||||
[(react/scroll-view) styles/login-view
|
||||
[react/view styles/login-badge-container
|
||||
[account-login-badge photo-path name]
|
||||
[react/view {:style styles/password-container
|
||||
|
|
|
@ -45,7 +45,7 @@
|
|||
[status-bar/status-bar]
|
||||
[react/keyboard-avoiding-view components.styles/flex
|
||||
[toolbar/simple-toolbar (i18n/label (if id :t/bootnode-details :t/add-bootnode))]
|
||||
[react/scroll-view {:keyboard-should-persist-taps :handled}
|
||||
[(react/scroll-view) {:keyboard-should-persist-taps :handled}
|
||||
[react/view styles/edit-bootnode-view
|
||||
[text-input/text-input-with-label
|
||||
{:label (i18n/label :t/name)
|
||||
|
|
|
@ -31,7 +31,7 @@
|
|||
:image [react/view styles/browser-icon-container
|
||||
[vector-icons/icon :main-icons/browser {:color colors/gray}]]}]])
|
||||
|
||||
(def dapp-image-data {:image (:dapp-store resources/ui) :width 768 :height 333})
|
||||
(def dapp-image-data {:image (resources/get-image :dapp-store) :width 768 :height 333})
|
||||
(def dapp-image (components.common/image-contain nil dapp-image-data))
|
||||
|
||||
(def privacy-otions-visible? (reagent/atom true))
|
||||
|
@ -95,7 +95,7 @@
|
|||
[components/separator]
|
||||
(if (empty? browsers)
|
||||
[list-header true]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[list-header false]
|
||||
[list/flat-list {:data browsers
|
||||
:footer [react/view
|
||||
|
@ -103,4 +103,4 @@
|
|||
:align-self :stretch}}]
|
||||
:key-fn :browser-id
|
||||
:end-fill-color colors/white
|
||||
:render-fn list-item}]])]))
|
||||
:render-fn list-item}]])]))
|
||||
|
|
|
@ -74,8 +74,8 @@
|
|||
(when @current-permission
|
||||
(let [{:keys [title description icon]} @current-permission]
|
||||
[react/view styles/permissions-panel-container
|
||||
[react/animated-view {:style (styles/permissions-panel-background alpha-value)}]
|
||||
[react/animated-view {:style (styles/permissions-panel bottom-anim-value)}
|
||||
[(react/animated-view) {:style (styles/permissions-panel-background alpha-value)}]
|
||||
[(react/animated-view) {:style (styles/permissions-panel bottom-anim-value)}
|
||||
[react/view styles/permissions-panel-icons-container
|
||||
(if dapp?
|
||||
[chat-icon.screen/dapp-icon-permission dapp 48]
|
||||
|
|
|
@ -9,16 +9,16 @@
|
|||
(:require-macros [status-im.utils.views :as views]))
|
||||
|
||||
(views/defview view [{:keys [can-go-back?]}]
|
||||
[react/scroll-view {:keyboard-should-persist-taps :always
|
||||
:bounces false
|
||||
:content-container-style styles/container}
|
||||
[(react/scroll-view) {:keyboard-should-persist-taps :always
|
||||
:bounces false
|
||||
:content-container-style styles/container}
|
||||
[react/view styles/container-root-view
|
||||
[vector-icons/icon :main-icons/info {:color colors/red}]
|
||||
[react/text {:style styles/title-text}
|
||||
(i18n/label :t/browsing-site-blocked-title)]
|
||||
[react/nested-text {:style styles/description-text}
|
||||
(i18n/label :t/browsing-site-blocked-description1)
|
||||
[{:on-press #(.openURL react/linking "status-im://chat/public/status")
|
||||
[{:on-press #(.openURL (react/linking) "status-im://chat/public/status")
|
||||
:style styles/chat-link-text}
|
||||
"#status"]
|
||||
(i18n/label :t/browsing-site-blocked-description2)]
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
:display-name "container"
|
||||
:reagent-render
|
||||
(fn [height & children]
|
||||
[react/animated-view {:style (styles/bottom-info-container height)}
|
||||
[(react/animated-view) {:style (styles/bottom-info-container height)}
|
||||
(into [react/view] children)])})))
|
||||
|
||||
(defn- message-status-row [{:keys [photo-path name]} {:keys [public-key status]}]
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
bottom (+ input-height chat-input-margin)
|
||||
max-height (- chat-layout-height (when platform/ios? keyboard-height) input-height top-offset)]
|
||||
[react/view style/overlap-container
|
||||
[react/animated-view {:style (style/expandable-container anim-value bottom max-height)}
|
||||
(into [react/scroll-view {:keyboard-should-persist-taps :always
|
||||
:on-content-size-change #(expandable-view-on-update anim-value %2)
|
||||
:bounces false}]
|
||||
[(react/animated-view) {:style (style/expandable-container anim-value bottom max-height)}
|
||||
(into [(react/scroll-view) {:keyboard-should-persist-taps :always
|
||||
:on-content-size-change #(expandable-view-on-update anim-value %2)
|
||||
:bounces false}]
|
||||
(when (or input-focused? (not messages-focused?))
|
||||
elements))]])))
|
||||
|
|
|
@ -113,7 +113,7 @@
|
|||
on-update (input-helper-view-on-update {:opacity-value opacity-value
|
||||
:placeholder placeholder})]
|
||||
{:component-did-update on-update}
|
||||
[react/animated-view {:style (style/input-helper-view width opacity-value)}
|
||||
[(react/animated-view) {:style (style/input-helper-view width opacity-value)}
|
||||
[react/text {:style (style/input-helper-text width)}
|
||||
placeholder]]))
|
||||
|
||||
|
@ -131,7 +131,7 @@
|
|||
set-container-width-fn #(reagent/set-state component {:container-width %})
|
||||
{:keys [width]} (reagent/state component)]
|
||||
[react/view {:style style/input-root}
|
||||
[react/animated-view {:style style/input-animated}
|
||||
[(react/animated-view) {:style style/input-animated}
|
||||
[invisible-input {:set-layout-width-fn set-layout-width-fn}]
|
||||
(if platform/desktop?
|
||||
[basic-text-input-desktop {:set-container-width-fn set-container-width-fn
|
||||
|
@ -156,7 +156,7 @@
|
|||
(defview reply-message [from message-text]
|
||||
(letsubs [username [:contacts/contact-name-by-identity from]
|
||||
current-public-key [:account/public-key]]
|
||||
[react/scroll-view {:style style/reply-message-content}
|
||||
[(react/scroll-view) {:style style/reply-message-content}
|
||||
(chat-utils/format-reply-author from username current-public-key style/reply-message-author)
|
||||
[react/text {:style (message-style/style-message-text false)} message-text]]))
|
||||
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
(letsubs [available-commands [:chats/available-commands]]
|
||||
[expandable/expandable-view {:key :suggestions}
|
||||
[react/view
|
||||
[react/scroll-view {:keyboard-should-persist-taps :always
|
||||
:bounces false}
|
||||
[(react/scroll-view) {:keyboard-should-persist-taps :always
|
||||
:bounces false}
|
||||
(when (seq available-commands)
|
||||
(map-indexed
|
||||
(fn [i {:keys [type] :as command}]
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
{:on-press (fn [_]
|
||||
(re-frame/dispatch
|
||||
[:chat.ui/set-chat-ui-props {:messages-focused? true
|
||||
:show-stickers? false}])
|
||||
:show-stickers? false}])
|
||||
(react/dismiss-keyboard!))}
|
||||
[react/view style/datemark-mobile
|
||||
[react/text {:style style/datemark-text}
|
||||
|
|
|
@ -280,7 +280,7 @@
|
|||
(when (= content-type constants/content-type-sticker)
|
||||
(re-frame/dispatch [:stickers/open-sticker-pack (:pack content)]))
|
||||
(re-frame/dispatch [:chat.ui/set-chat-ui-props {:messages-focused? true
|
||||
:show-stickers? false}])
|
||||
:show-stickers? false}])
|
||||
(when-not platform/desktop?
|
||||
(react/dismiss-keyboard!)))))
|
||||
:on-long-press #(when (or (= content-type constants/content-type-text) (= content-type constants/content-type-emoji))
|
||||
|
|
|
@ -30,16 +30,16 @@
|
|||
[react/view {:style {:flex 1 :align-items :center :justify-content :center}}
|
||||
[vector-icons/icon :stickers-icons/stickers-big {:color colors/gray}]
|
||||
[react/text {:style {:margin-top 8 :font-size 17}} (i18n/label :t/you-dont-have-stickers)]
|
||||
[react/touchable-opacity {:on-press #(do
|
||||
(re-frame/dispatch [:stickers/load-packs])
|
||||
(re-frame/dispatch [:navigate-to :stickers]))}
|
||||
[(react/touchable-opacity) {:on-press #(do
|
||||
(re-frame/dispatch [:stickers/load-packs])
|
||||
(re-frame/dispatch [:navigate-to :stickers]))}
|
||||
[react/view {:margin-top 6 :height 44 :justify-content :center}
|
||||
[react/text {:style {:color colors/blue}}
|
||||
(i18n/label :t/get-stickers)]]]])
|
||||
|
||||
(defn- stickers-panel [stickers window-width]
|
||||
[react/view {:width window-width :flex 1}
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view {:style styles/stickers-panel}
|
||||
(for [{:keys [uri] :as sticker} stickers]
|
||||
^{:key uri}
|
||||
|
@ -80,12 +80,12 @@
|
|||
{:component-will-update (fn [_ [_ installed-packs selected-pack]]
|
||||
(update-scroll-position @ref installed-packs selected-pack window-width))
|
||||
:component-did-mount #(update-scroll-position @ref installed-packs selected-pack window-width)}
|
||||
[react/scroll-view {:style {:flex 1} :horizontal true :paging-enabled true
|
||||
:ref #(reset! ref %)
|
||||
:shows-horizontal-scroll-indicator false
|
||||
:on-momentum-scroll-end #(on-scroll % installed-packs window-width)
|
||||
:scrollEventThrottle 8
|
||||
:on-scroll #(reset! scroll-x (.-nativeEvent.contentOffset.x %))}
|
||||
[(react/scroll-view) {:style {:flex 1} :horizontal true :paging-enabled true
|
||||
:ref #(reset! ref %)
|
||||
:shows-horizontal-scroll-indicator false
|
||||
:on-momentum-scroll-end #(on-scroll % installed-packs window-width)
|
||||
:scrollEventThrottle 8
|
||||
:on-scroll #(reset! scroll-x (.-nativeEvent.contentOffset.x %))}
|
||||
^{:key "recent"}
|
||||
[recent-stickers-panel window-width]
|
||||
(for [{:keys [stickers id]} installed-packs]
|
||||
|
@ -129,8 +129,8 @@
|
|||
(do
|
||||
(anim/set-value bottom-anim-value (styles/stickers-panel-height))
|
||||
(anim/set-value alpha-value 1)))}
|
||||
[react/animated-view {:style {:background-color :white :height (if input-focused? 0 bottom-anim-value)
|
||||
:opacity alpha-value}}
|
||||
[(react/animated-view) {:style {:background-color :white :height (if input-focused? 0 bottom-anim-value)
|
||||
:opacity alpha-value}}
|
||||
(cond
|
||||
(= selected-pack :recent) [stickers-paging-panel installed-packs selected-pack]
|
||||
(not (seq installed-packs)) [no-stickers-yet-panel]
|
||||
|
@ -142,7 +142,7 @@
|
|||
:selected? false :background-color colors/blue}
|
||||
[vector-icons/icon :main-icons/add {:width 20 :height 20 :color colors/white}]]
|
||||
[react/view {:width 2}]
|
||||
[react/scroll-view {:horizontal true :style {:padding-left 2}}
|
||||
[(react/scroll-view) {:horizontal true :style {:padding-left 2}}
|
||||
[react/view
|
||||
[react/view {:style {:flex-direction :row}}
|
||||
[pack-icon {:id :recent :background-color colors/white}
|
||||
|
|
|
@ -38,7 +38,7 @@
|
|||
{:style {:color (if outgoing colors/white colors/blue)
|
||||
:text-decoration-line :underline}
|
||||
:on-press (if platform/desktop?
|
||||
#(.openURL react/linking (http/normalize-url text))
|
||||
#(.openURL (react/linking) (http/normalize-url text))
|
||||
#(re-frame/dispatch [:browser.ui/message-link-pressed text]))})
|
||||
:tag (fn [text {:keys [outgoing]}]
|
||||
{:style {:color (if outgoing colors/white colors/blue)
|
||||
|
|
|
@ -108,7 +108,7 @@
|
|||
(react/dismiss-keyboard!)))}
|
||||
(if platform/desktop?
|
||||
message-view
|
||||
[react/animated-view {:style (style/message-view-animated opacity)}
|
||||
[(react/animated-view) {:style (style/message-view-animated opacity)}
|
||||
message-view])]]))
|
||||
|
||||
(defn join-chat-button [chat-id]
|
||||
|
@ -371,10 +371,10 @@
|
|||
(when (= chat-id current-chat-id)
|
||||
;; this scroll-view is a hack that allows us to use on-blur and on-focus on Android
|
||||
;; more details here: https://github.com/facebook/react-native/issues/11071
|
||||
[react/scroll-view {:scroll-enabled false
|
||||
:style style/scroll-root
|
||||
:content-container-style style/scroll-root
|
||||
:keyboard-should-persist-taps :handled}
|
||||
[(react/scroll-view) {:scroll-enabled false
|
||||
:style style/scroll-root
|
||||
:content-container-style style/scroll-root
|
||||
:keyboard-should-persist-taps :handled}
|
||||
^{:key current-chat-id}
|
||||
[react/view {:style style/chat-view
|
||||
:on-layout (fn [e]
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
[toolbar.view/toolbar nil
|
||||
toolbar.view/default-nav-back
|
||||
(toolbar.view/content-title (i18n/label :t/contacts))]
|
||||
[react/scroll-view {:flex 1}
|
||||
[(react/scroll-view) {:flex 1}
|
||||
[list.views/big-list-item
|
||||
{:style {:margin-vertical 16}
|
||||
:text (i18n/label :t/blocked-users)
|
||||
|
@ -43,8 +43,8 @@
|
|||
:background-color colors/white}
|
||||
[status-bar/status-bar]
|
||||
[toolbar.view/simple-toolbar (i18n/label :t/blocked-users)]
|
||||
[react/scroll-view {:style {:background-color colors/white
|
||||
:padding-vertical 8}}
|
||||
[(react/scroll-view) {:style {:background-color colors/white
|
||||
:padding-vertical 8}}
|
||||
[list.views/flat-list
|
||||
{:data blocked-contacts
|
||||
:key-fn :address
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
{:style (styles/add-contact-button-text disable?)}
|
||||
(i18n/label :start-chat)]]]])
|
||||
(when (seq contacts) [react/text {:style styles/new-contact-subtitle} (i18n/label :or-choose-a-contact)])
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view {:style styles/suggested-contacts}
|
||||
(doall
|
||||
(for [c contacts]
|
||||
|
@ -120,7 +120,7 @@
|
|||
(i18n/label :new-public-group-chat)]]]])
|
||||
[topic-input-placeholder]
|
||||
[react/text {:style styles/new-contact-subtitle} (i18n/label :selected-for-you)]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view {:style styles/suggested-contacts}
|
||||
(doall
|
||||
(for [topic public-chat/default-public-chats]
|
||||
|
|
|
@ -242,19 +242,19 @@
|
|||
(reset! messages-to-load load-step)
|
||||
(reset! chat-id* chat-id)))]
|
||||
[react/view {:style styles/messages-view}
|
||||
[react/scroll-view {:scrollEventThrottle 16
|
||||
:headerHeight styles/messages-list-vertical-padding
|
||||
:footerWidth styles/messages-list-vertical-padding
|
||||
:enableArrayScrollingOptimization true
|
||||
:inverted true
|
||||
:on-scroll (fn [e]
|
||||
(let [ne (.-nativeEvent e)
|
||||
y (.-y (.-contentOffset ne))]
|
||||
(when (<= y 0)
|
||||
(when @scroll-timer (js/clearTimeout @scroll-timer))
|
||||
(reset! scroll-timer (js/setTimeout #(re-frame/dispatch [:chat.ui/load-more-messages]) 300)))
|
||||
(reset! scroll-height (+ y (.-height (.-layoutMeasurement ne))))))
|
||||
:ref #(reset! scroll-ref %)}
|
||||
[(react/scroll-view) {:scrollEventThrottle 16
|
||||
:headerHeight styles/messages-list-vertical-padding
|
||||
:footerWidth styles/messages-list-vertical-padding
|
||||
:enableArrayScrollingOptimization true
|
||||
:inverted true
|
||||
:on-scroll (fn [e]
|
||||
(let [ne (.-nativeEvent e)
|
||||
y (.-y (.-contentOffset ne))]
|
||||
(when (<= y 0)
|
||||
(when @scroll-timer (js/clearTimeout @scroll-timer))
|
||||
(reset! scroll-timer (js/setTimeout #(re-frame/dispatch [:chat.ui/load-more-messages]) 300)))
|
||||
(reset! scroll-height (+ y (.-height (.-layoutMeasurement ne))))))
|
||||
:ref #(reset! scroll-ref %)}
|
||||
[react/view
|
||||
(doall
|
||||
(for [{:keys [from content] :as message-obj} (take @messages-to-load messages)]
|
||||
|
|
|
@ -161,7 +161,7 @@
|
|||
(if logging-in?
|
||||
[components/activity-indicator {:animating true :color :white}]
|
||||
[icons/icon :main-icons/add {:style {:tint-color :white}}])]]]]
|
||||
[react/scroll-view {:enableArrayScrollingOptimization true}
|
||||
[(react/scroll-view) {:enableArrayScrollingOptimization true}
|
||||
[react/view
|
||||
(for [[index chat] (map-indexed vector (or all-home-items chats))]
|
||||
^{:key (first chat)}
|
||||
|
|
|
@ -168,7 +168,7 @@
|
|||
preferred-mailserver-id)
|
||||
pfs? (:pfs? settings)
|
||||
connection-message (connection-status peers-count node-status mailserver-state disconnected)]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/text {:style styles/advanced-settings-title}
|
||||
(i18n/label :advanced-settings)]
|
||||
|
||||
|
@ -225,7 +225,7 @@
|
|||
(views/letsubs [installations [:pairing/installations]
|
||||
installation-id [:pairing/installation-id]
|
||||
installation-name [:pairing/installation-name]]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
(installations-section
|
||||
installation-id
|
||||
installation-name
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
[status-bar/status-bar]
|
||||
[react/keyboard-avoiding-view components.styles/flex
|
||||
[toolbar/simple-toolbar (i18n/label :t/extension) modal?]
|
||||
[react/scroll-view {:keyboard-should-persist-taps :handled}
|
||||
[(react/scroll-view) {:keyboard-should-persist-taps :handled}
|
||||
[react/view styles/wrapper
|
||||
[react/view {:style {:border-radius 8 :margin 10 :padding 8 :background-color colors/red}}
|
||||
[react/text {:style {:color colors/white}}
|
||||
|
@ -91,7 +91,7 @@
|
|||
[status-bar/status-bar]
|
||||
[react/keyboard-avoiding-view components.styles/flex
|
||||
[toolbar/simple-toolbar (i18n/label :t/extension-find)]
|
||||
[react/scroll-view {:keyboard-should-persist-taps :handled}
|
||||
[(react/scroll-view) {:keyboard-should-persist-taps :handled}
|
||||
[react/view styles/wrapper
|
||||
[text-input/text-input-with-label
|
||||
{:label (i18n/label :t/extension-address)
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
(list-selection/open-share {:message (i18n/label :t/get-status-at)})))
|
||||
|
||||
(defn toggle-list [contacts render-function]
|
||||
[react/scroll-view {:flex 1}
|
||||
[(react/scroll-view) {:flex 1}
|
||||
(if utils.platform/desktop?
|
||||
(for [contact contacts]
|
||||
^{:key (:public-key contact)}
|
||||
|
@ -152,7 +152,7 @@
|
|||
{:selected (count contacts)
|
||||
:max (dec constants/max-group-chat-participants)})]
|
||||
[group-name-view]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[list/list-with-label {:flex 1}
|
||||
(i18n/label :t/members-title)
|
||||
[list/flat-list {:data contacts
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
[common/separator]
|
||||
[react/view styles/choose-authentication-method
|
||||
[react/view styles/lock-image-container
|
||||
[react/image {:source (:keycard-lock resources/ui)
|
||||
[react/image {:source (resources/get-image :keycard-lock)
|
||||
:style styles/lock-image}]]
|
||||
[react/text {:style styles/choose-authentication-method-text
|
||||
:number-of-lines 3}
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
(defview application-info [visible?]
|
||||
(letsubs [info [:hardwallet-application-info]
|
||||
error [:hardwallet-application-info-error]]
|
||||
[react/modal {:visible @visible?
|
||||
:transparent false
|
||||
:on-request-close #()}
|
||||
[(react/modal) {:visible @visible?
|
||||
:transparent false
|
||||
:on-request-close #()}
|
||||
[react/view {:padding 20
|
||||
:justify-content :center}
|
||||
[react/text {:style {:font-size 18
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
(letsubs [card-read-in-progress? [:hardwallet/card-read-in-progress?]]
|
||||
[react/view styles/nfc-enabled-container
|
||||
[react/view
|
||||
[react/image {:source (:hold-card-animation resources/ui)
|
||||
[react/image {:source (resources/get-image :hold-card-animation)
|
||||
:style styles/phone-nfc-on-image}]]
|
||||
[react/view styles/turn-nfc-text-container
|
||||
[react/text {:style styles/status-hardwallet-text
|
||||
|
@ -30,7 +30,7 @@
|
|||
(defn nfc-disabled []
|
||||
[react/view styles/nfc-disabled-container
|
||||
[react/view
|
||||
[react/image {:source (:phone-nfc-off resources/ui)
|
||||
[react/image {:source (resources/get-image :phone-nfc-off)
|
||||
:style styles/phone-nfc-off-image}]]
|
||||
[react/view styles/turn-nfc-text-container
|
||||
[react/text {:style styles/status-hardwallet-text
|
||||
|
@ -59,7 +59,7 @@
|
|||
[nfc-disabled])]
|
||||
(if (= setup-step :begin)
|
||||
[react/view styles/bottom-container
|
||||
[react/touchable-highlight {:on-press #(.openURL react/linking "https://hardwallet.status.im")}
|
||||
[react/touchable-highlight {:on-press #(.openURL (react/linking) "https://hardwallet.status.im")}
|
||||
[react/view styles/product-info-container
|
||||
[react/text {:style styles/product-info-text}
|
||||
(i18n/label :t/product-information)]
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
(defn pin-view [{:keys [pin title-label description-label step status error-label
|
||||
retry-counter]}]
|
||||
(let [enabled? (not= status :verifying)]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view styles/pin-container
|
||||
[react/view styles/center-container
|
||||
[react/text {:style styles/center-title-text}
|
||||
|
|
|
@ -60,7 +60,7 @@
|
|||
[react/view {:margin-top 71
|
||||
:flex 1
|
||||
:align-items :center}
|
||||
[react/image {:source (:warning-sign resources/ui)
|
||||
[react/image {:source (resources/get-image :warning-sign)
|
||||
:style {:width 160
|
||||
:height 160}}]]
|
||||
[react/view {:flex 1
|
||||
|
@ -99,7 +99,7 @@
|
|||
[react/view {:margin-top 47
|
||||
:flex 1
|
||||
:align-items :center}
|
||||
[react/image {:source (:hardwallet-card resources/ui)
|
||||
[react/image {:source (resources/get-image :hardwallet-card)
|
||||
:style {:width 255
|
||||
:height 160}}]
|
||||
(when paired-on
|
||||
|
@ -115,7 +115,7 @@
|
|||
[react/view
|
||||
[action-row {:icon :main-icons/info
|
||||
:label :t/help-capitalized
|
||||
:on-press #(.openURL react/linking "https://hardwallet.status.im")}]
|
||||
:on-press #(.openURL (react/linking) "https://hardwallet.status.im")}]
|
||||
(when pairing
|
||||
[react/view
|
||||
[action-row {:icon :main-icons/add
|
||||
|
|
|
@ -20,15 +20,15 @@
|
|||
[status-im.ui.screens.hardwallet.setup.styles :as styles]
|
||||
[status-im.utils.security :as security]))
|
||||
|
||||
(defonce event-emitter (.-DeviceEventEmitter js-dependencies/react-native))
|
||||
(defn event-emitter [] (.-DeviceEventEmitter js-dependencies/react-native))
|
||||
|
||||
(defview secret-keys []
|
||||
(letsubs [secrets [:hardwallet-secrets]]
|
||||
[react/view styles/secret-keys-container
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view styles/secret-keys-inner-container
|
||||
[react/view
|
||||
[react/image {:source (:secret-keys resources/ui)
|
||||
[react/image {:source (resources/get-image :secret-keys)
|
||||
:style styles/secret-keys-image-container}]]
|
||||
[react/view styles/secret-keys-title-container
|
||||
[react/text {:style styles/secret-keys-title-text
|
||||
|
@ -235,7 +235,7 @@
|
|||
error [:hardwallet-setup-error]
|
||||
width [:dimensions/window-width]
|
||||
ref (atom nil)]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view styles/enter-pair-code-container
|
||||
[react/view styles/enter-pair-code-title-container
|
||||
[react/view
|
||||
|
@ -265,7 +265,7 @@
|
|||
Used by 'Prepare', 'Pair', 'No slots', 'Card is linked' screens"
|
||||
[react/view styles/card-with-button-view-container
|
||||
[react/view styles/hardwallet-card-image-container
|
||||
[react/image {:source (:hardwallet-card resources/ui)
|
||||
[react/image {:source (resources/get-image :hardwallet-card)
|
||||
:style styles/hardwallet-card-image}]
|
||||
[react/view styles/center-text-container
|
||||
[react/text {:style (assoc styles/center-text :padding-horizontal 60)}
|
||||
|
@ -282,12 +282,12 @@
|
|||
|
||||
(defn begin []
|
||||
[react/view styles/card-blank-container
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view styles/hardwallet-card-image-container
|
||||
[react/text {:style styles/card-is-empty-text}
|
||||
(i18n/label :t/card-is-blank)]
|
||||
[react/view {:margin-top 15}
|
||||
[react/image {:source (:hardwallet-card resources/ui)
|
||||
[react/image {:source (resources/get-image :hardwallet-card)
|
||||
:style styles/hardwallet-card-image}]]
|
||||
[react/view styles/card-is-empty-prepare-text
|
||||
[react/text {:style styles/center-text}
|
||||
|
@ -323,20 +323,20 @@
|
|||
:button-label :t/help-capitalized
|
||||
:show-icon? true
|
||||
:button-container-style {:background-color colors/white}
|
||||
:on-press #(.openURL react/linking "https://hardwallet.status.im")}])
|
||||
:on-press #(.openURL (react/linking) "https://hardwallet.status.im")}])
|
||||
|
||||
(defn card-already-linked []
|
||||
[card-with-button-view {:text-label :t/card-already-linked
|
||||
:button-label :t/help-capitalized
|
||||
:show-icon? true
|
||||
:button-container-style {:background-color colors/white}
|
||||
:on-press #(.openURL react/linking "https://hardwallet.status.im")}])
|
||||
:on-press #(.openURL (react/linking) "https://hardwallet.status.im")}])
|
||||
|
||||
(defview error []
|
||||
(letsubs [error [:hardwallet-setup-error]]
|
||||
[react/view styles/card-with-button-view-container
|
||||
[react/view styles/hardwallet-card-image-container
|
||||
[react/image {:source (:hardwallet-card resources/ui)
|
||||
[react/image {:source (resources/get-image :hardwallet-card)
|
||||
:style styles/hardwallet-card-image}]
|
||||
[react/view styles/center-text-container
|
||||
[react/text {:style styles/center-text}
|
||||
|
@ -380,7 +380,7 @@
|
|||
(.removeListener @listener)))
|
||||
:component-did-mount (fn []
|
||||
(reset! listener
|
||||
(.addListener event-emitter
|
||||
(.addListener (event-emitter)
|
||||
"keycardInstallationProgress"
|
||||
(fn [params]
|
||||
(when @progress-bar
|
||||
|
@ -396,10 +396,10 @@
|
|||
(i18n/label :t/taking-long-hold-phone-connected)]]
|
||||
[react/view styles/progress-bar-container
|
||||
(if (contains? #{:blank :init} card-state)
|
||||
[react/progress-bar {:styleAttr "Horizontal"
|
||||
:indeterminate false
|
||||
:progress 0
|
||||
:ref #(reset! progress-bar %)}]
|
||||
[(react/progress-bar) {:styleAttr "Horizontal"
|
||||
:indeterminate false
|
||||
:progress 0
|
||||
:ref #(reset! progress-bar %)}]
|
||||
[react/activity-indicator {:animating true
|
||||
:size :large}])]]))
|
||||
|
||||
|
|
|
@ -14,13 +14,13 @@
|
|||
[status-bar/status-bar]
|
||||
[toolbar/simple-toolbar
|
||||
(i18n/label :t/help-center)]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view
|
||||
[profile.components/settings-item-separator]
|
||||
[profile.components/settings-item
|
||||
{:label-kw :t/faq
|
||||
:accessibility-label :faq-button
|
||||
:action-fn #(.openURL react/linking
|
||||
:action-fn #(.openURL (react/linking)
|
||||
(if platform/desktop?
|
||||
"https://status.im/docs/FAQ-desktop.html"
|
||||
"https://status.im/docs/FAQs.html"))}]
|
||||
|
|
|
@ -24,11 +24,11 @@
|
|||
(animation/start (animation/spring animated-offset-x {:toValue to-value})))))
|
||||
|
||||
(defn swipe-pan-responder [animated-offset-x end-offset-x chat-id swiped?]
|
||||
(.create react/pan-responder
|
||||
(.create (react/pan-responder)
|
||||
(clj->js {:onMoveShouldSetPanResponder on-start
|
||||
:onPanResponderMove (on-move animated-offset-x end-offset-x swiped?)
|
||||
:onPanResponderRelease (on-release animated-offset-x end-offset-x chat-id swiped?)
|
||||
:onPanResponderTerminate (on-release animated-offset-x end-offset-x chat-id swiped?)})))
|
||||
|
||||
(defn pan-handlers [pan-responder]
|
||||
(js->clj (.-panHandlers pan-responder)))
|
||||
(js->clj (.-panHandlers pan-responder)))
|
||||
|
|
|
@ -95,7 +95,7 @@
|
|||
(let [{:keys [show? height]} @search-input-state]
|
||||
(when (or show?
|
||||
search-filter)
|
||||
[react/animated-view
|
||||
[(react/animated-view)
|
||||
{:style {:height height}}
|
||||
[search-input search-filter
|
||||
{:on-cancel #(do
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
[react/view {:style styles/welcome-image-container}
|
||||
[components.common/image-contain
|
||||
{:container-style {}}
|
||||
{:image (:welcome-image resources/ui) :width 750 :height 556}]]
|
||||
{:image (resources/get-image :welcome-image) :width 750 :height 556}]]
|
||||
[react/i18n-text {:style styles/welcome-text :key :welcome-to-status}]
|
||||
[react/view
|
||||
[react/i18n-text {:style styles/welcome-text-description
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
[status-bar/status-bar]
|
||||
[react/keyboard-avoiding-view components.styles/flex
|
||||
[toolbar/simple-toolbar (i18n/label :t/add-network)]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view styles/edit-network-view
|
||||
[text-input/text-input-with-label
|
||||
{:label (i18n/label :t/name)
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
[status-bar/status-bar]
|
||||
[react/keyboard-avoiding-view components.styles/flex
|
||||
[toolbar/simple-toolbar (i18n/label (if id :t/mailserver-details :t/add-mailserver))]
|
||||
[react/scroll-view {:keyboard-should-persist-taps :handled}
|
||||
[(react/scroll-view) {:keyboard-should-persist-taps :handled}
|
||||
[react/view styles/edit-mailserver-view
|
||||
[text-input/text-input-with-label
|
||||
{:label (i18n/label :t/name)
|
||||
|
|
|
@ -146,7 +146,7 @@
|
|||
:on-value-change (partial toggle-enabled! installation-id enabled?)}])]]])
|
||||
|
||||
(defn render-rows [installation-id installation-name installations]
|
||||
[react/scroll-view {:style styles/wrapper}
|
||||
[(react/scroll-view) {:style styles/wrapper}
|
||||
[your-device installation-id installation-name]
|
||||
(when (seq installations)
|
||||
[list/flat-list {:data installations
|
||||
|
@ -156,7 +156,7 @@
|
|||
|
||||
(views/defview edit-installation-name []
|
||||
[react/keyboard-avoiding-view styles/edit-installation
|
||||
[react/scroll-view {:keyboard-should-persist-taps :handled}
|
||||
[(react/scroll-view) {:keyboard-should-persist-taps :handled}
|
||||
[react/view
|
||||
[react/text (i18n/label :t/pairing-please-set-a-name)]]
|
||||
[text-input/text-input-with-label
|
||||
|
@ -179,7 +179,7 @@
|
|||
|
||||
(defn info-section []
|
||||
[react/view {:style styles/info-section}
|
||||
[react/touchable-highlight {:on-press #(.openURL react/linking "https://status.im/tutorials/pairing.html")}
|
||||
[react/touchable-highlight {:on-press #(.openURL (react/linking) "https://status.im/tutorials/pairing.html")}
|
||||
[react/text {:style styles/info-section-text} (i18n/label :t/learn-more)]]])
|
||||
|
||||
(defn installations-list [installation-id installation-name installations]
|
||||
|
@ -197,7 +197,7 @@
|
|||
[toolbar/toolbar {}
|
||||
toolbar/default-nav-back
|
||||
[toolbar/content-title (i18n/label :t/devices)]]
|
||||
[react/scroll-view {:style {:background-color :white}}
|
||||
[(react/scroll-view) {:style {:background-color :white}}
|
||||
(if (string/blank? installation-name)
|
||||
[edit-installation-name]
|
||||
[react/view
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
[react/view profile.components.styles/profile
|
||||
[status-bar/status-bar]
|
||||
[profile-contact-toolbar]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view profile.components.styles/profile-form
|
||||
[profile.components/profile-header
|
||||
{:contact contact
|
||||
|
|
|
@ -105,7 +105,7 @@
|
|||
(if editing?
|
||||
[group-chat-profile-edit-toolbar]
|
||||
[group-chat-profile-toolbar admin?])
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[react/view profile.components.styles/profile-form
|
||||
[profile.components/profile-header
|
||||
{:contact shown-chat
|
||||
|
|
|
@ -36,11 +36,11 @@
|
|||
:second-word (re-frame/dispatch [:my-profile/set-step :first-word])))
|
||||
|
||||
(defn intro []
|
||||
[react/scroll-view {:style {:padding-horizontal 16}
|
||||
:content-container-style {:align-items :center
|
||||
:justify-content :center}}
|
||||
[(react/scroll-view) {:style {:padding-horizontal 16}
|
||||
:content-container-style {:align-items :center
|
||||
:justify-content :center}}
|
||||
(when-not platform/desktop?
|
||||
[react/image {:source (:lock resources/ui)
|
||||
[react/image {:source (resources/get-image :lock)
|
||||
:style styles/intro-image}])
|
||||
[react/i18n-text {:style styles/intro-text
|
||||
:key :your-data-belongs-to-you}]
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
[react/view {:style {:flex 1
|
||||
:min-height 32}}]
|
||||
|
||||
[react/image {:source (:tribute-to-talk resources/ui)
|
||||
[react/image {:source (resources/get-image :tribute-to-talk)
|
||||
:style styles/intro-image}]
|
||||
[react/view {:style {:flex 1
|
||||
:min-height 32}}]
|
||||
|
@ -67,7 +67,7 @@
|
|||
|
||||
(defn number-view
|
||||
[numpad-symbol {:keys [on-press]}]
|
||||
[react/touchable-opacity
|
||||
[(react/touchable-opacity)
|
||||
{:on-press #(on-press numpad-symbol)}
|
||||
[react/view {:style styles/number-container}
|
||||
(if (= numpad-symbol :remove)
|
||||
|
@ -96,7 +96,7 @@
|
|||
|
||||
(defn set-snt-amount
|
||||
[snt-amount]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
{:content-container-style styles/set-snt-amount-container}
|
||||
[react/view {:style (styles/horizontal-separator 16 32)}]
|
||||
[snt-amount-label snt-amount]
|
||||
|
@ -109,7 +109,7 @@
|
|||
|
||||
(defn personalized-message
|
||||
[message]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
{:content-container-style styles/personalized-message-container}
|
||||
[react/view {:style styles/personalized-message-title}
|
||||
[react/nested-text {:style {:text-align :center}}
|
||||
|
@ -219,7 +219,7 @@
|
|||
|
||||
(defn edit
|
||||
[snt-amount message fiat-value]
|
||||
[react/scroll-view {:content-container-style styles/edit-container}
|
||||
[(react/scroll-view) {:content-container-style styles/edit-container}
|
||||
[react/view {:style styles/edit-screen-top-row}
|
||||
[react/view {:style {:flex-direction :row
|
||||
:justify-content :flex-start
|
||||
|
@ -312,8 +312,8 @@
|
|||
(i18n/label :t/tribute-to-talk)]
|
||||
[react/text {:style styles/step-n}
|
||||
(i18n/label :t/learn-more)]]])
|
||||
[react/scroll-view {:content-container-style styles/learn-more-container}
|
||||
[react/image {:source (:tribute-to-talk resources/ui)
|
||||
[(react/scroll-view) {:content-container-style styles/learn-more-container}
|
||||
[react/image {:source (resources/get-image :tribute-to-talk)
|
||||
:style styles/learn-more-image}]
|
||||
[react/text {:style styles/learn-more-title-text}
|
||||
(i18n/label :t/tribute-to-talk)]
|
||||
|
@ -347,12 +347,11 @@
|
|||
:t/tribute-to-talk-paywall-learn-more-3))]]]])
|
||||
|
||||
(defview tribute-to-talk []
|
||||
(letsubs [current-account [:account/account]
|
||||
{:keys [step snt-amount editing? message
|
||||
(letsubs [{:keys [step snt-amount editing? message
|
||||
fiat-value disable-button? state]}
|
||||
[:tribute-to-talk/ui]]
|
||||
[react/keyboard-avoiding-view {:style styles/container}
|
||||
[react/safe-area-view {:style {:flex 1}}
|
||||
[(react/safe-area-view) {:style {:flex 1}}
|
||||
[status-bar/status-bar]
|
||||
[toolbar/toolbar
|
||||
nil
|
||||
|
|
|
@ -125,7 +125,7 @@
|
|||
:action-fn #(re-frame/dispatch [:profile.ui/keycard-settings-button-pressed])}])
|
||||
[profile.components/settings-item {:label-kw :t/notifications
|
||||
:accessibility-label :notifications-button
|
||||
:action-fn #(.openURL react/linking "app-settings://notification/status-im")}]
|
||||
:action-fn #(.openURL (react/linking) "app-settings://notification/status-im")}]
|
||||
[profile.components/settings-item-separator]
|
||||
[profile.components/settings-item {:label-kw :t/mobile-network-settings
|
||||
:accessibility-label :notifications-button
|
||||
|
@ -311,7 +311,7 @@
|
|||
[react/keyboard-avoiding-view {:style {:flex 1}}
|
||||
[status-bar/status-bar {:type :main}]
|
||||
[toolbar/simple-toolbar label]
|
||||
[react/scroll-view
|
||||
[(react/scroll-view)
|
||||
[view]]]))
|
||||
|
||||
(defview my-profile []
|
||||
|
@ -343,8 +343,8 @@
|
|||
(if editing?
|
||||
[my-profile-edit-toolbar on-show-edit]
|
||||
[my-profile-toolbar])
|
||||
[react/scroll-view {:ref #(reset! scroll %)
|
||||
:keyboard-should-persist-taps :handled}
|
||||
[(react/scroll-view) {:ref #(reset! scroll %)
|
||||
:keyboard-should-persist-taps :handled}
|
||||
[react/view profile.components.styles/profile-form
|
||||
[profile.components/profile-header
|
||||
{:contact current-account
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue