diff --git a/.env b/.env index 40f08de8c862..47d294f46075 100644 --- a/.env +++ b/.env @@ -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 diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 749f6bcb7372..2f382511ba73 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -879,7 +879,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 @@ -1476,7 +1478,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 diff --git a/package.json b/package.json index 76e920261e28..c23b103b4317 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/patches/BlurView-build.gradle.patch b/patches/BlurView-build.gradle.patch new file mode 100644 index 000000000000..cd93e309cae4 --- /dev/null +++ b/patches/BlurView-build.gradle.patch @@ -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' + } + } + diff --git a/patches/BlurView.ios.tsx.patch b/patches/BlurView.ios.tsx.patch new file mode 100644 index 000000000000..85b09c59e587 --- /dev/null +++ b/patches/BlurView.ios.tsx.patch @@ -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' diff --git a/patches/BlurView.mm.patch b/patches/BlurView.mm.patch new file mode 100644 index 000000000000..13bf7d36d371 --- /dev/null +++ b/patches/BlurView.mm.patch @@ -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(_props); + const auto &newViewProps = *std::static_pointer_cast(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 diff --git a/patches/BlurViewNativeComponent.ts.patch b/patches/BlurViewNativeComponent.ts.patch new file mode 100644 index 000000000000..e08b1d94d881 --- /dev/null +++ b/patches/BlurViewNativeComponent.ts.patch @@ -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' diff --git a/patches/VibrancyViewNativeComponent.ts.patch b/patches/VibrancyViewNativeComponent.ts.patch new file mode 100644 index 000000000000..14742361e514 --- /dev/null +++ b/patches/VibrancyViewNativeComponent.ts.patch @@ -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' diff --git a/src/legacy/status_im/bottom_sheet/events.cljs b/src/legacy/status_im/bottom_sheet/events.cljs deleted file mode 100644 index 3f9d1c26518b..000000000000 --- a/src/legacy/status_im/bottom_sheet/events.cljs +++ /dev/null @@ -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}) diff --git a/src/legacy/status_im/bottom_sheet/sheets.cljs b/src/legacy/status_im/bottom_sheet/sheets.cljs deleted file mode 100644 index c8de382b5ae5..000000000000 --- a/src/legacy/status_im/bottom_sheet/sheets.cljs +++ /dev/null @@ -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)])]])])) diff --git a/src/legacy/status_im/bottom_sheet/styles.cljs b/src/legacy/status_im/bottom_sheet/styles.cljs deleted file mode 100644 index 635affd0aa33..000000000000 --- a/src/legacy/status_im/bottom_sheet/styles.cljs +++ /dev/null @@ -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}) diff --git a/src/legacy/status_im/bottom_sheet/view.cljs b/src/legacy/status_im/bottom_sheet/view.cljs deleted file mode 100644 index 70db00d90d54..000000000000 --- a/src/legacy/status_im/bottom_sheet/view.cljs +++ /dev/null @@ -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}]))]))])) diff --git a/src/legacy/status_im/browser/core.cljs b/src/legacy/status_im/browser/core.cljs index d8f34b7b6614..a484fa93f1f9 100644 --- a/src/legacy/status_im/browser/core.cljs +++ b/src/legacy/status_im/browser/core.cljs @@ -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) diff --git a/src/legacy/status_im/communities/core.cljs b/src/legacy/status_im/communities/core.cljs index a5551d6ae2e7..0b2e3492fb00 100644 --- a/src/legacy/status_im/communities/core.cljs +++ b/src/legacy/status_im/communities/core.cljs @@ -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 diff --git a/src/legacy/status_im/ens/core.cljs b/src/legacy/status_im/ens/core.cljs index d10a5e181b35..b302498b973c 100644 --- a/src/legacy/status_im/ens/core.cljs +++ b/src/legacy/status_im/ens/core.cljs @@ -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]} diff --git a/src/legacy/status_im/mobile_sync_settings/core.cljs b/src/legacy/status_im/mobile_sync_settings/core.cljs index dfb7faeb1334..9ad442bec45a 100644 --- a/src/legacy/status_im/mobile_sync_settings/core.cljs +++ b/src/legacy/status_im/mobile_sync_settings/core.cljs @@ -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)) diff --git a/src/legacy/status_im/ui/screens/browser/empty_tab/views.cljs b/src/legacy/status_im/ui/screens/browser/empty_tab/views.cljs index efb03faa4bfe..421c7b05a79b 100644 --- a/src/legacy/status_im/ui/screens/browser/empty_tab/views.cljs +++ b/src/legacy/status_im/ui/screens/browser/empty_tab/views.cljs @@ -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) diff --git a/src/legacy/status_im/ui/screens/browser/views.cljs b/src/legacy/status_im/ui/screens/browser/views.cljs index b1d1ebdf8b74..cc28ed20692d 100644 --- a/src/legacy/status_im/ui/screens/browser/views.cljs +++ b/src/legacy/status_im/ui/screens/browser/views.cljs @@ -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, diff --git a/src/legacy/status_im/ui/screens/communities/members.cljs b/src/legacy/status_im/ui/screens/communities/members.cljs index 10fa051fb229..b62aff2c78de 100644 --- a/src/legacy/status_im/ui/screens/communities/members.cljs +++ b/src/legacy/status_im/ui/screens/communities/members.cljs @@ -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?])}]) diff --git a/src/legacy/status_im/ui/screens/ens/views.cljs b/src/legacy/status_im/ui/screens/ens/views.cljs index e98517e5ed4b..d8fde3082acf 100644 --- a/src/legacy/status_im/ui/screens/ens/views.cljs +++ b/src/legacy/status_im/ui/screens/ens/views.cljs @@ -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))}])}]])]]]) diff --git a/src/legacy/status_im/ui/screens/profile/group_chat/views.cljs b/src/legacy/status_im/ui/screens/profile/group_chat/views.cljs index e3b2fd98747a..16d5cc6b1afc 100644 --- a/src/legacy/status_im/ui/screens/profile/group_chat/views.cljs +++ b/src/legacy/status_im/ui/screens/profile/group_chat/views.cljs @@ -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])}])}])) diff --git a/src/legacy/status_im/ui/screens/profile/user/views.cljs b/src/legacy/status_im/ui/screens/profile/user/views.cljs index 129bb74b6cf2..633881dddfc3 100644 --- a/src/legacy/status_im/ui/screens/profile/user/views.cljs +++ b/src/legacy/status_im/ui/screens/profile/user/views.cljs @@ -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 diff --git a/src/legacy/status_im/utils/logging/core.cljs b/src/legacy/status_im/utils/logging/core.cljs index 105a8d24b383..540b2724a708 100644 --- a/src/legacy/status_im/utils/logging/core.cljs +++ b/src/legacy/status_im/utils/logging/core.cljs @@ -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))) diff --git a/src/quo/components/settings/category/settings/view.cljs b/src/quo/components/settings/category/settings/view.cljs index ee228d584c17..f5a8198b3c19 100644 --- a/src/quo/components/settings/category/settings/view.cljs +++ b/src/quo/components/settings/category/settings/view.cljs @@ -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)}])])]])) diff --git a/src/quo/components/settings/category/style.cljs b/src/quo/components/settings/category/style.cljs index c36dd9f9b00c..73377f88073e 100644 --- a/src/quo/components/settings/category/style.cljs +++ b/src/quo/components/settings/category/style.cljs @@ -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 diff --git a/src/quo/components/tabs/tabs/view.cljs b/src/quo/components/tabs/tabs/view.cljs index cd26e51aba23..74b8cb0451a2 100644 --- a/src/quo/components/tabs/tabs/view.cljs +++ b/src/quo/components/tabs/tabs/view.cljs @@ -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)]))) diff --git a/src/status_im/contexts/chat/messenger/messages/list/view.cljs b/src/status_im/contexts/chat/messenger/messages/list/view.cljs index 5cb3c3d9f9a0..515c7624a5e4 100644 --- a/src/status_im/contexts/chat/messenger/messages/list/view.cljs +++ b/src/status_im/contexts/chat/messenger/messages/list/view.cljs @@ -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 diff --git a/src/status_im/contexts/chat/messenger/messages/navigation/view.cljs b/src/status_im/contexts/chat/messenger/messages/navigation/view.cljs index 18adc97b3338..1d0d1350ed1a 100644 --- a/src/status_im/contexts/chat/messenger/messages/navigation/view.cljs +++ b/src/status_im/contexts/chat/messenger/messages/navigation/view.cljs @@ -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? diff --git a/src/status_im/contexts/profile/settings/events.cljs b/src/status_im/contexts/profile/settings/events.cljs index 310e44629626..cccac1f8c65d 100644 --- a/src/status_im/contexts/profile/settings/events.cljs +++ b/src/status_im/contexts/profile/settings/events.cljs @@ -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]] diff --git a/src/status_im/contexts/shell/activity_center/tabs/view.cljs b/src/status_im/contexts/shell/activity_center/tabs/view.cljs index 934224476d9a..7cb42260cb54 100644 --- a/src/status_im/contexts/shell/activity_center/tabs/view.cljs +++ b/src/status_im/contexts/shell/activity_center/tabs/view.cljs @@ -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 diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index 920720a83afe..36fffa907f27 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -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 diff --git a/src/status_im/navigation/core.cljs b/src/status_im/navigation/core.cljs index a2f6e59ac89f..6a16d6a0c6eb 100644 --- a/src/status_im/navigation/core.cljs +++ b/src/status_im/navigation/core.cljs @@ -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" diff --git a/src/status_im/navigation/effects.cljs b/src/status_im/navigation/effects.cljs index 740133018df4..90043dd1b642 100644 --- a/src/status_im/navigation/effects.cljs +++ b/src/status_im/navigation/effects.cljs @@ -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"))) diff --git a/src/status_im/navigation/view.cljs b/src/status_im/navigation/view.cljs index 602e3c35214e..a35ecf3487d6 100644 --- a/src/status_im/navigation/view.cljs +++ b/src/status_im/navigation/view.cljs @@ -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 diff --git a/src/status_im/subs/chats.cljs b/src/status_im/subs/chats.cljs index cf878bf5c22d..3409d22a26e0 100644 --- a/src/status_im/subs/chats.cljs +++ b/src/status_im/subs/chats.cljs @@ -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) diff --git a/src/status_im/subs/chats_test.cljs b/src/status_im/subs/chats_test.cljs index 060675bba0a3..3777d7700ea8 100644 --- a/src/status_im/subs/chats_test.cljs +++ b/src/status_im/subs/chats_test.cljs @@ -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))))) diff --git a/src/status_im/subs/general.cljs b/src/status_im/subs/general.cljs index 30faf425bb57..2f7026a0c176 100644 --- a/src/status_im/subs/general.cljs +++ b/src/status_im/subs/general.cljs @@ -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] diff --git a/yarn.lock b/yarn.lock index 75d251e77cb0..0851ad1502b9 100644 --- a/yarn.lock +++ b/yarn.lock @@ -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"