Compare commits
22
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
916c0b995c | ||
|
|
9b2f6147b6 | ||
|
|
4d018a32d4 | ||
|
|
5c801331af | ||
|
|
96b09eb862 | ||
|
|
e104a9a935 | ||
|
|
34930a7136 | ||
|
|
e6f8df9a52 | ||
|
|
f873dfcde0 | ||
|
|
8034167750 | ||
|
|
702899a9cf | ||
|
|
59f536c479 | ||
|
|
cce91abad0 | ||
|
|
8353c65602 | ||
|
|
c54f291945 | ||
|
|
d379d80df4 | ||
|
|
702da7a318 | ||
|
|
1f967c6aa1 | ||
|
|
ca53bf7388 | ||
|
|
5a6ae261ed | ||
|
|
1bbfd2222e | ||
|
|
f04f138f93 |
@@ -35,4 +35,4 @@ LOCAL_PAIRING_ENABLED=1
|
||||
TEST_STATEOFUS=1
|
||||
FAST_CREATE_COMMUNITY_ENABLED=1
|
||||
TEST_NETWORKS_ENABLED=1
|
||||
SHOW_NOT_IMPLEMENTED_FEATURES=1
|
||||
SHOW_NOT_IMPLEMENTED_FEATURES=0
|
||||
|
||||
+2
-2
@@ -164,7 +164,7 @@ def build_ios_e2e
|
||||
# 3. directory where to up StatusIm.app
|
||||
derived_data_path: 'status-ios',
|
||||
output_name: 'StatusIm.app',
|
||||
buildlog_path: 'ios/logs',
|
||||
buildlog_path: 'logs',
|
||||
# -------------------------------------
|
||||
# Normal stuff
|
||||
scheme: 'StatusIm',
|
||||
@@ -231,7 +231,7 @@ platform :ios do
|
||||
clean: true,
|
||||
export_method: 'app-store',
|
||||
output_directory: 'status-ios',
|
||||
buildlog_path: 'ios/logs',
|
||||
buildlog_path: 'logs',
|
||||
include_symbols: false,
|
||||
export_options: {
|
||||
"combileBitcode": true,
|
||||
|
||||
+21
-9
@@ -1,13 +1,28 @@
|
||||
# Resolve react_native_pods.rb with node to allow for hoisting
|
||||
require Pod::Executable.execute_command('node', ['-p',
|
||||
'require.resolve(
|
||||
"react-native/scripts/react_native_pods.rb",
|
||||
{paths: [process.argv[1]]},
|
||||
)', __dir__]).strip
|
||||
def node_require(script)
|
||||
# Resolve script with node to allow for hoisting
|
||||
require Pod::Executable.execute_command('node', ['-p',
|
||||
"require.resolve(
|
||||
'#{script}',
|
||||
{paths: [process.argv[1]]},
|
||||
)", __dir__]).strip
|
||||
end
|
||||
|
||||
node_require('react-native/scripts/react_native_pods.rb')
|
||||
node_require('react-native-permissions/scripts/setup.rb')
|
||||
|
||||
platform :ios, min_ios_version_supported
|
||||
prepare_react_native_project!
|
||||
|
||||
setup_permissions([
|
||||
'Camera',
|
||||
'FaceID',
|
||||
'MediaLibrary',
|
||||
'Microphone',
|
||||
'Notifications',
|
||||
'PhotoLibrary',
|
||||
'PhotoLibraryAddOnly',
|
||||
])
|
||||
|
||||
linkage = ENV['USE_FRAMEWORKS']
|
||||
if linkage != nil
|
||||
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
|
||||
@@ -43,9 +58,6 @@ abstract_target 'Status' do
|
||||
|
||||
pod 'SSZipArchive', '2.4.3'
|
||||
|
||||
permissions_path = '../node_modules/react-native-permissions/ios'
|
||||
pod 'Permission-Microphone', :path => "#{permissions_path}/Microphone/Permission-Microphone.podspec"
|
||||
pod 'Permission-Camera', :path => "#{permissions_path}/Camera/Permission-Camera.podspec"
|
||||
pod "react-native-status-keycard", path: "../node_modules/react-native-status-keycard"
|
||||
pod "react-native-status", path: "../modules/react-native-status"
|
||||
pod "Keycard", git: "https://github.com/status-im/Keycard.swift.git"
|
||||
|
||||
+7
-17
@@ -28,10 +28,6 @@ PODS:
|
||||
- libwebp/mux (1.2.4):
|
||||
- libwebp/demux
|
||||
- libwebp/webp (1.2.4)
|
||||
- Permission-Camera (3.8.0):
|
||||
- RNPermissions
|
||||
- Permission-Microphone (3.8.0):
|
||||
- RNPermissions
|
||||
- RCT-Folly (2022.05.16.00):
|
||||
- boost
|
||||
- DoubleConversion
|
||||
@@ -879,7 +875,9 @@ PODS:
|
||||
- React-Core
|
||||
- react-native-blob-util (0.13.18):
|
||||
- React-Core
|
||||
- react-native-blur (4.3.3):
|
||||
- react-native-blur (4.4.0):
|
||||
- glog
|
||||
- RCT-Folly (= 2022.05.16.00)
|
||||
- React-Core
|
||||
- react-native-cameraroll (7.5.2):
|
||||
- glog
|
||||
@@ -1123,7 +1121,7 @@ PODS:
|
||||
- TOCropViewController
|
||||
- RNKeychain (8.1.2):
|
||||
- React-Core
|
||||
- RNPermissions (3.8.0):
|
||||
- RNPermissions (4.1.5):
|
||||
- React-Core
|
||||
- RNReanimated (3.6.1):
|
||||
- glog
|
||||
@@ -1156,8 +1154,6 @@ DEPENDENCIES:
|
||||
- FBReactNativeSpec (from `../node_modules/react-native/React/FBReactNativeSpec`)
|
||||
- glog (from `../node_modules/react-native/third-party-podspecs/glog.podspec`)
|
||||
- Keycard (from `https://github.com/status-im/Keycard.swift.git`)
|
||||
- Permission-Camera (from `../node_modules/react-native-permissions/ios/Camera/Permission-Camera.podspec`)
|
||||
- Permission-Microphone (from `../node_modules/react-native-permissions/ios/Microphone/Permission-Microphone.podspec`)
|
||||
- RCT-Folly (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
|
||||
- RCT-Folly/Fabric (from `../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec`)
|
||||
- RCTRequired (from `../node_modules/react-native/Libraries/RCTRequired`)
|
||||
@@ -1267,10 +1263,6 @@ EXTERNAL SOURCES:
|
||||
:podspec: "../node_modules/react-native/third-party-podspecs/glog.podspec"
|
||||
Keycard:
|
||||
:git: https://github.com/status-im/Keycard.swift.git
|
||||
Permission-Camera:
|
||||
:path: "../node_modules/react-native-permissions/ios/Camera/Permission-Camera.podspec"
|
||||
Permission-Microphone:
|
||||
:path: "../node_modules/react-native-permissions/ios/Microphone/Permission-Microphone.podspec"
|
||||
RCT-Folly:
|
||||
:podspec: "../node_modules/react-native/third-party-podspecs/RCT-Folly.podspec"
|
||||
RCTRequired:
|
||||
@@ -1450,8 +1442,6 @@ SPEC CHECKSUMS:
|
||||
HMSegmentedControl: 34c1f54d822d8308e7b24f5d901ec674dfa31352
|
||||
Keycard: ac6df4d91525c3c82635ac24d4ddd9a80aca5fc8
|
||||
libwebp: f62cb61d0a484ba548448a4bd52aabf150ff6eef
|
||||
Permission-Camera: e6d142d7d8b714afe0a83e5e6ae17eb949f1e3e9
|
||||
Permission-Microphone: 644b1de8bcc2afcaf934e09a22bee507a95796a7
|
||||
RCT-Folly: 7169b2b1c44399c76a47b5deaaba715eeeb476c0
|
||||
RCTRequired: 2544c0f1081a5fa12e108bb8cb40e5f4581ccd87
|
||||
RCTTypeSafety: 50efabe2b115c11ed03fbf3fd79e2f163ddb5d7c
|
||||
@@ -1476,7 +1466,7 @@ SPEC CHECKSUMS:
|
||||
react-native-background-timer: 1f7d560647b40e6a60b01c452ba29c54bf581fc4
|
||||
react-native-biometrics: 352e5a794bfffc46a0c86725ea7dc62deb085bdc
|
||||
react-native-blob-util: 600972b1782380a5a7d5db61a3817ea32349dae9
|
||||
react-native-blur: c6d0a1dc2b4b519f7afe3b14d8151998632b6d18
|
||||
react-native-blur: 799045500f56146afc46245148080e7b7623cb75
|
||||
react-native-cameraroll: af8eec1e585d053ff485d98ec837f9a8a11b5745
|
||||
react-native-config: 5330c8258265c1e5fdb8c009d2cabd6badd96727
|
||||
react-native-hole-view: 6935448993bac79f2b5a4ad7e9741094cf810679
|
||||
@@ -1523,7 +1513,7 @@ SPEC CHECKSUMS:
|
||||
RNGestureHandler: 15c6ef51acba34c49ff03003806cf5dd6098f383
|
||||
RNImageCropPicker: 486e2f7e2b0461ce24321f751410dce1b3b49e6d
|
||||
RNKeychain: a65256b6ca6ba6976132cc4124b238a5b13b3d9c
|
||||
RNPermissions: 215c54462104b3925b412b0fb3c9c497b21c358b
|
||||
RNPermissions: 08e619529cced22695f4b6d0efcc0a233e278903
|
||||
RNReanimated: dee37576492f1a375017515f5c77e66e5eec696b
|
||||
RNShare: 859ff710211285676b0bcedd156c12437ea1d564
|
||||
RNStaticSafeAreaInsets: 055ddbf5e476321720457cdaeec0ff2ba40ec1b8
|
||||
@@ -1536,6 +1526,6 @@ SPEC CHECKSUMS:
|
||||
TOCropViewController: edfd4f25713d56905ad1e0b9f5be3fbe0f59c863
|
||||
Yoga: a716eea57d0d3430219c0a5a233e1e93ee931eb7
|
||||
|
||||
PODFILE CHECKSUM: c9c6dfac28e31314e1a2ee2dc47364ad151f13f2
|
||||
PODFILE CHECKSUM: bb02c595a4aa4430da978b55da5440811cbd9d91
|
||||
|
||||
COCOAPODS: 1.13.0
|
||||
|
||||
@@ -602,12 +602,14 @@
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm/Pods-Status-StatusIm-resources.sh",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNPermissionsPrivacyInfo.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
|
||||
);
|
||||
@@ -624,12 +626,14 @@
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusImPR/Pods-Status-StatusImPR-resources.sh",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNPermissionsPrivacyInfo.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
|
||||
);
|
||||
@@ -668,12 +672,14 @@
|
||||
inputPaths = (
|
||||
"${PODS_ROOT}/Target Support Files/Pods-Status-StatusIm-StatusImTests/Pods-Status-StatusIm-StatusImTests-resources.sh",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNImageCropPicker/QBImagePicker.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/RNPermissions/RNPermissionsPrivacyInfo.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/React-Core/RCTI18nStrings.bundle",
|
||||
"${PODS_CONFIGURATION_BUILD_DIR}/TOCropViewController/TOCropViewControllerBundle.bundle",
|
||||
);
|
||||
name = "[CP] Copy Pods Resources";
|
||||
outputPaths = (
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/QBImagePicker.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RNPermissionsPrivacyInfo.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/RCTI18nStrings.bundle",
|
||||
"${TARGET_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/TOCropViewControllerBundle.bundle",
|
||||
);
|
||||
|
||||
+2
-2
@@ -12,7 +12,7 @@
|
||||
"@react-native-camera-roll/camera-roll": "7.5.2",
|
||||
"@react-native-clipboard/clipboard": "1.13.2",
|
||||
"@react-native-community/audio-toolkit": "git+https://github.com/tbenr/react-native-audio-toolkit.git#refs/tags/v2.0.3-status-v6",
|
||||
"@react-native-community/blur": "git+https://github.com/status-im/react-native-blur.git#refs/tags/v4.3.3-status",
|
||||
"@react-native-community/blur": "4.4.0",
|
||||
"@react-native-community/hooks": "^3.0.0",
|
||||
"@react-native-community/masked-view": "^0.1.6",
|
||||
"@react-native-community/netinfo": "^4.4.0",
|
||||
@@ -51,7 +51,7 @@
|
||||
"react-native-mail": "6.1.1",
|
||||
"react-native-navigation": "7.38.3",
|
||||
"react-native-orientation-locker": "^1.5.0",
|
||||
"react-native-permissions": "3.8.0",
|
||||
"react-native-permissions": "4.1.5",
|
||||
"react-native-reanimated": "3.6.1",
|
||||
"react-native-redash": "18.1.0",
|
||||
"react-native-shadow-2": "^7.0.8",
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
--- /tmp/tmp-status-mobile-851dbcb56/tmp.gcyqIAUEIA/build.gradle 2024-04-16 18:11:12.481819000 +0200
|
||||
+++ ./node_modules/@react-native-community/blur/android/build.gradle 2024-04-16 18:11:18.889991702 +0200
|
||||
@@ -5,7 +5,7 @@
|
||||
}
|
||||
|
||||
dependencies {
|
||||
- classpath 'com.android.tools.build:gradle:3.5.3'
|
||||
+ classpath 'com.android.tools.build:gradle:3.5.4'
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
--- /tmp/tmp-status-mobile-61974dae4/tmp.6k5ZPUa0Hp/BlurView.ios.tsx 2024-04-16 17:07:33.229847000 +0200
|
||||
+++ ./node_modules/@react-native-community/blur/src/components/BlurView.ios.tsx 2024-04-16 17:07:58.540617624 +0200
|
||||
@@ -6,6 +6,7 @@
|
||||
| 'dark'
|
||||
| 'light'
|
||||
| 'xlight'
|
||||
+ | 'transparent'
|
||||
| 'prominent'
|
||||
| 'regular'
|
||||
| 'extraDark'
|
||||
@@ -0,0 +1,57 @@
|
||||
--- /tmp/tmp-status-mobile-851dbcb56/tmp.beqWjtcNwi/BlurView.mm 2024-04-16 17:55:00.688450000 +0200
|
||||
+++ ./node_modules/@react-native-community/blur/ios/BlurView.mm 2024-04-16 17:56:17.772952042 +0200
|
||||
@@ -73,7 +73,7 @@
|
||||
{
|
||||
const auto &oldViewProps = *std::static_pointer_cast<const BlurViewProps>(_props);
|
||||
const auto &newViewProps = *std::static_pointer_cast<const BlurViewProps>(props);
|
||||
-
|
||||
+
|
||||
if (oldViewProps.blurAmount != newViewProps.blurAmount) {
|
||||
NSNumber *blurAmount = [NSNumber numberWithInt:newViewProps.blurAmount];
|
||||
[self setBlurAmount:blurAmount];
|
||||
@@ -83,12 +83,12 @@
|
||||
NSString *blurType = [NSString stringWithUTF8String:toString(newViewProps.blurType).c_str()];
|
||||
[self setBlurType:blurType];
|
||||
}
|
||||
-
|
||||
+
|
||||
if (oldViewProps.reducedTransparencyFallbackColor != newViewProps.reducedTransparencyFallbackColor) {
|
||||
UIColor *color = RCTUIColorFromSharedColor(newViewProps.reducedTransparencyFallbackColor);
|
||||
[self setReducedTransparencyFallbackColor:color];
|
||||
}
|
||||
-
|
||||
+
|
||||
[super updateProps:props oldProps:oldProps];
|
||||
}
|
||||
#endif // RCT_NEW_ARCH_ENABLED
|
||||
@@ -131,6 +131,7 @@
|
||||
|
||||
- (UIBlurEffectStyle)blurEffectStyle
|
||||
{
|
||||
+ if ([self.blurType isEqual: @"transparent"]) return UIBlurEffectStyleDark;
|
||||
if ([self.blurType isEqual: @"xlight"]) return UIBlurEffectStyleExtraLight;
|
||||
if ([self.blurType isEqual: @"light"]) return UIBlurEffectStyleLight;
|
||||
if ([self.blurType isEqual: @"dark"]) return UIBlurEffectStyleDark;
|
||||
@@ -160,7 +161,7 @@
|
||||
if ([self.blurType isEqual: @"thinMaterialLight"]) return UIBlurEffectStyleSystemThinMaterialLight;
|
||||
if ([self.blurType isEqual: @"ultraThinMaterialLight"]) return UIBlurEffectStyleSystemUltraThinMaterialLight;
|
||||
#endif
|
||||
-
|
||||
+
|
||||
#if TARGET_OS_TV
|
||||
if ([self.blurType isEqual: @"regular"]) return UIBlurEffectStyleRegular;
|
||||
if ([self.blurType isEqual: @"prominent"]) return UIBlurEffectStyleProminent;
|
||||
@@ -183,6 +184,13 @@
|
||||
UIBlurEffectStyle style = [self blurEffectStyle];
|
||||
self.blurEffect = [BlurEffectWithAmount effectWithStyle:style andBlurAmount:self.blurAmount];
|
||||
self.blurEffectView.effect = self.blurEffect;
|
||||
+
|
||||
+ if ([self.blurType isEqual: @"transparent"]) {
|
||||
+ for (UIView *subview in self.blurEffectView.subviews) {
|
||||
+ subview.backgroundColor = [UIColor clearColor];
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
- (void)updateFallbackView
|
||||
@@ -0,0 +1,10 @@
|
||||
--- /tmp/tmp-status-mobile-61974dae4/tmp.NHLSFZG6LG/BlurViewNativeComponent.ts 2024-04-16 17:08:42.755929000 +0200
|
||||
+++ ./node_modules/@react-native-community/blur/src/fabric/BlurViewNativeComponent.ts 2024-04-16 17:08:57.634037113 +0200
|
||||
@@ -10,6 +10,7 @@
|
||||
| 'dark'
|
||||
| 'light'
|
||||
| 'xlight'
|
||||
+ | 'transparent'
|
||||
| 'prominent'
|
||||
| 'regular'
|
||||
| 'extraDark'
|
||||
@@ -0,0 +1,10 @@
|
||||
--- /tmp/tmp-status-mobile-61974dae4/tmp.zy6uXqO4gW/VibrancyViewNativeComponent.ts 2024-04-16 17:09:23.772623000 +0200
|
||||
+++ ./node_modules/@react-native-community/blur/src/fabric/VibrancyViewNativeComponent.ts 2024-04-16 17:09:39.033737349 +0200
|
||||
@@ -10,6 +10,7 @@
|
||||
| 'dark'
|
||||
| 'light'
|
||||
| 'xlight'
|
||||
+ | 'transparent'
|
||||
| 'prominent'
|
||||
| 'regular'
|
||||
| 'extraDark'
|
||||
@@ -1,31 +0,0 @@
|
||||
(ns legacy.status-im.bottom-sheet.events
|
||||
(:require
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(rf/defn show-bottom-sheet-old
|
||||
[{:keys [db]} {:keys [view options]}]
|
||||
{:dismiss-keyboard nil
|
||||
:show-bottom-sheet-overlay-old nil
|
||||
:db (assoc db
|
||||
:bottom-sheet/show? true
|
||||
:bottom-sheet/view view
|
||||
:bottom-sheet/options options)})
|
||||
|
||||
(rf/defn show-bottom-sheet-event
|
||||
{:events [:bottom-sheet/show-sheet-old]}
|
||||
[cofx view options]
|
||||
(show-bottom-sheet-old
|
||||
cofx
|
||||
{:view view
|
||||
:options options}))
|
||||
|
||||
(rf/defn hide-bottom-sheet-old
|
||||
{:events [:bottom-sheet/hide-old]}
|
||||
[{:keys [db]}]
|
||||
{:db (assoc db :bottom-sheet/show? false)
|
||||
:dismiss-bottom-sheet-overlay-old nil})
|
||||
|
||||
(rf/defn hide-bottom-sheet-navigation-overlay
|
||||
{:events [:bottom-sheet/hide-old-navigation-overlay]}
|
||||
[{}]
|
||||
{:dismiss-bottom-sheet-overlay-old nil})
|
||||
@@ -1,37 +0,0 @@
|
||||
(ns legacy.status-im.bottom-sheet.sheets
|
||||
(:require
|
||||
[legacy.status-im.bottom-sheet.view :as bottom-sheet]
|
||||
[legacy.status-im.ui.screens.about-app.views :as about-app]
|
||||
[legacy.status-im.ui.screens.mobile-network-settings.view :as mobile-network-settings]
|
||||
[quo.theme]
|
||||
[react-native.core :as rn]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(defn bottom-sheet
|
||||
[]
|
||||
(let [dismiss-bottom-sheet-callback (fn []
|
||||
(rf/dispatch [:bottom-sheet/hide-old])
|
||||
true)
|
||||
{:keys [show? view options]} (rf/sub [:bottom-sheet-old])
|
||||
{:keys [content]
|
||||
:as opts}
|
||||
(cond-> {:visible? show?}
|
||||
(map? view)
|
||||
(merge view)
|
||||
|
||||
(= view :mobile-network-offline)
|
||||
(merge mobile-network-settings/offline-sheet)
|
||||
|
||||
(= view :learn-more)
|
||||
(merge about-app/learn-more))]
|
||||
|
||||
[:f>
|
||||
(fn []
|
||||
(rn/use-mount (fn []
|
||||
(rn/hw-back-add-listener dismiss-bottom-sheet-callback)
|
||||
(fn []
|
||||
(rn/hw-back-remove-listener dismiss-bottom-sheet-callback))))
|
||||
[quo.theme/provider (or (:theme options))
|
||||
[bottom-sheet/bottom-sheet opts
|
||||
(when content
|
||||
[content (when options options)])]])]))
|
||||
@@ -1,59 +0,0 @@
|
||||
(ns legacy.status-im.bottom-sheet.styles
|
||||
(:require
|
||||
[quo.foundations.colors :as colors]))
|
||||
|
||||
(def border-radius 20)
|
||||
|
||||
(defn handle
|
||||
[override-theme]
|
||||
{:position :absolute
|
||||
:top 8
|
||||
:width 32
|
||||
:height 4
|
||||
:background-color (colors/theme-colors colors/neutral-100 colors/white override-theme)
|
||||
:opacity 0.1
|
||||
:border-radius 100
|
||||
:align-self :center})
|
||||
|
||||
(def backdrop
|
||||
{:position :absolute
|
||||
:left 0
|
||||
:right 0
|
||||
:bottom 0
|
||||
:top 0})
|
||||
|
||||
(def backdrop-color
|
||||
{:background-color colors/neutral-100})
|
||||
|
||||
(def container
|
||||
{:position :absolute
|
||||
:left 0
|
||||
:right 0
|
||||
:top 0
|
||||
:bottom 0
|
||||
:overflow :hidden})
|
||||
|
||||
(defn content-style
|
||||
[insets bottom-safe-area-spacing?]
|
||||
{:position :absolute
|
||||
:left 0
|
||||
:right 0
|
||||
:top 0
|
||||
:padding-top border-radius
|
||||
:padding-bottom (if bottom-safe-area-spacing? (:bottom insets) 0)})
|
||||
|
||||
(defn selected-background
|
||||
[override-theme]
|
||||
{:border-radius 12
|
||||
:padding-left 12
|
||||
:margin-horizontal 8
|
||||
:margin-bottom 10
|
||||
:height 48
|
||||
:background-color (colors/theme-colors colors/white colors/neutral-90 override-theme)})
|
||||
|
||||
(defn background
|
||||
[override-theme]
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-95 override-theme)
|
||||
:flex 1
|
||||
:border-top-left-radius border-radius
|
||||
:border-top-right-radius border-radius})
|
||||
@@ -1,240 +0,0 @@
|
||||
(ns legacy.status-im.bottom-sheet.view
|
||||
(:require
|
||||
[legacy.status-im.bottom-sheet.styles :as styles]
|
||||
[oops.core :refer [oget]]
|
||||
[re-frame.core :as re-frame]
|
||||
[react-native.background-timer :as timer]
|
||||
[react-native.core :as react]
|
||||
[react-native.core :as rn]
|
||||
[react-native.gesture :as gesture]
|
||||
[react-native.hooks :as hooks]
|
||||
[react-native.platform :as platform]
|
||||
[react-native.reanimated :as reanimated]
|
||||
[react-native.safe-area :as safe-area]
|
||||
[reagent.core :as reagent]
|
||||
[utils.worklets.bottom-sheet :as worklets.bottom-sheet]))
|
||||
|
||||
(def animation-delay 450)
|
||||
|
||||
(defn with-animation
|
||||
[value]
|
||||
(reanimated/with-spring
|
||||
value
|
||||
(clj->js {:mass 2
|
||||
:stiffness 500
|
||||
:damping 200})))
|
||||
|
||||
(defn get-bottom-sheet-gesture
|
||||
[pan-y translate-y bg-height bg-height-expanded
|
||||
window-height keyboard-shown disable-drag? expandable?
|
||||
show-bottom-sheet? expanded? close-bottom-sheet gesture-running?]
|
||||
(-> (gesture/gesture-pan)
|
||||
(gesture/on-start
|
||||
(fn [_]
|
||||
(reset! gesture-running? true)
|
||||
(when (and keyboard-shown (not disable-drag?) show-bottom-sheet?)
|
||||
(re-frame/dispatch [:dismiss-keyboard]))))
|
||||
(gesture/on-update
|
||||
(fn [evt]
|
||||
(when (and (not disable-drag?) show-bottom-sheet?)
|
||||
(let [max-pan-up (if (or @expanded? (not expandable?))
|
||||
0
|
||||
(- (- bg-height-expanded bg-height)))
|
||||
max-pan-down (if @expanded?
|
||||
bg-height-expanded
|
||||
bg-height)]
|
||||
(reanimated/set-shared-value pan-y
|
||||
(max
|
||||
(min
|
||||
(.-translationY evt)
|
||||
max-pan-down)
|
||||
max-pan-up))))))
|
||||
(gesture/on-end
|
||||
(fn [_]
|
||||
(reset! gesture-running? false)
|
||||
(when (and (not disable-drag?) show-bottom-sheet?)
|
||||
(let [end-pan-y (- window-height (.-value translate-y))
|
||||
expand-threshold (min (* bg-height 1.1) (+ bg-height 50))
|
||||
collapse-threshold (max (* bg-height-expanded 0.9) (- bg-height-expanded 50))
|
||||
should-close-bottom-sheet? (< end-pan-y (max (* bg-height 0.7) 50))]
|
||||
(cond
|
||||
should-close-bottom-sheet?
|
||||
(close-bottom-sheet)
|
||||
|
||||
(and (not @expanded?) (> end-pan-y expand-threshold))
|
||||
(reset! expanded? true)
|
||||
|
||||
(and @expanded? (< end-pan-y collapse-threshold))
|
||||
(reset! expanded? false))))))))
|
||||
|
||||
(defn handle-view
|
||||
[window-width override-theme]
|
||||
[rn/view
|
||||
{:style {:width window-width
|
||||
:position :absolute
|
||||
:background-color :transparent
|
||||
:top 0
|
||||
:height 20}}
|
||||
[rn/view {:style (styles/handle override-theme)}]])
|
||||
|
||||
(defn bottom-sheet
|
||||
[props children]
|
||||
(let [{on-cancel :on-cancel
|
||||
disable-drag? :disable-drag?
|
||||
show-handle? :show-handle?
|
||||
visible? :visible?
|
||||
backdrop-dismiss? :backdrop-dismiss?
|
||||
expandable? :expandable?
|
||||
bottom-safe-area-spacing? :bottom-safe-area-spacing?
|
||||
selected-item :selected-item
|
||||
is-initially-expanded? :expanded?
|
||||
override-theme :override-theme
|
||||
:or {show-handle? true
|
||||
backdrop-dismiss? true
|
||||
expandable? false
|
||||
bottom-safe-area-spacing? true
|
||||
is-initially-expanded? false}}
|
||||
props
|
||||
content-height (reagent/atom nil)
|
||||
show-bottom-sheet? (reagent/atom nil)
|
||||
keyboard-was-shown? (reagent/atom false)
|
||||
expanded? (reagent/atom is-initially-expanded?)
|
||||
gesture-running? (reagent/atom false)
|
||||
reset-atoms (fn []
|
||||
(reset! show-bottom-sheet? nil)
|
||||
(reset! content-height nil)
|
||||
(reset! expanded? false)
|
||||
(reset! keyboard-was-shown? false)
|
||||
(reset! gesture-running? false))
|
||||
close-bottom-sheet (fn []
|
||||
(reset! show-bottom-sheet? false)
|
||||
(when (fn? on-cancel) (on-cancel))
|
||||
(timer/set-timeout
|
||||
#(do
|
||||
(re-frame/dispatch [:bottom-sheet/hide-old-navigation-overlay])
|
||||
(reset-atoms))
|
||||
animation-delay))]
|
||||
[:f>
|
||||
(fn []
|
||||
(let [{height :height
|
||||
window-width :width}
|
||||
(rn/get-window)
|
||||
window-height (if selected-item (- height 72) height)
|
||||
{:keys [keyboard-shown]} (hooks/use-keyboard)
|
||||
insets (safe-area/get-insets)
|
||||
bg-height-expanded (- window-height (:top insets))
|
||||
bg-height (max (min @content-height bg-height-expanded) 109)
|
||||
bottom-sheet-dy (reanimated/use-shared-value 0)
|
||||
pan-y (reanimated/use-shared-value 0)
|
||||
translate-y (worklets.bottom-sheet/use-translate-y window-height bottom-sheet-dy pan-y)
|
||||
bg-opacity
|
||||
(worklets.bottom-sheet/use-background-opacity translate-y bg-height window-height 0.7)
|
||||
on-content-layout (fn [evt]
|
||||
(let [height (oget evt "nativeEvent" "layout" "height")]
|
||||
(reset! content-height height)))
|
||||
on-expanded (fn []
|
||||
(reanimated/set-shared-value bottom-sheet-dy bg-height-expanded)
|
||||
(reanimated/set-shared-value pan-y 0))
|
||||
on-collapsed (fn []
|
||||
(reanimated/set-shared-value bottom-sheet-dy bg-height)
|
||||
(reanimated/set-shared-value pan-y 0))
|
||||
bottom-sheet-gesture (get-bottom-sheet-gesture
|
||||
pan-y
|
||||
translate-y
|
||||
bg-height
|
||||
bg-height-expanded
|
||||
window-height
|
||||
keyboard-shown
|
||||
disable-drag?
|
||||
expandable?
|
||||
show-bottom-sheet?
|
||||
expanded?
|
||||
close-bottom-sheet
|
||||
gesture-running?)
|
||||
handle-comp [gesture/gesture-detector {:gesture bottom-sheet-gesture}
|
||||
[handle-view window-width override-theme]]]
|
||||
|
||||
(react/use-effect #(do
|
||||
(cond
|
||||
(and
|
||||
(nil? @show-bottom-sheet?)
|
||||
visible?
|
||||
(some? @content-height)
|
||||
(> @content-height 0))
|
||||
(reset! show-bottom-sheet? true)
|
||||
|
||||
(and @show-bottom-sheet? (not visible?))
|
||||
(close-bottom-sheet)))
|
||||
[@show-bottom-sheet? @content-height visible?])
|
||||
(react/use-effect #(do
|
||||
(when @show-bottom-sheet?
|
||||
(cond
|
||||
keyboard-shown
|
||||
(do
|
||||
(reset! keyboard-was-shown? true)
|
||||
(reset! expanded? true))
|
||||
(and @keyboard-was-shown? (not keyboard-shown))
|
||||
(reset! expanded? false))))
|
||||
[@show-bottom-sheet? @keyboard-was-shown? keyboard-shown])
|
||||
(react/use-effect #(do
|
||||
(when-not @gesture-running?
|
||||
(cond
|
||||
@show-bottom-sheet?
|
||||
(if @expanded?
|
||||
(do
|
||||
(reanimated/set-shared-value
|
||||
bottom-sheet-dy
|
||||
(with-animation (+ bg-height-expanded (.-value pan-y))))
|
||||
;; Workaround for
|
||||
;; https://github.com/software-mansion/react-native-reanimated/issues/1758#issue-817145741
|
||||
;; withTiming/withSpring callback not working on-expanded
|
||||
;; should be called as a callback of with-animation instead,
|
||||
;; once this issue has been resolved
|
||||
(timer/set-timeout on-expanded animation-delay))
|
||||
(do
|
||||
(reanimated/set-shared-value
|
||||
bottom-sheet-dy
|
||||
(with-animation (+ bg-height (.-value pan-y))))
|
||||
;; Workaround for
|
||||
;; https://github.com/software-mansion/react-native-reanimated/issues/1758#issue-817145741
|
||||
;; withTiming/withSpring callback not working on-collapsed
|
||||
;; should be called as a callback of with-animation instead,
|
||||
;; once this issue has been resolved
|
||||
(timer/set-timeout on-collapsed animation-delay)))
|
||||
|
||||
(= @show-bottom-sheet? false)
|
||||
(reanimated/set-shared-value bottom-sheet-dy (with-animation 0)))))
|
||||
[@show-bottom-sheet? @expanded? @gesture-running?])
|
||||
|
||||
[:<>
|
||||
[rn/pressable
|
||||
{:on-press (when backdrop-dismiss? close-bottom-sheet)
|
||||
:style styles/backdrop}
|
||||
[reanimated/view
|
||||
{:style (reanimated/apply-animations-to-style
|
||||
{:opacity bg-opacity}
|
||||
styles/backdrop-color)}]]
|
||||
(cond->> [reanimated/view
|
||||
{:style (reanimated/apply-animations-to-style
|
||||
{:transform [{:translateY translate-y}]}
|
||||
{:width window-width
|
||||
:height window-height})}
|
||||
[rn/view {:style styles/container}
|
||||
(when selected-item
|
||||
[rn/view {:style (styles/selected-background override-theme)}
|
||||
[selected-item]])
|
||||
[rn/view {:style (styles/background override-theme)}
|
||||
[rn/keyboard-avoiding-view
|
||||
{:behaviour (if platform/ios? :padding :height)
|
||||
:style {:flex 1}}
|
||||
[rn/view
|
||||
{:style (styles/content-style insets bottom-safe-area-spacing?)
|
||||
:on-layout (when-not (and
|
||||
(some? @content-height)
|
||||
(> @content-height 0))
|
||||
on-content-layout)}
|
||||
children]]
|
||||
(when show-handle?
|
||||
handle-comp)]]]
|
||||
(not show-handle?)
|
||||
(conj [gesture/gesture-detector {:gesture bottom-sheet-gesture}]))]))]))
|
||||
@@ -2,7 +2,6 @@
|
||||
(:require
|
||||
["eth-phishing-detect" :as eth-phishing-detect]
|
||||
[clojure.string :as string]
|
||||
[legacy.status-im.bottom-sheet.events :as bottom-sheet]
|
||||
[legacy.status-im.browser.permissions :as browser.permissions]
|
||||
[legacy.status-im.browser.webview-ref :as webview-ref]
|
||||
[legacy.status-im.ethereum.ens :as ens]
|
||||
@@ -519,7 +518,7 @@
|
||||
[{:keys [db] :as cofx} address]
|
||||
(rf/merge cofx
|
||||
{:browser/clear-web-data nil}
|
||||
(bottom-sheet/hide-bottom-sheet-old)
|
||||
(navigation/hide-bottom-sheet)
|
||||
(browser.permissions/clear-dapps-permissions)
|
||||
(multiaccounts.update/multiaccount-update :dapps-address address {})
|
||||
#(when (= (:view-id db) :browser)
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
(ns legacy.status-im.communities.core
|
||||
(:require
|
||||
[clojure.set :as set]
|
||||
[legacy.status-im.bottom-sheet.events :as bottom-sheet]
|
||||
legacy.status-im.communities.e2e
|
||||
[re-frame.core :as re-frame]
|
||||
[status-im.contexts.shell.activity-center.events :as activity-center]
|
||||
@@ -34,18 +33,11 @@
|
||||
(navigation/navigate-back)
|
||||
(handle-response response-js)))
|
||||
|
||||
(re-frame/reg-event-fx ::member-banned
|
||||
(fn [{:keys [db]} [response-js]]
|
||||
{:db (assoc db :bottom-sheet/show? false)
|
||||
:fx [[:dismiss-bottom-sheet-overlay-old]
|
||||
[:sanitize-messages-and-process-response response-js]
|
||||
[:activity-center.notifications/fetch-unread-count]]}))
|
||||
|
||||
(rf/defn member-banned
|
||||
{:events [::member-banned]}
|
||||
[cofx response-js]
|
||||
(rf/merge cofx
|
||||
(bottom-sheet/hide-bottom-sheet-old)
|
||||
(navigation/hide-bottom-sheet)
|
||||
(handle-response response-js)
|
||||
(activity-center/notifications-fetch-unread-count)))
|
||||
|
||||
@@ -66,7 +58,7 @@
|
||||
{:events [::member-kicked]}
|
||||
[cofx response-js]
|
||||
(rf/merge cofx
|
||||
(bottom-sheet/hide-bottom-sheet-old)
|
||||
(navigation/hide-bottom-sheet)
|
||||
(handle-response response-js)))
|
||||
|
||||
(rf/defn member-kick
|
||||
@@ -100,7 +92,7 @@
|
||||
{:events [:community.member/role-updated]}
|
||||
[cofx response-js]
|
||||
(rf/merge cofx
|
||||
(bottom-sheet/hide-bottom-sheet-old)
|
||||
(navigation/hide-bottom-sheet)
|
||||
(handle-response response-js)))
|
||||
|
||||
(rf/defn add-role-to-member
|
||||
|
||||
@@ -3,7 +3,6 @@
|
||||
(:require
|
||||
[clojure.set :as set]
|
||||
[clojure.string :as string]
|
||||
[legacy.status-im.bottom-sheet.events :as bottom-sheet]
|
||||
[legacy.status-im.ethereum.ens :as ens]
|
||||
[legacy.status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
[legacy.status-im.utils.random :as random]
|
||||
@@ -288,7 +287,7 @@
|
||||
[{:keys [db] :as cofx} _ {:keys [address]}]
|
||||
(rf/merge cofx
|
||||
{:db (assoc-in db [:ens/registration :address] address)}
|
||||
(bottom-sheet/hide-bottom-sheet-old)))
|
||||
(navigation/hide-bottom-sheet)))
|
||||
|
||||
(rf/defn save-preferred-name
|
||||
{:events [::save-preferred-name]}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns legacy.status-im.mobile-sync-settings.core
|
||||
(:require
|
||||
[legacy.status-im.bottom-sheet.events :as bottom-sheet]
|
||||
[legacy.status-im.mailserver.core :as mailserver]
|
||||
[legacy.status-im.multiaccounts.model :as multiaccounts.model]
|
||||
[legacy.status-im.multiaccounts.update.core :as multiaccounts.update]
|
||||
@@ -31,7 +30,7 @@
|
||||
(assoc :mailserver/current-request true))
|
||||
:fx [(when fetch-historic-messages?
|
||||
[:mailserver/request-all-historic-messages])
|
||||
[:dismiss-bottom-sheet-overlay-old]
|
||||
[:dispatch [:hide-bottom-sheet]]
|
||||
(when previously-initialized?
|
||||
(let [new-identity-input (get-in db [:contacts/new-identity :input])]
|
||||
[:dispatch [:contacts/set-new-identity {:input new-identity-input}]]))]}
|
||||
@@ -101,10 +100,10 @@
|
||||
[cofx]
|
||||
(rf/merge
|
||||
cofx
|
||||
(bottom-sheet/hide-bottom-sheet-old)
|
||||
(navigation/hide-bottom-sheet)
|
||||
(navigation/navigate-to :mobile-network-settings nil)))
|
||||
|
||||
(rf/defn mobile-network-show-offline-sheet
|
||||
{:events [:mobile-network/show-offline-sheet]}
|
||||
[cofx]
|
||||
(bottom-sheet/hide-bottom-sheet-old cofx))
|
||||
(navigation/hide-bottom-sheet cofx))
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
:on-press #(re-frame/dispatch [:browser.ui/open-url url])
|
||||
:on-long-press (fn []
|
||||
(re-frame/dispatch
|
||||
[:bottom-sheet/show-sheet-old
|
||||
[:show-bottom-sheet
|
||||
{:content (fn []
|
||||
[react/view {:flex 1}
|
||||
[list.item/list-item
|
||||
@@ -110,7 +110,7 @@
|
||||
[quo/button
|
||||
{:accessibility-label :select-account
|
||||
:type :scale
|
||||
:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet-old
|
||||
:on-press #(re-frame/dispatch [:show-bottom-sheet
|
||||
{:content (accounts/accounts-list accounts
|
||||
dapps-account)}])}
|
||||
[react/view (styles/dapps-account color)
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
[icons/icon :main-icons/arrow-right {:color colors/black}]]
|
||||
[react/touchable-highlight
|
||||
{:accessibility-label :select-account
|
||||
:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet-old
|
||||
:on-press #(re-frame/dispatch [:show-bottom-sheet
|
||||
{:content (accounts/accounts-list accounts
|
||||
dapps-account)}])}
|
||||
[chat-icon/custom-icon-view-list (:name dapps-account) (:color dapps-account) 32]]
|
||||
@@ -108,7 +108,7 @@
|
||||
[icons/icon :main-icons/qr {:color colors/black}]]
|
||||
[react/touchable-highlight
|
||||
{:on-press #(re-frame/dispatch
|
||||
[:bottom-sheet/show-sheet-old
|
||||
[:show-bottom-sheet
|
||||
{:content (options/browser-options
|
||||
url
|
||||
dapps-account
|
||||
@@ -162,7 +162,7 @@
|
||||
(defn request-resources-access-for-page
|
||||
[resources url webview-ref]
|
||||
(re-frame/dispatch
|
||||
[:bottom-sheet/show-sheet-old
|
||||
[:show-bottom-sheet
|
||||
{:content (fn [] [request-resources-panel resources url webview-ref])
|
||||
:show-handle? false
|
||||
:backdrop-dismiss? false
|
||||
@@ -172,7 +172,7 @@
|
||||
(defn block-resources-access-and-notify-user
|
||||
[url]
|
||||
(.answerPermissionRequest ^js @webview-ref/webview-ref false)
|
||||
(re-frame/dispatch [:bottom-sheet/show-sheet-old
|
||||
(re-frame/dispatch [:show-bottom-sheet
|
||||
{:content (fn [] [block-resources-panel url])}]))
|
||||
|
||||
;; should-component-update is called only when component's props are changed,
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
:accessory (when (not= public-key my-public-key)
|
||||
[quo/button
|
||||
{:on-press
|
||||
#(rf/dispatch [:bottom-sheet/show-sheet-old
|
||||
#(rf/dispatch [:show-bottom-sheet
|
||||
{:content (fn []
|
||||
[member-sheet primary-name member community-id
|
||||
can-kick-users? can-manage-users? admin?])}])
|
||||
|
||||
@@ -757,7 +757,7 @@
|
||||
[profile.components/settings-item
|
||||
{:label-kw :ens-primary-username
|
||||
:value preferred-name
|
||||
:action-fn #(re-frame/dispatch [:bottom-sheet/show-sheet-old
|
||||
:action-fn #(re-frame/dispatch [:show-bottom-sheet
|
||||
{:content
|
||||
(fn [] (name-list names preferred-name))}])}]])]]])
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
(not= public-key current-user-identity))
|
||||
{:accessory [quo/button
|
||||
{:on-press #(re-frame/dispatch
|
||||
[:bottom-sheet/show-sheet-old
|
||||
[:bottom-sheet/show-sheet
|
||||
{:content (fn []
|
||||
[member-sheet chat-id member admin?])}])
|
||||
:type :icon
|
||||
@@ -146,7 +146,7 @@
|
||||
[list.item/list-item
|
||||
{:title (profile.utils/displayed-name contact)
|
||||
:icon [chat-icon/contact-icon-contacts-tab contact]
|
||||
:on-press #(re-frame/dispatch [:bottom-sheet/show-sheet-old
|
||||
:on-press #(re-frame/dispatch [:show-bottom-sheet
|
||||
{:content (fn []
|
||||
[invitation-sheet invitation contact])}])}]))
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@
|
||||
:use-insets true
|
||||
:extended-header (profile-header/extended-header
|
||||
{:on-press on-share
|
||||
:on-edit #(re-frame/dispatch [:bottom-sheet/show-sheet-old
|
||||
:on-edit #(re-frame/dispatch [:show-bottom-sheet
|
||||
{:content (edit/bottom-sheet
|
||||
has-picture)}])
|
||||
:color (user-avatar.style/customization-color customization-color
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
(:require
|
||||
[clojure.string :as string]
|
||||
[goog.string :as gstring]
|
||||
[legacy.status-im.bottom-sheet.events :as bottom-sheet]
|
||||
[legacy.status-im.ui.components.react :as react]
|
||||
[legacy.status-im.utils.build :as build]
|
||||
[legacy.status-im.utils.deprecated-types :as types]
|
||||
@@ -13,6 +12,7 @@
|
||||
[status-im.common.json-rpc.events :as json-rpc]
|
||||
[status-im.common.log :as log]
|
||||
[status-im.config :as config]
|
||||
[status-im.navigation.events :as navigation]
|
||||
[utils.datetime :as datetime]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
@@ -226,7 +226,7 @@
|
||||
{:db (assoc db :bug-report/description-error error)}
|
||||
(rf/merge
|
||||
cofx
|
||||
(bottom-sheet/hide-bottom-sheet-old)
|
||||
(navigation/hide-bottom-sheet)
|
||||
(send-logs :email))))
|
||||
|
||||
(re-frame/reg-fx
|
||||
@@ -254,5 +254,5 @@
|
||||
(rf/merge
|
||||
cofx
|
||||
{:db (dissoc db :bug-report/details)}
|
||||
(bottom-sheet/hide-bottom-sheet-old)
|
||||
(navigation/hide-bottom-sheet)
|
||||
(submit-issue)))
|
||||
|
||||
@@ -23,4 +23,4 @@
|
||||
[:<>
|
||||
[settings-item/view item]
|
||||
(when-not (= item (last settings-item))
|
||||
[rn/view {:style (style/settings-separator props)}])])]]))
|
||||
[rn/view {:style (style/settings-separator props theme)}])])]]))
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
{:margin-top 12})
|
||||
|
||||
(defn settings-separator
|
||||
[{:keys [blur? theme]}]
|
||||
[{:keys [blur?]} theme]
|
||||
{:height 1
|
||||
:background-color (if blur?
|
||||
colors/white-opa-5
|
||||
|
||||
@@ -116,6 +116,8 @@
|
||||
set-active-tab-id] (rn/use-state default-active)
|
||||
[fading set-fading] (rn/use-state fade-end-percentage)
|
||||
flat-list-ref (rn/use-ref-atom nil)
|
||||
tabs-data (rn/use-memo (fn [] (filterv some? data))
|
||||
[data])
|
||||
clean-props (dissoc props
|
||||
:default-active
|
||||
:fade-end-percentage
|
||||
@@ -142,8 +144,8 @@
|
||||
:index
|
||||
(utils.collection/first-index
|
||||
#(= active-tab-id (:id %))
|
||||
data)}))))
|
||||
[active-tab-id data])
|
||||
tabs-data)}))))
|
||||
[active-tab-id tabs-data])
|
||||
on-tab-press (rn/use-callback (fn [id index]
|
||||
(set-active-tab-id id)
|
||||
(when (and scroll-on-press? @flat-list-ref)
|
||||
@@ -175,7 +177,7 @@
|
||||
:horizontal true
|
||||
:scroll-event-throttle 64
|
||||
:shows-horizontal-scroll-indicator false
|
||||
:data data
|
||||
:data tabs-data
|
||||
:key-fn (comp str :id)
|
||||
:on-scroll-to-index-failed identity
|
||||
:on-scroll on-scroll
|
||||
@@ -184,7 +186,7 @@
|
||||
:render-data {:active-tab-id active-tab-id
|
||||
:blur? blur?
|
||||
:customization-color customization-color
|
||||
:number-of-items (count data)
|
||||
:number-of-items (count tabs-data)
|
||||
:size size
|
||||
:on-press on-tab-press
|
||||
:style style}})]]]
|
||||
@@ -195,8 +197,8 @@
|
||||
{:active-tab-id active-tab-id
|
||||
:blur? blur?
|
||||
:customization-color customization-color
|
||||
:number-of-items (count data)
|
||||
:number-of-items (count tabs-data)
|
||||
:size size
|
||||
:on-press on-tab-press
|
||||
:style style}])
|
||||
data)])))
|
||||
tabs-data)])))
|
||||
|
||||
@@ -5,9 +5,12 @@
|
||||
[:type {:optional true} [:enum :default-keypair :recovery-phrase :private-key]]
|
||||
[:stored {:optional true} [:enum :on-device :on-keycard]]])
|
||||
|
||||
(def ^:private ?keypair-name
|
||||
[:map
|
||||
[:keypair-name {:optional true} [:maybe :string]]])
|
||||
|
||||
(def ^:private ?default-keypair
|
||||
[:map
|
||||
[:user-name {:optional true} [:maybe :string]]
|
||||
[:profile-picture {:optional true} [:maybe :schema.common/image-source]]
|
||||
[:derivation-path {:optional true} [:maybe :string]]
|
||||
[:on-press {:optional true} [:maybe fn?]]
|
||||
@@ -23,7 +26,7 @@
|
||||
[:catn
|
||||
[:props
|
||||
[:multi {:dispatch :type}
|
||||
[:default-keypair [:merge ?base ?default-keypair]]
|
||||
[:recovery-phrase [:merge ?base ?recovery-phrase]]
|
||||
[:default-keypair [:merge ?base ?default-keypair ?keypair-name]]
|
||||
[:recovery-phrase [:merge ?base ?recovery-phrase ?keypair-name]]
|
||||
[:private-key ?base]]]]
|
||||
:any])
|
||||
|
||||
@@ -12,14 +12,14 @@
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
(defn- row-title
|
||||
[type user-name]
|
||||
[type keypair-name]
|
||||
[text/text
|
||||
{:weight :medium
|
||||
:size :paragraph-1}
|
||||
(case type
|
||||
:default-keypair (i18n/label :t/user-keypair {:name user-name})
|
||||
:default-keypair (i18n/label :t/user-keypair {:name keypair-name})
|
||||
:derivation-path (i18n/label :t/derivation-path)
|
||||
(i18n/label :t/trip-accounts))])
|
||||
keypair-name)])
|
||||
|
||||
(defn- row-icon
|
||||
[customization-color profile-picture type secondary-color]
|
||||
@@ -72,7 +72,7 @@
|
||||
{:color secondary-color}]])])
|
||||
|
||||
(defn- list-view
|
||||
[{:keys [type stored customization-color profile-picture user-name theme secondary-color]}]
|
||||
[{:keys [type stored customization-color profile-picture keypair-name theme secondary-color]}]
|
||||
(let [stored-name (if (= :on-device stored)
|
||||
(i18n/label :t/on-device)
|
||||
(i18n/label :t/on-keycard))]
|
||||
@@ -81,7 +81,7 @@
|
||||
:stored stored
|
||||
:customization-color customization-color
|
||||
:profile-picture profile-picture
|
||||
:title user-name
|
||||
:title keypair-name
|
||||
:subtitle stored-name
|
||||
:theme theme
|
||||
:secondary-color secondary-color}]))
|
||||
|
||||
@@ -20,16 +20,27 @@
|
||||
:right 0
|
||||
:height (+ top-margin messages.constants/header-container-radius)}))
|
||||
|
||||
(defn header-bottom-part
|
||||
[bottom theme top-margin]
|
||||
(defn header-bottom-container
|
||||
[bottom top-margin]
|
||||
(reanimated/apply-animations-to-style
|
||||
{:bottom bottom}
|
||||
(merge
|
||||
(shadows/get 2 theme :inverted)
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-95 theme)
|
||||
:padding-horizontal 20
|
||||
:border-radius 20
|
||||
:margin-top top-margin})))
|
||||
{:margin-top top-margin}))
|
||||
|
||||
(defn header-bottom-part
|
||||
[theme]
|
||||
{:background-color (colors/theme-colors colors/white colors/neutral-95 theme)
|
||||
:padding-horizontal 20
|
||||
:border-radius 20})
|
||||
|
||||
(defn header-bottom-shadow
|
||||
[theme]
|
||||
(assoc
|
||||
(shadows/get 2 theme :inverted)
|
||||
:left 0
|
||||
:right 0
|
||||
:height 40
|
||||
:position :absolute
|
||||
:border-radius 20))
|
||||
|
||||
(defn header-image
|
||||
[scale top left theme]
|
||||
|
||||
@@ -234,7 +234,9 @@
|
||||
online? (rf/sub [:visibility-status-updates/online? chat-id])
|
||||
contact (when-not group-chat
|
||||
(rf/sub [:contacts/contact-by-address chat-id]))
|
||||
photo-path (rf/sub [:chats/photo-path chat-id])
|
||||
photo-path (if group-chat
|
||||
(rf/sub [:chats/group-chat-image chat-id])
|
||||
(rf/sub [:chats/photo-path chat-id]))
|
||||
top-margin (+ (safe-area/get-top)
|
||||
messages.constants/top-bar-height
|
||||
messages.constants/header-container-top-margin
|
||||
@@ -258,33 +260,35 @@
|
||||
[:<>
|
||||
[reanimated/view
|
||||
{:style (style/background-container background-color background-opacity top-margin)}]
|
||||
[reanimated/view {:style (style/header-bottom-part bottom theme top-margin)}
|
||||
[list-footer-avatar
|
||||
{:distance-from-list-top distance-from-list-top
|
||||
:display-name display-name
|
||||
:online? online?
|
||||
:theme theme
|
||||
:profile-picture photo-path
|
||||
:group-chat group-chat
|
||||
:color color
|
||||
:emoji emoji
|
||||
:chat-type chat-type
|
||||
:chat-name chat-name
|
||||
:last-message last-message}]
|
||||
[chat-display-name
|
||||
{:distance-from-list-top distance-from-list-top
|
||||
:display-name display-name
|
||||
:theme theme
|
||||
:contact contact
|
||||
:group-chat group-chat
|
||||
:last-message last-message}]
|
||||
[bio-and-actions
|
||||
{:distance-from-list-top distance-from-list-top
|
||||
:bio bio
|
||||
:chat-id chat-id
|
||||
:customization-color customization-color
|
||||
:description description
|
||||
:last-message last-message}]]]))
|
||||
[reanimated/view {:style (style/header-bottom-container bottom top-margin)}
|
||||
[rn/view {:style (style/header-bottom-shadow theme)}]
|
||||
[rn/view {:style (style/header-bottom-part theme)}
|
||||
[list-footer-avatar
|
||||
{:distance-from-list-top distance-from-list-top
|
||||
:display-name display-name
|
||||
:online? online?
|
||||
:theme theme
|
||||
:profile-picture photo-path
|
||||
:group-chat group-chat
|
||||
:color color
|
||||
:emoji emoji
|
||||
:chat-type chat-type
|
||||
:chat-name chat-name
|
||||
:last-message last-message}]
|
||||
[chat-display-name
|
||||
{:distance-from-list-top distance-from-list-top
|
||||
:display-name display-name
|
||||
:theme theme
|
||||
:contact contact
|
||||
:group-chat group-chat
|
||||
:last-message last-message}]
|
||||
[bio-and-actions
|
||||
{:distance-from-list-top distance-from-list-top
|
||||
:bio bio
|
||||
:chat-id chat-id
|
||||
:customization-color customization-color
|
||||
:description description
|
||||
:last-message last-message}]]]]))
|
||||
|
||||
(defn list-footer
|
||||
[props]
|
||||
|
||||
@@ -34,7 +34,9 @@
|
||||
(str "# " chat-name)
|
||||
:else (str emoji chat-name))
|
||||
online? (when-not group-chat (rf/sub [:visibility-status-updates/online? chat-id]))
|
||||
photo-path (when-not group-chat (rf/sub [:chats/photo-path chat-id]))
|
||||
photo-path (if group-chat
|
||||
(rf/sub [:chats/group-chat-image chat-id])
|
||||
(rf/sub [:chats/photo-path chat-id]))
|
||||
header-opacity (worklets/navigation-header-opacity
|
||||
distance-from-list-top
|
||||
all-loaded?
|
||||
@@ -118,7 +120,7 @@
|
||||
|
||||
(defn view
|
||||
[{:keys [distance-from-list-top chat-screen-layout-calculations-complete?]}]
|
||||
(let [{:keys [chat-id chat-type last-message]
|
||||
(let [{:keys [chat-id chat-type]
|
||||
:as chat} (rf/sub [:chats/current-chat-chat-view])
|
||||
all-loaded? (reanimated/use-shared-value false)
|
||||
all-loaded-sub (rf/sub [:chats/all-loaded? chat-id])
|
||||
@@ -135,12 +137,11 @@
|
||||
[all-loaded-sub])
|
||||
[rn/view
|
||||
{:style (style/navigation-view navigation-view-height messages.constants/pinned-banner-height)}
|
||||
(when (seq last-message)
|
||||
[animated-background-and-pinned-banner
|
||||
{:chat-id chat-id
|
||||
:navigation-view-height navigation-view-height
|
||||
:distance-from-list-top distance-from-list-top
|
||||
:all-loaded? all-loaded?}])
|
||||
[animated-background-and-pinned-banner
|
||||
{:chat-id chat-id
|
||||
:navigation-view-height navigation-view-height
|
||||
:distance-from-list-top distance-from-list-top
|
||||
:all-loaded? all-loaded?}]
|
||||
[rn/view {:style (style/header-container top-insets top-bar-height)}
|
||||
[reanimated/view {:style (style/button-animation-container navigation-buttons-opacity)}
|
||||
[quo/button
|
||||
|
||||
@@ -35,7 +35,11 @@
|
||||
:accessibility-label :enable-biometrics-button
|
||||
:icon-left :i/face-id
|
||||
:customization-color profile-color
|
||||
:on-press #(rf/dispatch [:onboarding/enable-biometrics])}
|
||||
:on-press (fn []
|
||||
(rf/dispatch [:biometric/authenticate
|
||||
{:on-success #(rf/dispatch [:onboarding/biometrics-done])
|
||||
:on-fail #(rf/dispatch [:biometric/show-message
|
||||
(ex-cause %)])}]))}
|
||||
(i18n/label :t/biometric-enable-button {:bio-type-label bio-type-label})]
|
||||
[quo/button
|
||||
{:accessibility-label :maybe-later-button
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
[re-frame.core :as re-frame]
|
||||
status-im.common.biometric.events
|
||||
[status-im.constants :as constants]
|
||||
[status-im.contexts.profile.create.events :as profile.create]
|
||||
[status-im.contexts.profile.recover.events :as profile.recover]
|
||||
[status-im.contexts.profile.utils :as profile.utils]
|
||||
[taoensso.timbre :as log]
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]
|
||||
@@ -23,157 +22,161 @@
|
||||
(when on-error (on-error error))
|
||||
(on-success mnemonic keyUID)))))))
|
||||
|
||||
(rf/defn profile-data-set
|
||||
{:events [:onboarding/profile-data-set]}
|
||||
[{:keys [db]} onboarding-data]
|
||||
{:db (update db :onboarding/profile merge onboarding-data)
|
||||
:dispatch [:navigate-to-within-stack
|
||||
[:screen/onboarding.create-profile-password :screen/onboarding.new-to-status]]})
|
||||
|
||||
(rf/defn enable-biometrics
|
||||
{:events [:onboarding/enable-biometrics]}
|
||||
[_]
|
||||
{:fx [[:dispatch
|
||||
[:biometric/authenticate
|
||||
{:on-success #(rf/dispatch [:onboarding/biometrics-done])
|
||||
:on-fail #(rf/dispatch [:onboarding/biometrics-fail %])}]]]})
|
||||
|
||||
(rf/defn navigate-to-enable-notifications
|
||||
{:events [:onboarding/navigate-to-enable-notifications]}
|
||||
[{:keys [db]}]
|
||||
(let [key-uid (get-in db [:profile/profile :key-uid])]
|
||||
{:db (dissoc db :onboarding/profile)
|
||||
:dispatch [:navigate-to-within-stack
|
||||
[:screen/onboarding.enable-notifications :screen/onboarding.enable-biometrics]]}))
|
||||
|
||||
(rf/defn biometrics-done
|
||||
{:events [:onboarding/biometrics-done]}
|
||||
[{:keys [db]}]
|
||||
(let [syncing? (get-in db [:onboarding/profile :syncing?])]
|
||||
{:db (assoc-in db [:onboarding/profile :auth-method] constants/auth-method-biometric)
|
||||
:dispatch (if syncing?
|
||||
[:onboarding/finalize-setup]
|
||||
[:onboarding/create-account-and-login])}))
|
||||
(rf/reg-event-fx
|
||||
:onboarding/profile-data-set
|
||||
(fn [{:keys [db]} [onboarding-data]]
|
||||
{:db (update db :onboarding/profile merge onboarding-data)
|
||||
:fx [[:dispatch
|
||||
[:navigate-to-within-stack
|
||||
[:screen/onboarding.create-profile-password :screen/onboarding.new-to-status]]]]}))
|
||||
|
||||
(rf/reg-event-fx
|
||||
:onboarding/biometrics-fail
|
||||
(fn [_ [error]]
|
||||
{:dispatch [:biometric/show-message (ex-cause error)]}))
|
||||
:onboarding/navigate-to-enable-notifications
|
||||
(fn [{:keys [db]}]
|
||||
{:db (dissoc db :onboarding/profile)
|
||||
:fx [[:dispatch
|
||||
[:navigate-to-within-stack
|
||||
[:screen/onboarding.enable-notifications :screen/onboarding.enable-biometrics]]]]}))
|
||||
|
||||
(rf/defn create-account-and-login
|
||||
{:events [:onboarding/create-account-and-login]}
|
||||
[{:keys [db] :as cofx}]
|
||||
(let [{:keys [display-name seed-phrase password image-path color] :as profile}
|
||||
(:onboarding/profile db)]
|
||||
(rf/merge cofx
|
||||
{:dispatch [:navigate-to-within-stack
|
||||
[:screen/onboarding.generating-keys :screen/onboarding.new-to-status]]
|
||||
:dispatch-later [{:ms constants/onboarding-generating-keys-animation-duration-ms
|
||||
:dispatch [:onboarding/navigate-to-identifiers]}]
|
||||
:db (-> db
|
||||
(dissoc :profile/login)
|
||||
(dissoc :auth-method)
|
||||
(assoc :onboarding/new-account? true))}
|
||||
(if seed-phrase
|
||||
(profile.recover/recover-profile-and-login profile)
|
||||
(profile.create/create-profile-and-login profile)))))
|
||||
(rf/reg-event-fx
|
||||
:onboarding/biometrics-done
|
||||
(fn [{:keys [db]}]
|
||||
(let [syncing? (get-in db [:onboarding/profile :syncing?])]
|
||||
{:db (assoc-in db [:onboarding/profile :auth-method] constants/auth-method-biometric)
|
||||
:fx [[:dispatch
|
||||
(if syncing?
|
||||
[:onboarding/finalize-setup]
|
||||
[:onboarding/create-account-and-login])]]})))
|
||||
|
||||
(rf/defn on-delete-profile-success
|
||||
{:events [:onboarding/on-delete-profile-success]}
|
||||
[{:keys [db]} key-uid]
|
||||
(let [multiaccounts (dissoc (:profile/profiles-overview db) key-uid)]
|
||||
(merge
|
||||
{:db (assoc db :profile/profiles-overview multiaccounts)}
|
||||
(when-not (seq multiaccounts)
|
||||
{:set-root :screen/onboarding.intro}))))
|
||||
(rf/reg-event-fx
|
||||
:onboarding/create-account-and-login
|
||||
(fn [{:keys [db]}]
|
||||
(let [{:keys [seed-phrase] :as profile} (:onboarding/profile db)
|
||||
restore? (boolean seed-phrase)
|
||||
{:keys [password] :as profile} (profile.utils/create-profile-config profile restore?)]
|
||||
(cond-> {:fx [[:dispatch
|
||||
[:navigate-to-within-stack
|
||||
[:screen/onboarding.generating-keys :screen/onboarding.new-to-status]]]
|
||||
[:dispatch-later
|
||||
[{:ms constants/onboarding-generating-keys-animation-duration-ms
|
||||
:dispatch [:onboarding/navigate-to-identifiers]}]]]
|
||||
:db (-> db
|
||||
(dissoc :profile/login)
|
||||
(dissoc :auth-method)
|
||||
(assoc :onboarding/new-account? true)
|
||||
(assoc-in [:syncing :login-sha3-password] password))}
|
||||
|
||||
(rf/defn password-set
|
||||
{:events [:onboarding/password-set]}
|
||||
[{:keys [db]} password]
|
||||
(let [supported-type (get-in db [:biometrics :supported-type])]
|
||||
{:db (-> db
|
||||
(assoc-in [:onboarding/profile :password] password)
|
||||
(assoc-in [:onboarding/profile :auth-method] constants/auth-method-password))
|
||||
:dispatch (if supported-type
|
||||
[:navigate-to-within-stack
|
||||
[:screen/onboarding.enable-biometrics :screen/onboarding.new-to-status]]
|
||||
[:onboarding/create-account-and-login])}))
|
||||
restore?
|
||||
(assoc-in [:db :onboarding/recovered-account?] true)
|
||||
|
||||
(rf/defn navigate-to-enable-biometrics
|
||||
{:events [:onboarding/navigate-to-enable-biometrics]}
|
||||
[{:keys [db]}]
|
||||
(let [supported-type (get-in db [:biometrics :supported-type])]
|
||||
{:dispatch (if supported-type
|
||||
[:open-modal :screen/onboarding.enable-biometrics]
|
||||
[:open-modal :screen/onboarding.enable-notifications])}))
|
||||
restore?
|
||||
(assoc :effects.profile/restore-and-login profile)
|
||||
|
||||
(rf/defn seed-phrase-entered
|
||||
{:events [:onboarding/seed-phrase-entered]}
|
||||
[_ seed-phrase on-error]
|
||||
{:multiaccount/validate-mnemonic [seed-phrase
|
||||
(fn [mnemonic key-uid]
|
||||
(re-frame/dispatch [:onboarding/seed-phrase-validated
|
||||
mnemonic key-uid]))
|
||||
on-error]})
|
||||
(not restore?)
|
||||
(assoc :effects.profile/create-and-login profile)))))
|
||||
|
||||
(rf/defn seed-phrase-validated
|
||||
{:events [:onboarding/seed-phrase-validated]}
|
||||
[{:keys [db]} seed-phrase key-uid]
|
||||
(if (contains? (:profile/profiles-overview db) key-uid)
|
||||
{:effects.utils/show-confirmation
|
||||
{:title (i18n/label :t/multiaccount-exists-title)
|
||||
:content (i18n/label :t/multiaccount-exists-content)
|
||||
:confirm-button-text (i18n/label :t/unlock)
|
||||
:on-accept (fn []
|
||||
(re-frame/dispatch [:pop-to-root :screen/profile.profiles])
|
||||
(re-frame/dispatch
|
||||
[:profile/profile-selected key-uid]))
|
||||
:on-cancel #(re-frame/dispatch [:pop-to-root :multiaccounts])}}
|
||||
{:db (assoc-in db [:onboarding/profile :seed-phrase] seed-phrase)
|
||||
:dispatch [:navigate-to-within-stack
|
||||
[:screen/onboarding.create-profile :screen/onboarding.new-to-status]]}))
|
||||
(rf/reg-event-fx
|
||||
:onboarding/on-delete-profile-success
|
||||
(fn [{:keys [db]} [key-uid]]
|
||||
(let [multiaccounts (dissoc (:profile/profiles-overview db) key-uid)]
|
||||
(merge
|
||||
{:db (assoc db :profile/profiles-overview multiaccounts)}
|
||||
(when-not (seq multiaccounts)
|
||||
{:set-root :screen/onboarding.intro})))))
|
||||
|
||||
(rf/defn navigate-to-create-profile
|
||||
{:events [:onboarding/navigate-to-create-profile]}
|
||||
[{:keys [db]}]
|
||||
;; Restart the flow
|
||||
{:db (dissoc db :onboarding/profile)
|
||||
:dispatch [:navigate-to-within-stack
|
||||
[:screen/onboarding.create-profile :screen/onboarding.new-to-status]]})
|
||||
(rf/reg-event-fx
|
||||
:onboarding/password-set
|
||||
(fn [{:keys [db]} [password]]
|
||||
(let [supported-type (get-in db [:biometrics :supported-type])]
|
||||
{:db (-> db
|
||||
(assoc-in [:onboarding/profile :password] password)
|
||||
(assoc-in [:onboarding/profile :auth-method] constants/auth-method-password))
|
||||
:fx [[:dispatch
|
||||
(if supported-type
|
||||
[:navigate-to-within-stack
|
||||
[:screen/onboarding.enable-biometrics :screen/onboarding.new-to-status]]
|
||||
[:onboarding/create-account-and-login])]]})))
|
||||
|
||||
(rf/reg-event-fx :onboarding/set-auth-method
|
||||
(rf/reg-event-fx
|
||||
:onboarding/navigate-to-enable-biometrics
|
||||
(fn [{:keys [db]}]
|
||||
(let [supported-type (get-in db [:biometrics :supported-type])]
|
||||
{:fx [[:dispatch
|
||||
(if supported-type
|
||||
[:open-modal :screen/onboarding.enable-biometrics]
|
||||
[:open-modal :screen/onboarding.enable-notifications])]]})))
|
||||
|
||||
(rf/reg-event-fx
|
||||
:onboarding/seed-phrase-entered
|
||||
(fn [_ [seed-phrase on-error]]
|
||||
{:multiaccount/validate-mnemonic [seed-phrase
|
||||
(fn [mnemonic key-uid]
|
||||
(rf/dispatch [:onboarding/seed-phrase-validated
|
||||
mnemonic key-uid]))
|
||||
on-error]}))
|
||||
|
||||
(rf/reg-event-fx
|
||||
:onboarding/seed-phrase-validated
|
||||
(fn [{:keys [db]} [seed-phrase key-uid]]
|
||||
(if (contains? (:profile/profiles-overview db) key-uid)
|
||||
{:effects.utils/show-confirmation
|
||||
{:title (i18n/label :t/multiaccount-exists-title)
|
||||
:content (i18n/label :t/multiaccount-exists-content)
|
||||
:confirm-button-text (i18n/label :t/unlock)
|
||||
:on-accept (fn []
|
||||
(re-frame/dispatch [:pop-to-root :screen/profile.profiles])
|
||||
(re-frame/dispatch
|
||||
[:profile/profile-selected key-uid]))
|
||||
:on-cancel #(re-frame/dispatch [:pop-to-root :multiaccounts])}}
|
||||
{:db (assoc-in db [:onboarding/profile :seed-phrase] seed-phrase)
|
||||
:fx [[:dispatch
|
||||
[:navigate-to-within-stack
|
||||
[:screen/onboarding.create-profile :screen/onboarding.new-to-status]]]]})))
|
||||
|
||||
(rf/reg-event-fx
|
||||
:onboarding/navigate-to-create-profile
|
||||
(fn [{:keys [db]}]
|
||||
{:db (dissoc db :onboarding/profile)
|
||||
:fx [[:dispatch
|
||||
[:navigate-to-within-stack
|
||||
[:screen/onboarding.create-profile :screen/onboarding.new-to-status]]]]}))
|
||||
|
||||
(rf/reg-event-fx
|
||||
:onboarding/set-auth-method
|
||||
(fn [{:keys [db]} [auth-method]]
|
||||
{:db (assoc db :auth-method auth-method)}))
|
||||
|
||||
(rf/defn onboarding-new-account-finalize-setup
|
||||
{:events [:onboarding/finalize-setup]}
|
||||
[{:keys [db]}]
|
||||
(let [masked-password (get-in db [:onboarding/profile :password])
|
||||
key-uid (get-in db [:profile/profile :key-uid])
|
||||
syncing? (get-in db [:onboarding/profile :syncing?])
|
||||
auth-method (get-in db [:onboarding/profile :auth-method])
|
||||
biometric-enabled? (= auth-method
|
||||
constants/auth-method-biometric)]
|
||||
(cond-> {:db (assoc db :onboarding/generated-keys? true)}
|
||||
biometric-enabled?
|
||||
(assoc :keychain/save-password-and-auth-method
|
||||
{:key-uid key-uid
|
||||
:masked-password (if syncing?
|
||||
masked-password
|
||||
(security/hash-masked-password masked-password))
|
||||
:on-success (fn []
|
||||
(rf/dispatch [:onboarding/set-auth-method auth-method])
|
||||
(when syncing?
|
||||
(rf/dispatch [:onboarding/navigate-to-enable-notifications])))
|
||||
:on-error #(log/error "failed to save biometrics"
|
||||
{:key-uid key-uid
|
||||
:error %})}))))
|
||||
(rf/reg-event-fx
|
||||
:onboarding/finalize-setup
|
||||
(fn [{:keys [db]}]
|
||||
(let [masked-password (get-in db [:onboarding/profile :password])
|
||||
key-uid (get-in db [:profile/profile :key-uid])
|
||||
syncing? (get-in db [:onboarding/profile :syncing?])
|
||||
auth-method (get-in db [:onboarding/profile :auth-method])
|
||||
biometric-enabled? (= auth-method
|
||||
constants/auth-method-biometric)]
|
||||
(cond-> {:db (assoc db :onboarding/generated-keys? true)}
|
||||
biometric-enabled?
|
||||
(assoc :keychain/save-password-and-auth-method
|
||||
{:key-uid key-uid
|
||||
:masked-password (if syncing?
|
||||
masked-password
|
||||
(security/hash-masked-password masked-password))
|
||||
:on-success (fn []
|
||||
(rf/dispatch [:onboarding/set-auth-method auth-method])
|
||||
(when syncing?
|
||||
(rf/dispatch [:onboarding/navigate-to-enable-notifications])))
|
||||
:on-error #(log/error "failed to save biometrics"
|
||||
{:key-uid key-uid
|
||||
:error %})})))))
|
||||
|
||||
(rf/defn navigate-to-identifiers
|
||||
{:events [:onboarding/navigate-to-identifiers]}
|
||||
[{:keys [db]}]
|
||||
(if (:onboarding/generated-keys? db)
|
||||
{:dispatch [:navigate-to-within-stack
|
||||
[:screen/onboarding.identifiers :screen/onboarding.new-to-status]]}
|
||||
{:dispatch-later [{:ms constants/onboarding-generating-keys-navigation-retry-ms
|
||||
:dispatch [:onboarding/navigate-to-identifiers]}]}))
|
||||
(rf/reg-event-fx
|
||||
:onboarding/navigate-to-identifiers
|
||||
(fn [{:keys [db]}]
|
||||
{:fx [(if (:onboarding/generated-keys? db)
|
||||
[:dispatch
|
||||
[:navigate-to-within-stack
|
||||
[:screen/onboarding.identifiers :screen/onboarding.new-to-status]]]
|
||||
[:dispatch-later
|
||||
[{:ms constants/onboarding-generating-keys-navigation-retry-ms
|
||||
:dispatch [:onboarding/navigate-to-identifiers]}]])]}))
|
||||
|
||||
@@ -1,21 +1,11 @@
|
||||
(ns status-im.contexts.profile.create.events
|
||||
(:require
|
||||
[native-module.core :as native-module]
|
||||
[status-im.common.emoji-picker.utils :as emoji-picker.utils]
|
||||
[status-im.contexts.profile.config :as profile.config]
|
||||
status-im.contexts.profile.create.effects
|
||||
[utils.re-frame :as rf]
|
||||
[utils.security.core :as security]))
|
||||
[status-im.contexts.profile.utils :as profile.utils]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(rf/defn create-profile-and-login
|
||||
{:events [:profile.create/create-and-login]}
|
||||
[{:keys [db]} {:keys [display-name password image-path color]}]
|
||||
(let [login-sha3-password (native-module/sha3 (security/safe-unmask-data password))]
|
||||
{:db (assoc-in db [:syncing :login-sha3-password] login-sha3-password)
|
||||
:effects.profile/create-and-login
|
||||
(assoc (profile.config/create)
|
||||
:displayName display-name
|
||||
:password login-sha3-password
|
||||
:imagePath (profile.config/strip-file-prefix image-path)
|
||||
:customizationColor color
|
||||
:emoji (emoji-picker.utils/random-emoji))}))
|
||||
(rf/reg-event-fx :profile.create/create-and-login
|
||||
(fn [{:keys [db]} [profile]]
|
||||
(let [{:keys [password] :as profile} (profile.utils/create-profile-config profile false)]
|
||||
{:db (assoc-in db [:syncing :login-sha3-password] password)
|
||||
:effects.profile/create-and-login profile})))
|
||||
|
||||
@@ -35,27 +35,24 @@
|
||||
(native-module.pn/add-listener "remoteNotificationReceived"
|
||||
#(handle-notification-press (transforms/json->clj %)))))
|
||||
|
||||
(rf/defn handle-enable-notifications-event
|
||||
{:events [:push-notifications/registered-for-push-notifications]}
|
||||
[_ token]
|
||||
{:json-rpc/call [{:method "wakuext_registerForPushNotifications"
|
||||
:params [token (if platform/ios? config/apn-topic)
|
||||
(if platform/ios? apn-token-type firebase-token-type)]
|
||||
:on-success #(log/info "[push-notifications] register-success" %)
|
||||
:on-error #(log/info "[push-notifications] register-error" %)}]})
|
||||
(rf/reg-event-fx :push-notifications/registered-for-push-notifications
|
||||
(fn [_ [token]]
|
||||
{:json-rpc/call [{:method "wakuext_registerForPushNotifications"
|
||||
:params [token (if platform/ios? config/apn-topic)
|
||||
(if platform/ios? apn-token-type firebase-token-type)]
|
||||
:on-success #(log/info "[push-notifications] register-success" %)
|
||||
:on-error #(log/info "[push-notifications] register-error" %)}]}))
|
||||
|
||||
(rf/defn handle-disable-notifications-event
|
||||
{:events [:push-notifications/unregistered-from-push-notifications]}
|
||||
[_]
|
||||
{:json-rpc/call [{:method "wakuext_unregisterFromPushNotifications"
|
||||
:params []
|
||||
:on-success #(log/info "[push-notifications] unregister-success" %)
|
||||
:on-error #(log/info "[push-notifications] unregister-error" %)}]})
|
||||
(rf/reg-event-fx :push-notifications/unregistered-from-push-notifications
|
||||
(fn [_]
|
||||
{:json-rpc/call [{:method "wakuext_unregisterFromPushNotifications"
|
||||
:params []
|
||||
:on-success #(log/info "[push-notifications] unregister-success" %)
|
||||
:on-error #(log/info "[push-notifications] unregister-error" %)}]}))
|
||||
|
||||
(rf/defn handle-preferences-load
|
||||
{:events [:push-notifications/preferences-loaded]}
|
||||
[{:keys [db]} preferences]
|
||||
{:db (assoc db :push-notifications/preferences preferences)})
|
||||
(rf/reg-event-fx :push-notifications/preferences-loaded
|
||||
(fn [{:keys [db]} [preferences]]
|
||||
{:db (assoc db :push-notifications/preferences preferences)}))
|
||||
|
||||
(re-frame/reg-fx :push-notifications/load-preferences
|
||||
(fn []
|
||||
|
||||
@@ -4,8 +4,7 @@
|
||||
[react-native.platform :as platform]
|
||||
[status-im.constants :as constants]
|
||||
status-im.contexts.profile.push-notifications.local.effects
|
||||
[utils.i18n :as i18n]
|
||||
[utils.re-frame :as rf]))
|
||||
[utils.i18n :as i18n]))
|
||||
|
||||
(def ^:private push-notification-types
|
||||
#{"transaction" "message"})
|
||||
@@ -43,7 +42,7 @@
|
||||
:body-type
|
||||
bodyType))
|
||||
|
||||
(rf/defn process
|
||||
(defn process
|
||||
[cofx {:keys [bodyType] :as event}]
|
||||
(if (push-notification-types bodyType)
|
||||
(if platform/ios?
|
||||
|
||||
@@ -1,27 +1,13 @@
|
||||
(ns status-im.contexts.profile.recover.events
|
||||
(:require
|
||||
[native-module.core :as native-module]
|
||||
[status-im.common.emoji-picker.utils :as emoji-picker.utils]
|
||||
[status-im.contexts.profile.config :as profile.config]
|
||||
status-im.contexts.profile.recover.effects
|
||||
[utils.re-frame :as rf]
|
||||
[utils.security.core :as security]))
|
||||
[status-im.contexts.profile.utils :as profile.utils]
|
||||
[utils.re-frame :as rf]))
|
||||
|
||||
(rf/defn recover-profile-and-login
|
||||
{:events [:profile.recover/recover-and-login]}
|
||||
[{:keys [db]} {:keys [display-name password image-path color seed-phrase]}]
|
||||
(let [login-sha3-password (native-module/sha3 (security/safe-unmask-data password))]
|
||||
{:db
|
||||
(-> db
|
||||
(assoc :onboarding/recovered-account? true)
|
||||
(assoc-in [:syncing :login-sha3-password] login-sha3-password))
|
||||
|
||||
:effects.profile/restore-and-login
|
||||
(merge (profile.config/create)
|
||||
{:displayName display-name
|
||||
:mnemonic (security/safe-unmask-data seed-phrase)
|
||||
:password login-sha3-password
|
||||
:imagePath (profile.config/strip-file-prefix image-path)
|
||||
:customizationColor color
|
||||
:emoji (emoji-picker.utils/random-emoji)
|
||||
:fetchBackup true})}))
|
||||
(rf/reg-event-fx :profile.create/recover-and-login
|
||||
(fn [{:keys [db]} [profile]]
|
||||
(let [{:keys [password] :as profile} (profile.utils/create-profile-config profile true)]
|
||||
{:db (-> db
|
||||
(assoc :onboarding/recovered-account? true)
|
||||
(assoc-in [:syncing :login-sha3-password] password))
|
||||
:effects.profile/create-and-login profile})))
|
||||
|
||||
@@ -114,7 +114,7 @@
|
||||
:params [key-uid (string/replace-first path #"file://" "") ax ay bx
|
||||
by]
|
||||
:on-success [:profile.settings/update-local-picture]}]]
|
||||
[:dismiss-bottom-sheet-overlay-old]]})))
|
||||
[:dispatch [:hide-bottom-sheet]]]})))
|
||||
|
||||
(rf/reg-event-fx :profile.settings/save-profile-picture-from-url
|
||||
(fn [{:keys [db]} [url]]
|
||||
@@ -126,7 +126,7 @@
|
||||
:params [key-uid url]
|
||||
:on-error #(log/error "::save-profile-picture-from-url error" %)
|
||||
:on-success [:profile.settings/update-local-picture]}]]
|
||||
[:dismiss-bottom-sheet-overlay-old]]})))
|
||||
[:dispatch [:hide-bottom-sheet]]]})))
|
||||
|
||||
(rf/reg-event-fx :profile.settings/delete-profile-picture
|
||||
(fn [{:keys [db]}]
|
||||
@@ -140,7 +140,7 @@
|
||||
;; NOTE: In case of an error we could fallback to previous image in
|
||||
;; UI with a toast error
|
||||
:on-success #(log/info "[profile] Delete profile image" %)}]]
|
||||
[:dismiss-bottom-sheet-overlay-old]]})))
|
||||
[:dispatch [:hide-bottom-sheet]]]})))
|
||||
|
||||
(rf/reg-event-fx :profile.settings/update-local-picture
|
||||
(fn [{:keys [db]} [images]]
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
(ns status-im.contexts.profile.utils
|
||||
(:require [clojure.string :as string]))
|
||||
(:require [clojure.string :as string]
|
||||
[native-module.core :as native-module]
|
||||
[status-im.common.emoji-picker.utils :as emoji-picker.utils]
|
||||
[status-im.contexts.profile.config :as profile.config]
|
||||
[utils.security.core :as security]))
|
||||
|
||||
(defn displayed-name
|
||||
[{:keys [name display-name preferred-name alias ens-verified primary-name]}]
|
||||
@@ -20,3 +24,19 @@
|
||||
(or (:large images)
|
||||
(:thumbnail images)
|
||||
(first images)))
|
||||
|
||||
(defn create-profile-config
|
||||
[{:keys [display-name seed-phrase password image-path color]} restore?]
|
||||
(let [login-sha3-password (native-module/sha3 (security/safe-unmask-data password))]
|
||||
(cond-> (profile.config/create)
|
||||
|
||||
true
|
||||
(merge {:displayName display-name
|
||||
:password login-sha3-password
|
||||
:imagePath (profile.config/strip-file-prefix image-path)
|
||||
:customizationColor color
|
||||
:emoji (emoji-picker.utils/random-emoji)})
|
||||
|
||||
restore?
|
||||
(merge {:mnemonic (security/safe-unmask-data seed-phrase)
|
||||
:fetchBackup true}))))
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
(:require
|
||||
[clojure.set :as set]
|
||||
[quo.core :as quo]
|
||||
[status-im.config :as config]
|
||||
[status-im.contexts.shell.activity-center.notification-types :as types]
|
||||
[status-im.contexts.shell.activity-center.style :as style]
|
||||
[utils.i18n :as i18n]
|
||||
@@ -48,12 +49,13 @@
|
||||
:accessibility-label :tab-contact-request
|
||||
:notification-dot? (when-not is-mark-all-as-read-undoable?
|
||||
(contains? types-with-unread types/contact-request))}
|
||||
{:id types/contact-verification
|
||||
:label (i18n/label :t/identity-verification)
|
||||
:accessibility-label :tab-contact-verification
|
||||
:notification-dot? (when-not is-mark-all-as-read-undoable?
|
||||
(contains? types-with-unread
|
||||
types/contact-verification))}
|
||||
(when config/show-not-implemented-features?
|
||||
{:id types/contact-verification
|
||||
:label (i18n/label :t/identity-verification)
|
||||
:accessibility-label :tab-contact-verification
|
||||
:notification-dot? (when-not is-mark-all-as-read-undoable?
|
||||
(contains? types-with-unread
|
||||
types/contact-verification))})
|
||||
{:id types/tx
|
||||
:label (i18n/label :t/transactions)
|
||||
:accessibility-label :tab-tx
|
||||
|
||||
@@ -13,15 +13,13 @@
|
||||
[utils.security.core :as security]
|
||||
[utils.transforms :as transforms]))
|
||||
|
||||
(rf/defn local-pairing-update-role
|
||||
{:events [:syncing/update-role]}
|
||||
[{:keys [db]} role]
|
||||
{:db (assoc-in db [:syncing :role] role)})
|
||||
(rf/reg-event-fx :syncing/update-role
|
||||
(fn [{:keys [db]} [role]]
|
||||
{:db (assoc-in db [:syncing :role] role)}))
|
||||
|
||||
(rf/defn local-pairing-clear-states
|
||||
{:events [:syncing/clear-states]}
|
||||
[{:keys [db]} role]
|
||||
{:db (dissoc db :syncing)})
|
||||
(rf/reg-event-fx :syncing/clear-states
|
||||
(fn [{:keys [db]}]
|
||||
{:db (dissoc db :syncing)}))
|
||||
|
||||
(defn- get-default-node-config
|
||||
[installation-id]
|
||||
@@ -52,62 +50,59 @@
|
||||
{:type :negative
|
||||
:text error}]))))
|
||||
|
||||
(rf/defn preflight-outbound-check-for-local-pairing
|
||||
{:events [:syncing/preflight-outbound-check]}
|
||||
[_ set-checks-passed]
|
||||
(let [callback
|
||||
(fn [raw-response]
|
||||
(log/info "Local pairing preflight check"
|
||||
{:response raw-response
|
||||
:event :syncing/preflight-outbound-check})
|
||||
(let [^js response-js (transforms/json->js raw-response)
|
||||
error (transforms/js->clj (.-error response-js))]
|
||||
(set-checks-passed (empty? error))))]
|
||||
(native-module/local-pairing-preflight-outbound-check callback)))
|
||||
(rf/reg-event-fx :syncing/preflight-outbound-check
|
||||
(fn [_ [set-checks-passed]]
|
||||
(let [callback
|
||||
(fn [raw-response]
|
||||
(log/info "Local pairing preflight check"
|
||||
{:response raw-response
|
||||
:event :syncing/preflight-outbound-check})
|
||||
(let [^js response-js (transforms/json->js raw-response)
|
||||
error (transforms/js->clj (.-error response-js))]
|
||||
(set-checks-passed (empty? error))))]
|
||||
(native-module/local-pairing-preflight-outbound-check callback))))
|
||||
|
||||
(rf/defn initiate-local-pairing-with-connection-string
|
||||
{:events [:syncing/input-connection-string-for-bootstrapping]
|
||||
:interceptors [(re-frame/inject-cofx :random-guid-generator)]}
|
||||
[{:keys [random-guid-generator db]} connection-string]
|
||||
(let [installation-id (random-guid-generator)
|
||||
default-node-config (get-default-node-config installation-id)
|
||||
default-node-config-string (.stringify js/JSON (clj->js default-node-config))
|
||||
callback
|
||||
(fn [final-node-config]
|
||||
(let [config-map (.stringify js/JSON
|
||||
(clj->js
|
||||
{:receiverConfig
|
||||
{:kdfIterations config/default-kdf-iterations
|
||||
:nodeConfig final-node-config
|
||||
:settingCurrentNetwork config/default-network
|
||||
:deviceType platform/os
|
||||
:deviceName
|
||||
(native-module/get-installation-name)}}))]
|
||||
(rf/dispatch [:syncing/update-role constants/local-pairing-role-receiver])
|
||||
(native-module/input-connection-string-for-bootstrapping
|
||||
connection-string
|
||||
config-map
|
||||
input-connection-string-callback)))]
|
||||
(native-module/prepare-dir-and-update-config "" default-node-config-string callback)))
|
||||
(rf/reg-event-fx :syncing/input-connection-string-for-bootstrapping
|
||||
[(re-frame/inject-cofx :random-guid-generator)]
|
||||
(fn [{:keys [random-guid-generator]} [connection-string]]
|
||||
(let [installation-id (random-guid-generator)
|
||||
default-node-config (get-default-node-config installation-id)
|
||||
default-node-config-string (.stringify js/JSON (clj->js default-node-config))
|
||||
callback
|
||||
(fn [final-node-config]
|
||||
(let [config-map (.stringify js/JSON
|
||||
(clj->js
|
||||
{:receiverConfig
|
||||
{:kdfIterations config/default-kdf-iterations
|
||||
:nodeConfig final-node-config
|
||||
:settingCurrentNetwork config/default-network
|
||||
:deviceType platform/os
|
||||
:deviceName
|
||||
(native-module/get-installation-name)}}))]
|
||||
(rf/dispatch [:syncing/update-role constants/local-pairing-role-receiver])
|
||||
(native-module/input-connection-string-for-bootstrapping
|
||||
connection-string
|
||||
config-map
|
||||
input-connection-string-callback)))]
|
||||
(native-module/prepare-dir-and-update-config "" default-node-config-string callback))))
|
||||
|
||||
(rf/defn preparations-for-connection-string
|
||||
{:events [:syncing/get-connection-string]}
|
||||
[{:keys [db] :as cofx} sha3-pwd on-valid-connection-string]
|
||||
(let [error (get-in db [:profile/login :error])
|
||||
handle-connection (fn [response]
|
||||
(when (sync-utils/valid-connection-string? response)
|
||||
(on-valid-connection-string response)
|
||||
(rf/dispatch [:syncing/update-role constants/local-pairing-role-sender])
|
||||
(rf/dispatch [:hide-bottom-sheet])))]
|
||||
(when-not (and error (string/blank? error))
|
||||
(let [key-uid (get-in db [:profile/profile :key-uid])
|
||||
config-map (.stringify js/JSON
|
||||
(clj->js {:senderConfig {:keyUID key-uid
|
||||
:keystorePath ""
|
||||
:password (security/safe-unmask-data
|
||||
sha3-pwd)
|
||||
:deviceType platform/os}
|
||||
:serverConfig {:timeout 0}}))]
|
||||
(native-module/get-connection-string-for-bootstrapping-another-device
|
||||
config-map
|
||||
handle-connection)))))
|
||||
(rf/reg-event-fx :syncing/get-connection-string
|
||||
(fn [{:keys [db]} [sha3-pwd on-valid-connection-string]]
|
||||
(let [error (get-in db [:profile/login :error])
|
||||
handle-connection (fn [response]
|
||||
(when (sync-utils/valid-connection-string? response)
|
||||
(on-valid-connection-string response)
|
||||
(rf/dispatch [:syncing/update-role constants/local-pairing-role-sender])
|
||||
(rf/dispatch [:hide-bottom-sheet])))]
|
||||
(when-not (and error (string/blank? error))
|
||||
(let [key-uid (get-in db [:profile/profile :key-uid])
|
||||
config-map (.stringify js/JSON
|
||||
(clj->js {:senderConfig {:keyUID key-uid
|
||||
:keystorePath ""
|
||||
:password (security/safe-unmask-data
|
||||
sha3-pwd)
|
||||
:deviceType platform/os}
|
||||
:serverConfig {:timeout 0}}))]
|
||||
(native-module/get-connection-string-for-bootstrapping-another-device
|
||||
config-map
|
||||
handle-connection))))))
|
||||
|
||||
@@ -67,6 +67,8 @@
|
||||
[]
|
||||
(let [{:keys [customization-color] :as profile} (rf/sub [:profile/profile-with-image])
|
||||
{:keys [address path watch-only?]} (rf/sub [:wallet/current-viewing-account])
|
||||
{keypair-name :name
|
||||
keypair-type :type} (rf/sub [:wallet/current-viewing-account-keypair])
|
||||
networks (rf/sub [:wallet/network-preference-details])]
|
||||
[rn/scroll-view
|
||||
{:style style/about-tab
|
||||
@@ -88,10 +90,10 @@
|
||||
:on-press #(rf/dispatch [:show-bottom-sheet {:content about-options}])}]
|
||||
(when (not watch-only?)
|
||||
[quo/account-origin
|
||||
{:type :default-keypair
|
||||
{:type (if (= keypair-type "seed") :recovery-phrase :default-keypair)
|
||||
:stored :on-device
|
||||
:profile-picture (profile.utils/photo profile)
|
||||
:customization-color customization-color
|
||||
:derivation-path path
|
||||
:user-name (profile.utils/displayed-name profile)
|
||||
:keypair-name keypair-name
|
||||
:on-press #(js/alert "To be implemented")}])]))
|
||||
|
||||
@@ -71,7 +71,6 @@
|
||||
selected-keypair (rf/sub [:wallet/selected-keypair-uid])
|
||||
profile-picture (rf/sub [:profile/image])
|
||||
[selected-key-uid set-selected-key-uid] (rn/use-state selected-keypair)]
|
||||
(rn/use-mount #(rf/dispatch [:wallet/get-keypairs]))
|
||||
[rn/view {:style {:flex 1}}
|
||||
[quo/page-nav
|
||||
{:icon-name :i/close
|
||||
|
||||
@@ -99,6 +99,7 @@
|
||||
:wallet/remove-account-success
|
||||
(fn [_ [toast-message _]]
|
||||
{:fx [[:dispatch [:wallet/get-accounts]]
|
||||
[:dispatch [:wallet/get-keypairs]]
|
||||
[:dispatch-later
|
||||
{:ms 100
|
||||
:dispatch [:hide-bottom-sheet]}]
|
||||
@@ -183,6 +184,7 @@
|
||||
:navigate-to-account address
|
||||
:new-account? true)
|
||||
:fx [[:dispatch [:wallet/get-accounts]]
|
||||
[:dispatch [:wallet/get-keypairs]]
|
||||
[:dispatch [:wallet/clear-new-keypair]]]}))
|
||||
|
||||
(rf/reg-event-fx :wallet/add-account
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns status-im.events
|
||||
(:require
|
||||
[legacy.status-im.bottom-sheet.events]
|
||||
status-im.common.alert-banner.events
|
||||
status-im.common.alert.effects
|
||||
status-im.common.async-storage.effects
|
||||
|
||||
@@ -86,10 +86,6 @@
|
||||
(fn [] views/alert-banner))
|
||||
|
||||
;;;; LEGACY (should be removed in status 2.0)
|
||||
(navigation/register-component
|
||||
"bottom-sheet-old"
|
||||
(fn [] (gesture/gesture-handler-root-hoc views/sheet-comp-old))
|
||||
(fn [] views/sheet-comp-old))
|
||||
|
||||
(navigation/register-component
|
||||
"popover"
|
||||
|
||||
@@ -285,12 +285,6 @@
|
||||
(rf/reg-fx :hide-visibility-status-popover
|
||||
(fn [] (navigation/dissmiss-overlay "visibility-status-popover")))
|
||||
|
||||
(rf/reg-fx :show-bottom-sheet-overlay-old
|
||||
(fn [] (show-overlay "bottom-sheet-old")))
|
||||
|
||||
(rf/reg-fx :dismiss-bottom-sheet-overlay-old
|
||||
(fn [] (navigation/dissmiss-overlay "bottom-sheet-old")))
|
||||
|
||||
(rf/reg-fx :show-wallet-connect-sheet
|
||||
(fn [] (show-overlay "wallet-connect-sheet")))
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
(ns status-im.navigation.view
|
||||
(:require
|
||||
[legacy.status-im.bottom-sheet.sheets :as bottom-sheets-old]
|
||||
[legacy.status-im.ui.screens.popover.views :as popover]
|
||||
[quo.foundations.colors :as colors]
|
||||
[quo.theme]
|
||||
@@ -123,14 +122,6 @@
|
||||
functional-compiler))
|
||||
|
||||
;; LEGACY (should be removed in status 2.0)
|
||||
(def sheet-comp-old
|
||||
(reagent/reactify-component
|
||||
(fn []
|
||||
^{:key (str "sheet-old" @reloader/cnt)}
|
||||
[:<>
|
||||
[inactive]
|
||||
[bottom-sheets-old/bottom-sheet]])
|
||||
functional-compiler))
|
||||
|
||||
(def popover-comp
|
||||
(reagent/reactify-component
|
||||
|
||||
@@ -367,3 +367,10 @@
|
||||
:camera-roll/total-photos-count-ios
|
||||
(fn [{:keys [camera-roll/ios-images-count]}]
|
||||
ios-images-count))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:chats/group-chat-image
|
||||
(fn [[_ chat-id]]
|
||||
(re-frame/subscribe [:chats/chat chat-id]))
|
||||
:->
|
||||
:image)
|
||||
|
||||
@@ -177,3 +177,18 @@
|
||||
(is (= :army (:color result)))
|
||||
(is (= "test" (:chat-name result)))
|
||||
(is (= "🍑" (:emoji result)))))))
|
||||
|
||||
(h/deftest-sub :chats/group-chat-image
|
||||
[sub-name]
|
||||
(testing "returns picture for group"
|
||||
(let [image-data {:uri "data:image/png1234"}
|
||||
chats {chat-id (assoc community-chat
|
||||
:color :army
|
||||
:emoji "🍑"
|
||||
:chat-name "test"
|
||||
:image image-data)}]
|
||||
(swap! rf-db/app-db assoc
|
||||
:chats
|
||||
chats)
|
||||
(let [result (rf/sub [sub-name chat-id])]
|
||||
(= image-data result)))))
|
||||
|
||||
@@ -139,16 +139,6 @@
|
||||
(fn [seed]
|
||||
(or seed {:step :intro})))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:bottom-sheet-old
|
||||
:<- [:bottom-sheet/show?]
|
||||
:<- [:bottom-sheet/view]
|
||||
:<- [:bottom-sheet/options]
|
||||
(fn [[show? view options]]
|
||||
{:show? show?
|
||||
:view view
|
||||
:options options}))
|
||||
|
||||
(re-frame/reg-sub
|
||||
:is-contact-selected?
|
||||
:<- [:group/selected-contacts]
|
||||
|
||||
@@ -215,6 +215,13 @@
|
||||
(assoc :balance balance
|
||||
:formatted-balance formatted-balance)))))
|
||||
|
||||
(rf/reg-sub
|
||||
:wallet/current-viewing-account-keypair
|
||||
:<- [:wallet/current-viewing-account]
|
||||
:<- [:wallet/keypairs]
|
||||
(fn [[{:keys [key-uid]} keypairs]]
|
||||
(first (filter #(= key-uid (:key-uid %)) keypairs))))
|
||||
|
||||
(rf/reg-sub
|
||||
:wallet/current-viewing-account-tokens-in-selected-networks
|
||||
:<- [:wallet/current-viewing-account]
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.179.6",
|
||||
"commit-sha1": "5e9f9618cd83134b8a0d19d9bfce643b9232cb9e",
|
||||
"src-sha256": "18cw2bpr0nrvws8gka4l3sfkvilg0g07z9sw5azpwph94k2sh0rb"
|
||||
"version": "v0.179.7",
|
||||
"commit-sha1": "cdac86f73ac3bf7f4f4cf09b5bc27fb1602c1820",
|
||||
"src-sha256": "0svj36zq1v7p1d6dwa29s8m82gfy4ffdcajqcn2wyxxr7i1nwnwa"
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import hmac
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import urllib
|
||||
from hashlib import md5
|
||||
|
||||
from support.test_data import SingleTestData
|
||||
@@ -107,8 +108,9 @@ class BaseTestReport:
|
||||
|
||||
@staticmethod
|
||||
def get_jenkins_link_to_rerun_e2e(branch_name="develop", pr_id="", tr_case_ids=""):
|
||||
branch_name = urllib.parse.quote(branch_name)
|
||||
return 'https://ci.status.im/job/status-mobile/job/e2e/job/status-app-prs-rerun/parambuild/' \
|
||||
'?BRANCH_NAME=%s&PR_ID=%s&APK_URL=%s.apk&TR_CASE_IDS=%s' % (branch_name, pr_id, pr_id, tr_case_ids)
|
||||
'?BRANCH_NAME=%s&PR_ID=%s&APK_NAME=%s.apk&TR_CASE_IDS=%s' % (branch_name, pr_id, pr_id, tr_case_ids)
|
||||
|
||||
def get_sauce_final_screenshot_url(self, job_id):
|
||||
return 'https://media.giphy.com/media/9M5jK4GXmD5o1irGrF/giphy.gif'
|
||||
|
||||
@@ -89,7 +89,10 @@ class TestrailReport(BaseTestReport):
|
||||
'case_ids': self.get_regression_cases(),
|
||||
'include_all': False}
|
||||
run = self.post('add_run/%s' % self.project_id, request_body)
|
||||
self.run_id = run['id']
|
||||
try:
|
||||
self.run_id = run['id']
|
||||
except KeyError:
|
||||
print("TestRail error when creating a run: %s" % run)
|
||||
print("Testrun: %sruns/view/%s" % (self.url, self.run_id))
|
||||
|
||||
def get_cases(self, section_ids):
|
||||
|
||||
@@ -48,8 +48,8 @@ class TestDeepLinksOneDevice(MultipleSharedDeviceTestCase):
|
||||
self.profile_view.close_button.click()
|
||||
|
||||
closed_community_urls = {
|
||||
"https://status.app/c/G8EAAMR_fz8tsCQ-aR2QrCS5sVAvvzc_N3mAA-En_Zxy4JA3j7Dl1A50Pd4DbooQOMbWf7E1_4wipgDyGe8XZEappDn-Qomf9l_xyXhSYBuSQic8InCEUBSRGR0oixSTh3iw5ZCxzkGSI95Iyu1EBpcIlFOEMPHpKUBIdkkoKBJglMDKko8O8dBvBtIYncOA8mwztwLpx3C0rK_u59PldFuXe4cx#zQ3shwQnEfMtcXpHXF4qJPyCGgw2F18N3nbGzYbzsVHnMq4yK":
|
||||
"Status mobile QA community max",
|
||||
"https://status.app/c/G0IAAGRy3S0pLm1NeQ91pwKgFaFGoIlkxXmDxITXXi3KdZ7vpb9-ERczhqwoFwMK6sCPnKwA#zQ3shtJ8A3rxUZWcfWDL3vKYQBt3jMPTuf44dJUGfjZjsek66":
|
||||
"e2e community token-gated",
|
||||
"https://status.app/c/G1AAAGR0G-IRb2YJD4lRXwLusAFnGrDHGNl6Wt55MIARwVYvarnO873011-fdVSz1kHSan-qq0G96vOaMqyTRhJnQV74KCUr#zQ3shb9irJR66rhG1E8sQZX8pDU3dpGm4daYSmPVDd2e73ewE":
|
||||
"Open community for e2e",
|
||||
"https://status.app/c/GzAAAORtwyW4xNWM4td0F7hOnYZ1apSqCCRUUR0qxD19n3Ec97fX_aIVIGFWbdUM#zQ3shk6dgK8dYWWSC4m8Jj5c91zyfhfj1fFkgypS8D9gsXkrK":
|
||||
@@ -93,8 +93,8 @@ class TestDeepLinksOneDevice(MultipleSharedDeviceTestCase):
|
||||
self.browser_view.click_system_back_button()
|
||||
|
||||
community_links = {
|
||||
"status.app://c/G8EAAMR_fz8tsCQ-aR2QrCS5sVAvvzc_N3mAA-En_Zxy4JA3j7Dl1A50Pd4DbooQOMbWf7E1_4wipgDyGe8XZEappDn-Qomf9l_xyXhSYBuSQic8InCEUBSRGR0oixSTh3iw5ZCxzkGSI95Iyu1EBpcIlFOEMPHpKUBIdkkoKBJglMDKko8O8dBvBtIYncOA8mwztwLpx3C0rK_u59PldFuXe4cx#zQ3shwQnEfMtcXpHXF4qJPyCGgw2F18N3nbGzYbzsVHnMq4yK":
|
||||
"Status mobile QA community max",
|
||||
"status.app://c/G0IAAGRy3S0pLm1NeQ91pwKgFaFGoIlkxXmDxITXXi3KdZ7vpb9-ERczhqwoFwMK6sCPnKwA#zQ3shtJ8A3rxUZWcfWDL3vKYQBt3jMPTuf44dJUGfjZjsek66":
|
||||
"e2e community token-gated",
|
||||
"status.app://c/G1AAAGR0G-IRb2YJD4lRXwLusAFnGrDHGNl6Wt55MIARwVYvarnO873011-fdVSz1kHSan-qq0G96vOaMqyTRhJnQV74KCUr#zQ3shb9irJR66rhG1E8sQZX8pDU3dpGm4daYSmPVDd2e73ewE":
|
||||
"Open community for e2e",
|
||||
"status.app://c/GzAAAORtwyW4xNWM4td0F7hOnYZ1apSqCCRUUR0qxD19n3Ec97fX_aIVIGFWbdUM#zQ3shk6dgK8dYWWSC4m8Jj5c91zyfhfj1fFkgypS8D9gsXkrK":
|
||||
|
||||
@@ -98,6 +98,8 @@ class TestWalletMultipleDevice(MultipleSharedDeviceTestCase):
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(727229)
|
||||
@marks.xfail(reason="Assets are not shown on Sepolia, https://github.com/status-im/status-mobile/issues/19752",
|
||||
run=False)
|
||||
def test_wallet_send_eth(self):
|
||||
sender_balance, receiver_balance, eth_amount_sender, eth_amount_receiver = self._get_balances_before_tx()
|
||||
|
||||
@@ -113,6 +115,8 @@ class TestWalletMultipleDevice(MultipleSharedDeviceTestCase):
|
||||
eth_amount_receiver)
|
||||
|
||||
@marks.testrail_id(727230)
|
||||
@marks.xfail(reason="Assets are not shown on Sepolia, https://github.com/status-im/status-mobile/issues/19752",
|
||||
run=False)
|
||||
def test_wallet_send_asset_from_drawer(self):
|
||||
sender_balance, receiver_balance, eth_amount_sender, eth_amount_receiver = self._get_balances_before_tx()
|
||||
self.wallet_2.close_account_button.click()
|
||||
@@ -183,6 +187,8 @@ class TestWalletOneDevice(MultipleSharedDeviceTestCase):
|
||||
self.errors.verify_no_errors()
|
||||
|
||||
@marks.testrail_id(727232)
|
||||
@marks.xfail(reason="Can't find activity on Sepolia, https://github.com/status-im/status-mobile/issues/19752",
|
||||
run=False)
|
||||
def test_wallet_add_remove_watch_only_account(self):
|
||||
self.wallet_view.just_fyi("Adding new watch only account")
|
||||
new_account_name = "Account to watch"
|
||||
|
||||
@@ -2594,9 +2594,10 @@
|
||||
eventemitter3 "^1.2.0"
|
||||
lodash "^4.17.15"
|
||||
|
||||
"@react-native-community/blur@git+https://github.com/status-im/react-native-blur.git#refs/tags/v4.3.3-status":
|
||||
version "4.3.3"
|
||||
resolved "git+https://github.com/status-im/react-native-blur.git#c140cc8e7d54e3318af0a7c149b5d64b54de3419"
|
||||
"@react-native-community/blur@4.4.0":
|
||||
version "4.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@react-native-community/blur/-/blur-4.4.0.tgz#b2440dab17d94e480fbc4470e03155573b5b7375"
|
||||
integrity sha512-P+xdT2LIq1ewOsF3zx7C0nu4dj7nxl2NVTsMXEzRDjM3bWMdrrEbTRA7uwPV5ngn7/BXIommBPlT/JW4SAedrw==
|
||||
|
||||
"@react-native-community/cli-clean@12.3.6":
|
||||
version "12.3.6"
|
||||
@@ -7533,13 +7534,6 @@ pkg-dir@^4.2.0:
|
||||
dependencies:
|
||||
find-up "^4.0.0"
|
||||
|
||||
pkg-dir@^5.0.0:
|
||||
version "5.0.0"
|
||||
resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-5.0.0.tgz#a02d6aebe6ba133a928f74aec20bafdfe6b8e760"
|
||||
integrity sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==
|
||||
dependencies:
|
||||
find-up "^5.0.0"
|
||||
|
||||
pngjs@^3.4.0:
|
||||
version "3.4.0"
|
||||
resolved "https://registry.yarnpkg.com/pngjs/-/pngjs-3.4.0.tgz#99ca7d725965fb655814eaf65f38f12bbdbf555f"
|
||||
@@ -7955,13 +7949,10 @@ react-native-orientation-locker@^1.5.0:
|
||||
resolved "https://registry.yarnpkg.com/react-native-orientation-locker/-/react-native-orientation-locker-1.5.0.tgz#324853937eed4835ecd1c8613ab2206135d908ac"
|
||||
integrity sha512-4XOCGmNN4BXg5JUFjUuXpsfhPJmbA3LkQilJO1ed+6vL97teTdG2w5IEevKiqL9/hPjeWE8YYtX/YW+yp53hkg==
|
||||
|
||||
react-native-permissions@3.8.0:
|
||||
version "3.8.0"
|
||||
resolved "https://registry.yarnpkg.com/react-native-permissions/-/react-native-permissions-3.8.0.tgz#7c1f75ae126c7d0b863eec9d2f5cd93ff8ad8310"
|
||||
integrity sha512-BfZ7ksgdpGchHZH8M/kxCGZbWeACANbnPmb3hNjVOMDQusc4PWlPpobX3eBqYMSKbpi7bMECeV9BVU4QuwAf9A==
|
||||
dependencies:
|
||||
picocolors "^1.0.0"
|
||||
pkg-dir "^5.0.0"
|
||||
react-native-permissions@4.1.5:
|
||||
version "4.1.5"
|
||||
resolved "https://registry.yarnpkg.com/react-native-permissions/-/react-native-permissions-4.1.5.tgz#db4d1ddbf076570043f4fd4168f54bb6020aec92"
|
||||
integrity sha512-r6VMRacASmtRHS+GZ+5HQCp9p9kiE+UU9magHOZCXZLTJitdTuVHWZRrb4v4oqZGU+zAp3mZhTQftuMMv+WLUg==
|
||||
|
||||
react-native-randombytes@^3.5.1:
|
||||
version "3.6.1"
|
||||
|
||||
Reference in New Issue
Block a user