Skip to content

Commit

Permalink
Remove use of camel-snake-kebab from shell worklet (#17310)
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull authored Sep 18, 2023
1 parent 442600b commit 9df1b85
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
9 changes: 8 additions & 1 deletion src/js/worklets/shell/floating_screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,14 @@ export function screenGestureOnEnd(data) {
return function (event) {
'worklet';

const { screenLeft, screenState, screenWidth, leftVelocity, rightVelocity, screenClosedCallback } = data;
const {
'screen-left': screenLeft,
'screen-state': screenState,
'screen-width': screenWidth,
'left-velocity': leftVelocity,
'right-velocity': rightVelocity,
'screen-closed-callback': screenClosedCallback,
} = data;
const absoluteX = event.absoluteX ?? 0;
const velocityX = event.velocityX ?? 0;
const closeScreen = velocityX > rightVelocity || (velocityX > leftVelocity && absoluteX >= screenWidth / 2);
Expand Down
3 changes: 3 additions & 0 deletions src/status_im2/contexts/shell/jump_to/gesture.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#(rf/dispatch [:shell/navigate-back constants/close-screen-without-animation])
(or animation-time constants/shell-animation-time)))

;; Make sure issue is fixed before enabling gesture for floating screens
;; Issue: https://github.com/status-im/status-mobile/pull/16438#issuecomment-1621397789
;; More Info: https://github.com/status-im/status-mobile/pull/16438#issuecomment-1622589147
(defn floating-screen-gesture
[screen-id]
(let [{:keys [screen-left screen-state]} (get @state/shared-values-atom screen-id)
Expand Down
8 changes: 2 additions & 6 deletions src/utils/worklets/shell.cljs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
(ns utils.worklets.shell
(:require [utils.collection]
[camel-snake-kebab.core :as csk]))
(ns utils.worklets.shell)

(def bottom-tabs-worklets (js/require "../src/js/worklets/shell/bottom_tabs.js"))
(def home-stack-worklets (js/require "../src/js/worklets/shell/home_stack.js"))
Expand Down Expand Up @@ -96,6 +94,4 @@

(defn floating-screen-gesture-on-end
[data]
(.screenGestureOnEnd
^js floating-screen-worklets
(clj->js (utils.collection/map-keys csk/->camelCaseString data))))
(.screenGestureOnEnd ^js floating-screen-worklets (clj->js data)))

0 comments on commit 9df1b85

Please sign in to comment.