Skip to content

Commit

Permalink
[#17393] fix: improve flat-list performance
Browse files Browse the repository at this point in the history
  • Loading branch information
mohsen-ghafouri committed Dec 20, 2023
1 parent 6968e2d commit 43d1ec8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/status_im/contexts/profile/settings/view.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,10 @@
:icon-left :i/log-out}
(i18n/label :t/logout)]])

(defn- get-item-layout
[_ index]
#js {:length 48 :offset (* 48 index) :index index})

(defn- settings-view
[theme]
(let [insets (safe-area/get-insets)
Expand All @@ -60,6 +64,9 @@
:header [settings.header/view {:scroll-y scroll-y}]
:data settings.items/items
:key-fn :title
:get-item-layout get-item-layout
:initial-num-to-render 6
:max-to-render-per-batch 6
:shows-vertical-scroll-indicator false
:render-fn settings-item-view
:footer [footer logout-press]
Expand Down

0 comments on commit 43d1ec8

Please sign in to comment.