mirror of
https://github.com/status-im/status-react.git
synced 2025-02-17 05:16:46 +00:00
Merge pull request #176 from status-im/bug/accounts-list-scroll
attempt to fix scroll in account's list Former-commit-id: 398ce6927e06ade253966f2add6cf00bd11af02f
This commit is contained in:
commit
4713385aa3
@ -2,6 +2,7 @@
|
|||||||
(:require-macros [status-im.utils.views :refer [defview]])
|
(:require-macros [status-im.utils.views :refer [defview]])
|
||||||
(:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
|
(:require [re-frame.core :refer [subscribe dispatch dispatch-sync]]
|
||||||
[status-im.components.react :refer [view
|
[status-im.components.react :refer [view
|
||||||
|
scroll-view
|
||||||
text
|
text
|
||||||
list-view
|
list-view
|
||||||
list-item
|
list-item
|
||||||
@ -55,26 +56,24 @@
|
|||||||
:start [0, 0]
|
:start [0, 0]
|
||||||
:end [0.5, 1]
|
:end [0.5, 1]
|
||||||
:locations [0, 0.8, 1]
|
:locations [0, 0.8, 1]
|
||||||
:style st/gradient-background}]
|
:style st/gradient-background}
|
||||||
[toolbar {:background-color :transparent
|
[toolbar {:background-color :transparent
|
||||||
:nav-action {:image {:source (if show-back? {:uri :icon_back_white} nil)
|
:nav-action {:image {:source (if show-back? {:uri :icon_back_white} nil)
|
||||||
:style icon-back}
|
:style icon-back}
|
||||||
:handler (if show-back? #(dispatch [:navigate-back]) nil)}
|
:handler (if show-back? #(dispatch [:navigate-back]) nil)}
|
||||||
:custom-content toolbar-title
|
:custom-content toolbar-title
|
||||||
:action {:image {:style icon-search}
|
:action {:image {:style icon-search}
|
||||||
:handler #()}}]
|
:handler #()}
|
||||||
[view st/accounts-container
|
:style st/toolbar}]
|
||||||
[view st/account-list-view-container
|
|
||||||
[list-view {:dataSource (lw/to-datasource accounts)
|
[list-view {:dataSource (lw/to-datasource accounts)
|
||||||
:enableEmptySections true
|
:enableEmptySections true
|
||||||
:renderRow render-row
|
:renderRow render-row
|
||||||
;:renderSeparator render-separator
|
:style st/account-list
|
||||||
:style st/account-list}]]]
|
:contentContainerStyle (st/account-list-content (count accounts))}]
|
||||||
[view st/add-account-button-container
|
[view st/add-account-button-container
|
||||||
[touchable-highlight {:on-press create-account}
|
[touchable-highlight {:on-press create-account
|
||||||
|
:accessibility-label :create-account}
|
||||||
[view st/add-account-button
|
[view st/add-account-button
|
||||||
[image {:source {:uri :icon_add}
|
[image {:source {:uri :icon_add}
|
||||||
:style st/icon-plus}]
|
:style st/icon-plus}]
|
||||||
[text {:style st/add-account-text} (label :t/add-account)]]]]]))
|
[text {:style st/add-account-text} (label :t/add-account)]]]]]]))
|
||||||
|
|
||||||
;(re-frame.core/dispatch [:set :view-id :users])
|
|
||||||
|
@ -4,7 +4,8 @@
|
|||||||
text1-color
|
text1-color
|
||||||
color-white
|
color-white
|
||||||
toolbar-background2
|
toolbar-background2
|
||||||
online-color]]))
|
online-color]]
|
||||||
|
[status-im.components.react :as r]))
|
||||||
|
|
||||||
|
|
||||||
(def screen-container
|
(def screen-container
|
||||||
@ -14,30 +15,20 @@
|
|||||||
(def gradient-background
|
(def gradient-background
|
||||||
{:position :absolute
|
{:position :absolute
|
||||||
:top 0
|
:top 0
|
||||||
:right 0
|
|
||||||
:bottom 0
|
|
||||||
:left 0})
|
|
||||||
|
|
||||||
(def account-list-container1
|
|
||||||
{:position :absolute
|
|
||||||
:top 56
|
|
||||||
:right 0
|
|
||||||
:bottom 0
|
:bottom 0
|
||||||
:left 0
|
:left 0
|
||||||
:justifyContent :center})
|
:right 0
|
||||||
|
:padding-bottom 84})
|
||||||
|
|
||||||
(def accounts-container
|
(defn account-list-content [cnt]
|
||||||
{:flex 1
|
(merge {:justifyContent :center}
|
||||||
:flex-direction :column
|
;; todo this will not work with landscape and looks bad
|
||||||
:justifyContent :center
|
(when (< (* 69 (+ 2 cnt)) (:height (r/get-dimensions "window")))
|
||||||
:padding-bottom 56})
|
{:flex 1})))
|
||||||
|
|
||||||
(def account-list-view-container
|
|
||||||
{:flexDirection :column
|
|
||||||
:justifyContent :center})
|
|
||||||
|
|
||||||
(def account-list
|
(def account-list
|
||||||
{})
|
{:margin-top 56
|
||||||
|
:height 100})
|
||||||
|
|
||||||
(def row-separator
|
(def row-separator
|
||||||
{:borderBottomWidth 1
|
{:borderBottomWidth 1
|
||||||
@ -112,3 +103,9 @@
|
|||||||
:color :white
|
:color :white
|
||||||
:fontSize 16
|
:fontSize 16
|
||||||
:marginLeft 8})
|
:marginLeft 8})
|
||||||
|
|
||||||
|
(def toolbar
|
||||||
|
{:position :absolute
|
||||||
|
:top 0
|
||||||
|
:left 0
|
||||||
|
:right 0})
|
||||||
|
@ -67,10 +67,11 @@
|
|||||||
[image {:source {:uri (keyword (str "icon_" (name n)))}
|
[image {:source {:uri (keyword (str "icon_" (name n)))}
|
||||||
:style style}]))
|
:style style}]))
|
||||||
|
|
||||||
(def linear-gradient-class (u/require "react-native-linear-gradient"))
|
(def linear-gradient-class
|
||||||
(defn linear-gradient [props]
|
(r/adapt-react-class (u/require "react-native-linear-gradient")))
|
||||||
(r/create-element linear-gradient-class
|
(defn linear-gradient
|
||||||
(clj->js (merge {:inverted true} props))))
|
[props & children]
|
||||||
|
(vec (concat [linear-gradient-class (merge {:inverted true} props)] children)))
|
||||||
|
|
||||||
|
|
||||||
(def platform
|
(def platform
|
||||||
|
Loading…
x
Reference in New Issue
Block a user