Remove use of camel-snake-kebab from shell worklet (#17310)

This commit is contained in:
Parvesh Monu 2023-09-18 16:51:39 +05:30 committed by GitHub
parent 442600bc28
commit 9df1b854bd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -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);

View File

@ -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)

View File

@ -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"))
@ -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)))