diff --git a/src/status_im/communities/core.cljs b/src/status_im/communities/core.cljs index e77c363bd7..f24c21e343 100644 --- a/src/status_im/communities/core.cljs +++ b/src/status_im/communities/core.cljs @@ -9,12 +9,18 @@ [status-im.utils.fx :as fx] [status-im.constants :as constants] [status-im.bottom-sheet.core :as bottom-sheet] + [status-im.utils.universal-links.core :as universal-links] [status-im.ethereum.json-rpc :as json-rpc] [status-im.ui.components.colors :as colors] [status-im.navigation :as navigation])) (def crop-size 1000) +(defn universal-link [community-id] + (str (:external universal-links/domains) + "/c/" + community-id)) + (def featured [{:name "Status" :id constants/status-community-id}]) diff --git a/src/status_im/ui/screens/communities/community.cljs b/src/status_im/ui/screens/communities/community.cljs index 328dd72975..5a8b88b71a 100644 --- a/src/status_im/ui/screens/communities/community.cljs +++ b/src/status_im/ui/screens/communities/community.cljs @@ -91,7 +91,7 @@ [:<> [quo/list-item {:title name - :subtitle (i18n/label :t/view-profile) + :subtitle (i18n/label :t/community-info) :on-press #(hide-sheet-and-dispatch [:navigate-to :community-management {:community-id id}]) :chevron true :icon (cond diff --git a/src/status_im/ui/screens/communities/profile.cljs b/src/status_im/ui/screens/communities/profile.cljs index 684479717a..b117a158d4 100644 --- a/src/status_im/ui/screens/communities/profile.cljs +++ b/src/status_im/ui/screens/communities/profile.cljs @@ -4,6 +4,7 @@ [status-im.ui.components.profile-header.view :as profile-header] [status-im.i18n.i18n :as i18n] [reagent.core :as reagent] + [status-im.ui.components.copyable-text :as copyable-text] [status-im.communities.core :as communities] [status-im.ui.components.colors :as colors] [status-im.ui.components.react :as react] @@ -47,6 +48,20 @@ [quo/list-footer {:color :main} description] [quo/separator {:style {:margin-vertical 8}}]]) + [:<> + (let [link (communities/universal-link community-id)] + [react/view {:padding-vertical 10 + :padding-horizontal 16} + [react/view {:margin-bottom 20} + [quo/text {:color :secondary} (i18n/label :t/community-link)]] + [copyable-text/copyable-text-view + {:copied-text link} + [react/view {:border-radius 16 + :padding-horizontal 16 + :padding-vertical 11 + :background-color colors/blue-light} + [quo/text {:color :link} (subs link 8)]]]]) + [quo/separator {:style {:margin-vertical 8}}]] (when show-members-count? [quo/list-item {:chevron true :accessory @@ -89,6 +104,3 @@ :component-did-mount (fn [] (communities/fetch-requests-to-join! (get-in route [:route :params :community-id]))) :reagent-render management})) - - - diff --git a/translations/en.json b/translations/en.json index f2f73ce74d..66a997dcf9 100644 --- a/translations/en.json +++ b/translations/en.json @@ -194,6 +194,7 @@ "community-image-delete": "", "community-image-remove": "Remove", "community-color": "Community colour", + "community-link": "Community link", "community-color-placeholder": "Pick a colour", "membership-button": "Membership requirement", "membership-none": "None", @@ -1523,6 +1524,7 @@ "community": "Community", "verified-community": "✓ Verified community", "community-info-not-found": "Community information not found", + "community-info": "Community info", "not-found": "Not found", "activity": "Activity", "reject-and-delete": "Reject and delete",