Skip to content

Commit

Permalink
Merge branch 'develop' into feat/biometrics-new-settings
Browse files Browse the repository at this point in the history
  • Loading branch information
clauxx authored Dec 21, 2023
2 parents a8696f7 + e59e34d commit 530907d
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
[quo.core :as quo]
[react-native.core :as rn]
[react-native.gesture :as gesture]
[status-im.common.not-implemented :as not-implemented]
[status-im.common.password-authentication.view :as password-authentication]
[status-im.contexts.communities.actions.accounts-selection.style :as style]
[status-im.contexts.communities.actions.community-rules.view :as community-rules]
Expand Down Expand Up @@ -58,7 +57,6 @@
: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)
Expand All @@ -71,14 +69,14 @@
:data accounts}
:description-props {:text (i18n/label :t/all-addresses)}}
{:title (i18n/label :t/for-airdrops)
:on-press not-implemented/alert
:on-press #(rf/dispatch [:open-modal :airdrop-addresses
{:community-id id}])
:description :text
:action :arrow
:label :preview
:label-props {:type :accounts
:data (take 1 accounts)}
:data [(first accounts)]}
:description-props {:text (-> accounts first :name)}}]}]

[quo/text
{:style style/section-title
:accessibility-label :community-rules-title
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
(ns status-im.contexts.communities.actions.airdrop-addresses.style)

(def account-list-container
{:flex 1
:padding-top 12
:padding-bottom 8})
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
(ns status-im.contexts.communities.actions.airdrop-addresses.view
(:require
[quo.core :as quo]
[react-native.core :as rn]
[status-im.common.not-implemented :as not-implemented]
[status-im.contexts.communities.actions.airdrop-addresses.style :as style]
[utils.i18n :as i18n]
[utils.re-frame :as rf]))

(defn- render-item
[item]
[quo/account-item
{:account-props item
:emoji (:emoji item)}])

(defn- accounts-list
[{:keys [accounts]}]
[rn/view {:style style/account-list-container}
(when (seq accounts)
[rn/flat-list
{:data accounts
:render-fn render-item
:key-fn :address}])])

(defn view
[]
(let [{id :community-id} (rf/sub [:get-screen-params])
{:keys [name images color]} (rf/sub [:communities/community id])
logo-uri (get-in images [:thumbnail :uri])
accounts (->> (rf/sub [:wallet])
:accounts
vals
(map #(assoc % :customization-color (:color %))))]
[:<>
[quo/drawer-top
{:type :context-tag
:title (i18n/label :t/airdrop-addresses)
:community-name name
:button-icon :i/info
:on-button-press not-implemented/alert
:community-logo (get-in images [:thumbnail :uri])
:customization-color color}]
[accounts-list
{:accounts accounts
:logo-uri logo-uri
:community-name name}]]))
5 changes: 5 additions & 0 deletions src/status_im/navigation/screens.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
[status-im.contexts.communities.actions.accounts-selection.view :as communities.accounts-selection]
[status-im.contexts.communities.actions.addresses-for-permissions.view :as
addresses-for-permissions]
[status-im.contexts.communities.actions.airdrop-addresses.view :as airdrop-addresses]
[status-im.contexts.communities.actions.request-to-join.view :as join-menu]
[status-im.contexts.communities.discover.view :as communities.discover]
[status-im.contexts.communities.overview.view :as communities.overview]
Expand Down Expand Up @@ -105,6 +106,10 @@
:options {:sheet? true}
:component addresses-for-permissions/view}

{:name :airdrop-addresses
:options {:sheet? true}
:component airdrop-addresses/view}

{:name :lightbox
:options options/lightbox
:component lightbox/lightbox}
Expand Down
1 change: 1 addition & 0 deletions translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
"address-to-share": "Addresses to share",
"addresses-for-permissions": "Addresses for permissions",
"confirm-changes": "Confirm changes",
"airdrop-addresses": "Address for airdrops",
"join-as-a-member": "Join as a Member",
"all-addresses": "All addresses",
"for-airdrops": "For airdrops",
Expand Down

0 comments on commit 530907d

Please sign in to comment.