|
4 | 4 | [react-native.core :as rn]
|
5 | 5 | [react-native.gesture :as gesture]
|
6 | 6 | [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] |
8 | 9 | [utils.i18n :as i18n]
|
9 | 10 | [utils.re-frame :as rf]))
|
10 | 11 |
|
|
17 | 18 | {:community-id id :password %}])}])
|
18 | 19 | (rf/dispatch [:navigate-back]))
|
19 | 20 |
|
| 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 | + |
20 | 35 | (defn view
|
21 | 36 | []
|
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)}]]]])) |
0 commit comments