Skip to content

Commit 2d3b523

Browse files
committed
Show modal title and community context tag
1 parent aaf0b8e commit 2d3b523

File tree

4 files changed

+44
-23
lines changed

4 files changed

+44
-23
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
(ns status-im2.contexts.communities.actions.accounts-selection.style)
2+
3+
(def page-top
4+
{:padding-horizontal 20
5+
:padding-vertical 12})

src/status_im2/contexts/communities/actions/accounts_selection/view.cljs

+35-20
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
[react-native.core :as rn]
55
[react-native.gesture :as gesture]
66
[status-im2.common.password-authentication.view :as password-authentication]
7-
[status-im2.contexts.communities.actions.request-to-join.style :as style]
7+
[status-im2.contexts.communities.actions.accounts-selection.style :as style]
8+
[status-im2.contexts.communities.actions.request-to-join.style :as req-join.style]
89
[utils.i18n :as i18n]
910
[utils.re-frame :as rf]))
1011

@@ -17,24 +18,38 @@
1718
{:community-id id :password %}])}])
1819
(rf/dispatch [:navigate-back]))
1920

21+
(defn- page-top
22+
[{:keys [community-name logo-uri]}]
23+
[rn/view {:style style/page-top}
24+
[quo/text
25+
{:size :heading-1
26+
:weight :semi-bold}
27+
(i18n/label :t/request-to-join)]
28+
[quo/context-tag
29+
{:type :community
30+
:size 24
31+
:community-logo logo-uri
32+
:community-name community-name
33+
:container-style {:margin-top 8}}]])
34+
2035
(defn view
2136
[]
22-
(fn []
23-
(let [{:keys [_name
24-
id
25-
_images]} (rf/sub [:get-screen-params])]
26-
[rn/view {:flex 1}
27-
[gesture/scroll-view {:style {:flex 1}}
28-
[rn/view style/page-container
29-
[rn/view {:style (style/bottom-container)}
30-
[quo/button
31-
{:accessibility-label :cancel
32-
:on-press #(rf/dispatch [:navigate-back])
33-
:type :grey
34-
:container-style style/cancel-button}
35-
(i18n/label :t/cancel)]
36-
[quo/button
37-
{:accessibility-label :join-community-button
38-
:on-press #(join-community-and-navigate-back id)
39-
:container-style {:flex 1}}
40-
(i18n/label :t/request-to-join)]]]]])))
37+
(let [{id :community-id} (rf/sub [:get-screen-params])
38+
{:keys [name color images]} (rf/sub [:communities/community id])]
39+
[rn/view {:style {:flex 1}}
40+
[quo/page-nav
41+
{:text-align :left
42+
:icon-name :i/close
43+
:on-press #(rf/dispatch [:navigate-back])
44+
:accessibility-label :back-button}]
45+
[page-top
46+
{:community-name name
47+
:logo-uri (get-in images [:thumbnail :uri])}]
48+
[gesture/scroll-view {:style {:flex 1}}
49+
[rn/view req-join.style/page-container
50+
[quo/slide-button
51+
{:size 48
52+
:track-text (i18n/label :t/slide-to-request-to-join)
53+
:track-icon :i/face-id
54+
:customization-color color
55+
:on-complete #(join-community-and-navigate-back id)}]]]]))

src/status_im2/contexts/communities/overview/view.cljs

+2-2
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@
173173
(i18n/label :t/join-open-community)]])))
174174

175175
(defn join-community
176-
[{:keys [joined color permissions token-permissions] :as community}
176+
[{:keys [joined color permissions token-permissions id] :as community}
177177
pending?]
178178
(let [access-type (get-access-type (:access permissions))
179179
unknown-access? (= access-type :unknown-access)
@@ -185,7 +185,7 @@
185185
[quo/button
186186
{:on-press
187187
(if config/community-accounts-selection-enabled?
188-
#(rf/dispatch [:open-modal :community-account-selection community])
188+
#(rf/dispatch [:open-modal :community-account-selection {:community-id id}])
189189
#(rf/dispatch [:open-modal :community-requests-to-join community]))
190190

191191
:accessibility-label :show-request-to-join-screen-button

translations/en.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -1902,6 +1902,7 @@
19021902
"swap": "Swap",
19031903
"select-token-to-swap": "Select token to Swap",
19041904
"select-token-to-receive": "Select token to receive",
1905+
"slide-to-request-to-join": "Slide to request to join",
19051906
"slide-to-reveal-code": "Slide to reveal code",
19061907
"slide-to-create-account": "Slide to create account",
19071908
"minimum-received": "Minimum received",
@@ -2405,5 +2406,5 @@
24052406
"send-limit": "Max: {{limit}}",
24062407
"searching-for-activity": "Searching for activity...",
24072408
"this-address-has-no-activity": "This address has no activity",
2408-
"this-address-has-activity": "This address has activity"
2409+
"this-address-has-activity": "This address has activity"
24092410
}

0 commit comments

Comments
 (0)