diff --git a/src/js/worklets/shell/floating_screen.js b/src/js/worklets/shell/floating_screen.js index 654edea2b4..2e8958f37c 100644 --- a/src/js/worklets/shell/floating_screen.js +++ b/src/js/worklets/shell/floating_screen.js @@ -88,3 +88,21 @@ export function screenZIndex(screenState) { } }); } + +export function screenBorderRadius(screenState) { + return useDerivedValue(function () { + 'worklet'; + switch (screenState.value) { + case constants.OPEN_SCREEN_WITH_SHELL_ANIMATION: + return withDelay(constants.SHELL_ANIMATION_TIME, withTiming(0, { duration: 0 })); + case constants.OPEN_SCREEN_WITH_SLIDE_ANIMATION: + case constants.OPEN_SCREEN_WITHOUT_ANIMATION: + return 0; + case constants.CLOSE_SCREEN_WITH_SLIDE_ANIMATION: + return withDelay(constants.SHELL_ANIMATION_TIME, withTiming(20, { duration: 0 })); + case constants.CLOSE_SCREEN_WITHOUT_ANIMATION: + case constants.CLOSE_SCREEN_WITH_SHELL_ANIMATION: + return 20; + } + }); +} diff --git a/src/status_im2/contexts/shell/jump_to/components/floating_screens/style.cljs b/src/status_im2/contexts/shell/jump_to/components/floating_screens/style.cljs index cdf8a4563f..fc63aaaa9a 100644 --- a/src/status_im2/contexts/shell/jump_to/components/floating_screens/style.cljs +++ b/src/status_im2/contexts/shell/jump_to/components/floating_screens/style.cljs @@ -3,13 +3,14 @@ [react-native.reanimated :as reanimated])) (defn screen - [{:keys [screen-left screen-top screen-width screen-height screen-z-index]}] + [{:keys [screen-left screen-top screen-width screen-height screen-border-radius screen-z-index]}] (reanimated/apply-animations-to-style - {:left screen-left - :top screen-top - :width screen-width - :height screen-height - :z-index screen-z-index} + {:left screen-left + :top screen-top + :width screen-width + :height screen-height + :border-radius screen-border-radius + :z-index screen-z-index} {:background-color (colors/theme-colors colors/white colors/neutral-95) :overflow :hidden :position :absolute})) diff --git a/src/status_im2/contexts/shell/jump_to/shared_values.cljs b/src/status_im2/contexts/shell/jump_to/shared_values.cljs index 6d4058fa0f..e8837eeb63 100644 --- a/src/status_im2/contexts/shell/jump_to/shared_values.cljs +++ b/src/status_im2/contexts/shell/jump_to/shared_values.cljs @@ -84,16 +84,19 @@ (if (utils/floating-screen-open? screen-id) shell.constants/open-screen-without-animation shell.constants/close-screen-without-animation))] - {:screen-state screen-state - :screen-left (worklets.shell/floating-screen-left screen-state width switcher-card-left-position) - :screen-top (worklets.shell/floating-screen-top screen-state switcher-card-top-position) - :screen-z-index (worklets.shell/floating-screen-z-index screen-state) - :screen-width (worklets.shell/floating-screen-width screen-state - width - shell.constants/switcher-card-size) - :screen-height (worklets.shell/floating-screen-height screen-state - height - shell.constants/switcher-card-size)})) + {:screen-state screen-state + :screen-left (worklets.shell/floating-screen-left screen-state + width + switcher-card-left-position) + :screen-top (worklets.shell/floating-screen-top screen-state switcher-card-top-position) + :screen-z-index (worklets.shell/floating-screen-z-index screen-state) + :screen-width (worklets.shell/floating-screen-width screen-state + width + shell.constants/switcher-card-size) + :screen-border-radius (worklets.shell/floating-screen-border-radius screen-state) + :screen-height (worklets.shell/floating-screen-height screen-state + height + shell.constants/switcher-card-size)})) (defn calculate-and-set-shared-values [] diff --git a/src/utils/worklets/shell.cljs b/src/utils/worklets/shell.cljs index ff00299f71..af8c5a67c2 100644 --- a/src/utils/worklets/shell.cljs +++ b/src/utils/worklets/shell.cljs @@ -80,6 +80,10 @@ [screen-state screen-height switcher-card-size] (.screenHeight ^js floating-screen-worklets screen-state screen-height switcher-card-size)) +(defn floating-screen-border-radius + [screen-state] + (.screenBorderRadius ^js floating-screen-worklets screen-state)) + (defn floating-screen-z-index [screen-state] (.screenZIndex ^js floating-screen-worklets screen-state))