From 1905530044a5405620adc8bc3721488ad91ec69f Mon Sep 17 00:00:00 2001 From: Julien Eluard Date: Wed, 28 Feb 2018 15:02:17 +0100 Subject: [PATCH] [ISSUE #3312] Implemented invite friends feature Signed-off-by: Julien Eluard --- src/status_im/translations/en.cljs | 1 + src/status_im/ui/screens/add_new/views.cljs | 29 ++++++++++++--------- 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/src/status_im/translations/en.cljs b/src/status_im/translations/en.cljs index 90932e4447..18b4cdf5ed 100644 --- a/src/status_im/translations/en.cljs +++ b/src/status_im/translations/en.cljs @@ -172,6 +172,7 @@ :start-new-chat "Start new chat" :start-group-chat "Start group chat" :invite-friends "Invite friends" + :get-status-at "Get Status at http://status.im?refCode={{address}}" :chats "Chats" :delete-chat "Delete chat" :group-chat "Group chat" diff --git a/src/status_im/ui/screens/add_new/views.cljs b/src/status_im/ui/screens/add_new/views.cljs index 52bbf16f66..d3b4e52bbb 100644 --- a/src/status_im/ui/screens/add_new/views.cljs +++ b/src/status_im/ui/screens/add_new/views.cljs @@ -1,16 +1,18 @@ (ns status-im.ui.screens.add-new.views - (:require-macros [status-im.utils.views :refer [defview letsubs]]) + (:require-macros [status-im.utils.views :as views]) (:require [re-frame.core :as re-frame] + [status-im.i18n :as i18n] [status-im.ui.components.action-button.action-button :as action-button] [status-im.ui.components.action-button.styles :as action-button.styles] - [status-im.ui.components.react :as react] [status-im.ui.components.colors :as colors] + [status-im.ui.components.common.common :as common] + [status-im.ui.components.list-selection :as list-selection] + [status-im.ui.components.react :as react] + [status-im.ui.components.styles :as styles] [status-im.ui.components.status-bar.view :as status-bar] - [status-im.i18n :as i18n] - [status-im.ui.components.toolbar.view :as toolbar.view] - [status-im.ui.components.common.common :as components])) + [status-im.ui.components.toolbar.view :as toolbar])) -(defn options-list [] +(defn- options-list [{:keys [address]}] [react/view action-button.styles/actions-list [action-button/action-button {:label (i18n/label :t/start-new-chat) @@ -40,11 +42,12 @@ {:label (i18n/label :t/invite-friends) :icon :icons/share :icon-opts {:color colors/blue} - :on-press #()}]]) + :on-press #(list-selection/open-share {:message (i18n/label :t/get-status-at {:address address})})}]]) -(defview add-new [] - [react/view {:flex 1 :background-color :white} - [status-bar/status-bar] - [toolbar.view/simple-toolbar (i18n/label :t/new)] - [components/separator] - [options-list]]) \ No newline at end of file +(views/defview add-new [] + (views/letsubs [account [:get-current-account]] + [react/view {:flex 1 :background-color :white} + [status-bar/status-bar] + [toolbar/simple-toolbar (i18n/label :t/new)] + [common/separator] + [options-list account]]))