-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Community: Request to join - Show addresses shared (#18180)
- Loading branch information
1 parent
2a5c102
commit 5507ae4
Showing
5 changed files
with
90 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
src/status_im2/contexts/communities/actions/addresses_for_permissions/style.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
(ns status-im2.contexts.communities.actions.addresses-for-permissions.style | ||
(:require [quo.foundations.colors :as colors])) | ||
|
||
(def container {:flex 1}) | ||
|
||
(def account-item-container | ||
{:font-size 30 | ||
:border-radius 16 | ||
:flex-direction :row | ||
:border-width 1 | ||
:height 56 | ||
:padding-horizontal 12 | ||
:align-items :center | ||
:margin-bottom 8 | ||
:gap 8 | ||
:border-color colors/neutral-90}) | ||
|
||
(def buttons | ||
{:flex-direction :row | ||
:gap 12 | ||
:padding-horizontal 20 | ||
:padding-vertical 12}) |
58 changes: 58 additions & 0 deletions
58
src/status_im2/contexts/communities/actions/addresses_for_permissions/view.cljs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
(ns status-im2.contexts.communities.actions.addresses-for-permissions.view | ||
(:require [quo.core :as quo] | ||
[react-native.core :as rn] | ||
[status-im2.common.not-implemented :as not-implemented] | ||
[status-im2.contexts.communities.actions.addresses-for-permissions.style :as style] | ||
[utils.i18n :as i18n] | ||
[utils.re-frame :as rf])) | ||
|
||
(defn- account-item | ||
[item] | ||
[rn/view | ||
{:style style/account-item-container} | ||
[quo/account-avatar (assoc item :size 32)] | ||
[rn/view | ||
[quo/text | ||
{:size :paragraph-1 | ||
:weight :semi-bold} | ||
(:name item)] | ||
[quo/address-text | ||
{:address (:address item) | ||
:format :short}]]]) | ||
|
||
(defn view | ||
[] | ||
(let [{id :community-id} (rf/sub [:get-screen-params]) | ||
{:keys [name color images]} (rf/sub [:communities/community id]) | ||
accounts (->> (rf/sub [:wallet]) | ||
:accounts | ||
vals | ||
(map #(assoc % :customization-color (:color %))))] | ||
[rn/safe-area-view {:style style/container} | ||
|
||
[quo/drawer-top | ||
{:type :context-tag | ||
:title (i18n/label :t/addresses-for-permissions) | ||
:community-name name | ||
:button-icon :i/info | ||
:on-button-press not-implemented/alert | ||
:community-logo (get-in images [:thumbnail :uri]) | ||
:customization-color color}] | ||
|
||
[rn/flat-list | ||
{:render-fn account-item | ||
:content-container-style {:padding 20} | ||
:key-fn :key-uid | ||
:data accounts}] | ||
|
||
[rn/view {:style style/buttons} | ||
[quo/button | ||
{:type :grey | ||
:container-style {:flex 1} | ||
:on-press #(rf/dispatch [:navigate-back])} | ||
(i18n/label :t/cancel)] | ||
[quo/button | ||
{:container-style {:flex 1} | ||
:customization-color color | ||
:on-press #(rf/dispatch [:navigate-back])} | ||
(i18n/label :t/confirm-changes)]]])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters