Addresses to share cards (#18123)

This commit is contained in:
Ajay Sivan 2023-12-11 14:23:14 +05:30 committed by GitHub
parent 1eb7504c12
commit 3cd230fed0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 46 additions and 14 deletions

View File

@ -11,8 +11,9 @@
{:padding-vertical 12
:padding-horizontal screen-horizontal-padding})
(def content
{:margin-bottom 20
(def section-title
{:padding-top 12
:padding-bottom 4
:padding-horizontal screen-horizontal-padding})
(defn bottom-actions

View File

@ -3,6 +3,7 @@
[quo.core :as quo]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[status-im2.common.not-implemented :as not-implemented]
[status-im2.common.password-authentication.view :as password-authentication]
[status-im2.contexts.communities.actions.accounts-selection.style :as style]
[status-im2.contexts.communities.actions.community-rules.view :as community-rules]
@ -35,7 +36,11 @@
(defn view
[]
(let [{id :community-id} (rf/sub [:get-screen-params])
{:keys [name color images]} (rf/sub [:communities/community id])]
{:keys [name color images]} (rf/sub [:communities/community id])
accounts (->> (rf/sub [:wallet])
:accounts
vals
(map #(assoc % :customization-color (:color %))))]
[rn/view {:style style/container}
[quo/page-nav
{:text-align :left
@ -46,9 +51,35 @@
{:community-name name
:logo-uri (get-in images [:thumbnail :uri])}]
[gesture/scroll-view
[rn/view {:style style/content}
[:<>
[quo/text
{:style {:margin-top 24}
{:style style/section-title
:accessibility-label :community-rules-title
:weight :semi-bold
:size :paragraph-1}
(i18n/label :t/address-to-share)]
[quo/category
{:list-type :settings
:data [{:title (i18n/label :t/join-as-a-member)
:on-press not-implemented/alert
:description :text
:action :arrow
:label :preview
:label-props {:type :accounts
:data accounts}
:description-props {:text (i18n/label :t/all-addresses)}}
{:title (i18n/label :t/for-airdrops)
:on-press not-implemented/alert
:description :text
:action :arrow
:label :preview
:label-props {:type :accounts
:data (take 1 accounts)}
:description-props {:text (-> accounts first :name)}}]}]
[quo/text
{:style style/section-title
:accessibility-label :community-rules-title
:weight :semi-bold
:size :paragraph-1}

View File

@ -1,10 +1,7 @@
(ns status-im2.contexts.communities.actions.community-rules.style)
(def community-rule
{:flex 1
:align-items :flex-start
:margin-top 16})
(def community-rule-text
{:margin-left 6
:flex 1})
{:flex 1
:align-items :flex-start
:padding-vertical 8
:padding-horizontal 20})

View File

@ -10,7 +10,6 @@
(let [rules (rf/sub [:communities/rules id])]
[rn/view {:style style/community-rule}
[quo/text
{:style style/community-rule-text
:weight :regular
{:weight :regular
:size :paragraph-2}
rules]]))

View File

@ -177,6 +177,10 @@
"other": "{{count}} members"
},
"community-rules": "Community rules",
"address-to-share": "Addresses to share",
"join-as-a-member": "Join as a Member",
"all-addresses": "All addresses",
"for-airdrops": "For airdrops",
"members-label": "Members",
"open-membership": "Open membership",
"member-kick": "Kick member",