Skip to content

Commit

Permalink
properly nuke old code this time
Browse files Browse the repository at this point in the history
  • Loading branch information
siddarthkay committed Oct 16, 2023
1 parent 33ae80d commit bf2dbe0
Showing 1 changed file with 2 additions and 109 deletions.
111 changes: 2 additions & 109 deletions src/quo/components/bottom_sheet/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@

(defn bottom-sheet-hooks
[props]
(let [{; on-cancel :onCancel
disable-drag? :disableDrag?
(let [{disable-drag? :disableDrag?
show-handle? :showHandle?
visible? :visible?
backdrop-dismiss? :backdropDismiss?
Expand Down Expand Up @@ -51,19 +50,14 @@
;; implemented
;; https://github.com/wix/react-native-navigation/issues/7225
0))
; min-height (+ (* styles/vertical-padding 2) (:bottom safe-area))
max-height (- window-height (:top safe-area))
visible (react/state false)

master-translation-y 0
master-velocity-y (animated/use-value (:undetermined gesture-handler/states))
master-state (animated/use-value (:undetermined gesture-handler/states))
tap-state 0
; manual-open 0
manual-close 0
; offset 0
; drag-over 1
; clock (animated/use-clock)
tap-gesture-handler (animated/use-gesture {:state tap-state})
on-master-event (animated/use-gesture
{:translationY master-translation-y
Expand All @@ -72,105 +66,10 @@
on-body-event on-master-event
sheet-height (min max-height
(+ styles/border-radius @height))

; open-snap-point (animated/use-value 0)
; close-snap-point 0
; on-close (fn []
; (when @visible
; (reset! visible false)
; (reset! height 0)
; (when on-cancel
; (on-cancel))))
close-sheet (fn []
(animated/set-value manual-close 1))
; on-snap (fn [pos]
; (when (= close-snap-point (aget pos 0))
; (on-close)))
; interrupted (animated/and* (animated/eq master-state (:began gesture-handler/states))
; (animated/clock-running clock))
; translate-y (react/use-memo
; (fn []
; (animated/with-easing
; {:value (animated/cond* (animated/less-or-eq
; master-translation-y 0)
; (animated/divide master-translation-y
; 2)
; master-translation-y)
; :velocity master-velocity-y
; :offset offset
; :state master-state
; :animation-over drag-over
; :snap-points [open-snap-point close-snap-point]}))
; [])
opacity 0.3
; (react/use-memo
; (fn []
; (animated/cond*
; open-snap-point
; (animated/interpolate
; translate-y
; {:inputRange [(* open-snap-point opacity-coeff) 0]
; :outputRange [1 0]
; :extrapolate (:clamp animated/extrapolate)})))
; [])
]
; (animated/code!
; (fn []
; (animated/cond* (animated/and* (animated/eq master-state (:end gesture-handler/states))
; (animated/not* drag-over))
; (animated/call* [translate-y] on-snap)))
; [on-snap])
; (animated/code!
; (fn []
; (animated/block
; [(animated/cond* (animated/and* interrupted manual-open)
; [(animated/set manual-open 0)
; (animated/set offset open-snap-point)
; (animated/stop-clock clock)])
; (animated/cond* (animated/and* manual-open
; (animated/not* manual-close))
; [(animated/set offset
; (animated/re-spring {:from offset
; :to open-snap-point
; :clock clock
; :config spring-config}))
; (animated/cond* (animated/not* (animated/clock-running clock))
; (animated/set manual-open 0))])]))
; [])
; (animated/code!
; (fn []
; (animated/block
; [(animated/cond* (animated/and* interrupted manual-close)
; [(animated/set manual-close 0)
; (animated/set offset close-snap-point)
; (animated/call* [] on-close)
; (animated/stop-clock clock)])
; (animated/cond* (animated/eq tap-state (:end gesture-handler/states))
; [(animated/cond* (animated/and* (animated/not* manual-close))
; [(animated/stop-clock clock)
; (animated/set manual-close 1)])
; (animated/set tap-state (:undetermined gesture-handler/states))])
; (animated/cond* manual-close
; [(animated/set offset
; (animated/re-timing {:from offset
; :to close-snap-point
; :clock clock
; :easing (:ease-out animated/easings)
; :duration close-duration}))
; (animated/cond* (animated/not* (animated/clock-running clock))
; [(animated/set manual-close 0)
; (animated/set manual-open 0)
; (animated/call* [] on-close)])])]))
; [on-cancel])
; (animated/code!
; (fn []
; (animated/cond* (animated/and* (animated/not* manual-close)
; (if @visible 1 0)
; (if (> @height min-height) 1 0))
; [(animated/stop-clock clock)
; (animated/set open-snap-point (* -1 sheet-height))
; (animated/set manual-open 1)]))
; [@height @visible])
;; NOTE(Ferossgp): Remove me when RNGH will suport modal
(rn/use-back-handler
(fn []
Expand Down Expand Up @@ -201,13 +100,7 @@
{:opacity opacity
:background-color (:backdrop @colors/theme)}))}]]
[animated/view
{:style (merge (styles/content-container window-height)
; {:transform [{:translateY (if (= sheet-height max-height)
; (+ translate-y
; keyboard-height-android-delta)
; translate-y)}
; {:translateY (* window-height 2)}]}
)}
{:style (merge (styles/content-container window-height))}
[gesture-handler/pan-gesture-handler
(merge on-master-event
{:ref master-ref
Expand Down

0 comments on commit bf2dbe0

Please sign in to comment.