Skip to content

Commit

Permalink
fix issue 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Parveshdhull committed May 23, 2024
1 parent 4194fc9 commit a9800f5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/status_im/contexts/chat/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,9 @@
[cofx chat-id animation]
(rf/merge
cofx
(navigation/pop-to-root :shell-stack)
(navigate-to-chat chat-id animation)))
{:dispatch-later {:ms 500
:dispatch [:chat/navigate-to-chat chat-id animation]}}
(navigation/pop-to-root :shell-stack)))

(rf/defn handle-clear-history-response
{:events [:chat/history-cleared]}
Expand Down
2 changes: 1 addition & 1 deletion src/status_im/contexts/communities/events.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@
[:dispatch
[:chat/navigate-to-chat chat-id
(when-not (ff/enabled? ::ff/shell.jump-to)
transitions/stack-slide-animation)]])]}
transitions/stack-slide-transition)]])]}
(when-not (get-in db [:chats chat-id :community-id])
{:db (assoc-in db [:chats chat-id :community-id] community-id)}))))

Expand Down
4 changes: 3 additions & 1 deletion src/status_im/navigation/screens.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@
:component shell-qr-reader/view}

{:name :chat
:options {:popGesture false}
:options {:popGesture false
:animations transitions/stack-transition-from-bottom}
:component chat/chat}

{:name :start-a-new-chat
Expand Down Expand Up @@ -211,6 +212,7 @@
:component communities.discover/view}

{:name :community-overview
:options {:animations transitions/stack-transition-from-bottom}
:component communities.overview/view}

{:name :settings
Expand Down
6 changes: 4 additions & 2 deletions src/status_im/navigation/state.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@

(defn navigation-state-push
[component]
(swap! navigation-state conj component)
(update-view-id))
(when-let [view-id (:id (last (get-navigation-state)))]
(when-not (= view-id (:id component))
(swap! navigation-state conj component)
(update-view-id))))

(defn navigation-state-pop
[]
Expand Down
10 changes: 9 additions & 1 deletion src/status_im/navigation/transitions.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,18 @@
:duration constants/onboarding-modal-animation-duration}}})

;;;; Stack Transitions
(def stack-slide-animation
(def stack-slide-transition
{:push {:content {:translationX {:from (:width (rn/get-window))
:to 0
:duration 200}}}
:pop {:content {:translationX {:from 0
:to (:width (rn/get-window))
:duration 200}}}})

(def stack-transition-from-bottom
{:push {:content {:translationY {:from (:height (rn/get-window))
:to 0
:duration 200}}}
:pop {:content {:translationY {:from 0
:to (:height (rn/get-window))
:duration 200}}}})

0 comments on commit a9800f5

Please sign in to comment.