|
10 | 10 | [status-im.common.home.header-spacing.view :as common.header-spacing] |
11 | 11 | [status-im.common.resources :as resources] |
12 | 12 | [status-im.config :as config] |
| 13 | + [status-im.constants :as constants] |
13 | 14 | [status-im.contexts.communities.actions.community-options.view :as options] |
14 | | - [status-im.contexts.communities.actions.home-plus.view :as actions.home-plus] |
15 | 15 | [status-im.contexts.shell.constants :as shell.constants] |
16 | 16 | [utils.debounce :as debounce] |
17 | 17 | [utils.i18n :as i18n] |
|
26 | 26 | [quo/communities-membership-list-item |
27 | 27 | {:customization-color customization-color |
28 | 28 | :style {:padding-horizontal 20} |
29 | | - :on-press #(debounce/throttle-and-dispatch [:communities/navigate-to-community-overview |
30 | | - id] |
31 | | - 500) |
| 29 | + :on-press #(debounce/throttle-and-dispatch |
| 30 | + [:communities/navigate-to-community-overview id] |
| 31 | + 500) |
32 | 32 | :on-long-press #(rf/dispatch |
33 | 33 | [:show-bottom-sheet |
34 | 34 | {:content (fn [] |
|
43 | 43 | {:id :pending :label (i18n/label :t/pending) :accessibility-label :pending-tab} |
44 | 44 | {:id :opened :label (i18n/label :t/opened) :accessibility-label :opened-tab}]) |
45 | 45 |
|
| 46 | +(defn- community-creation-options-testing |
| 47 | + [] |
| 48 | + [rn/view {:style {:padding-vertical 12 :row-gap 12}} |
| 49 | + [quo/divider-line] |
| 50 | + [rn/view |
| 51 | + [quo/action-drawer |
| 52 | + [[{:icon :i/communities |
| 53 | + :accessibility-label :create-closed-community |
| 54 | + :label "Create closed community (only for testing)" |
| 55 | + :on-press #(rf/dispatch [:fast-create-community/create-closed-community])} |
| 56 | + {:icon :i/communities |
| 57 | + :accessibility-label :create-open-community |
| 58 | + :label "Create open community (only for testing)" |
| 59 | + :on-press #(rf/dispatch [:fast-create-community/create-open-community])} |
| 60 | + {:icon :i/communities |
| 61 | + :accessibility-label :create-token-gated-community |
| 62 | + :label "Create token-gated community (only for testing)" |
| 63 | + :on-press #(rf/dispatch |
| 64 | + [:fast-create-community/create-token-gated-community])}]]]]]) |
| 65 | + |
| 66 | +(defn- open-learn-more-link |
| 67 | + [] |
| 68 | + (rf/dispatch [:hide-bottom-sheet]) |
| 69 | + (rf/dispatch |
| 70 | + [:browser.ui/open-url constants/create-community-help-url])) |
| 71 | + |
| 72 | +(defn- hide-bottom-sheet |
| 73 | + [] |
| 74 | + (rf/dispatch [:hide-bottom-sheet])) |
| 75 | + |
| 76 | +(defn- create-community-sheet |
| 77 | + [] |
| 78 | + (let [customization-color (rf/sub [:profile/customization-color])] |
| 79 | + [:<> |
| 80 | + [quo/drawer-top {:title (i18n/label :t/want-to-create-community)}] |
| 81 | + [quo/text {:style {:padding-horizontal 20 :padding-bottom 12}} |
| 82 | + (i18n/label :t/communities-only-available-in-desktop)] |
| 83 | + [quo/bottom-actions |
| 84 | + {:actions :two-actions |
| 85 | + :button-one-label (i18n/label :t/learn-more) |
| 86 | + :button-one-props {:disabled? false |
| 87 | + :customization-color customization-color |
| 88 | + :on-press open-learn-more-link |
| 89 | + :icon-right :i/external} |
| 90 | + :button-two-label (i18n/label :t/maybe-later) |
| 91 | + :button-two-props {:type :grey |
| 92 | + :on-press hide-bottom-sheet}}] |
| 93 | + (when config/fast-create-community-enabled? |
| 94 | + [community-creation-options-testing])])) |
| 95 | + |
46 | 96 | (defn empty-state-content |
47 | 97 | [theme] |
48 | 98 | {:joined |
|
66 | 116 | {:title-props |
67 | 117 | {:beta? true |
68 | 118 | :label (i18n/label :t/communities) |
69 | | - :handler (when config/fast-create-community-enabled? |
70 | | - #(rf/dispatch [:show-bottom-sheet {:content actions.home-plus/view}])) |
| 119 | + :handler #(rf/dispatch [:show-bottom-sheet {:content create-community-sheet}]) |
71 | 120 | :accessibility-label :new-communities-button} |
72 | 121 | :card-props |
73 | 122 | {:on-press #(rf/dispatch [:navigate-to :screen/discover-communities]) |
|
0 commit comments