From 810ca1f93a6d98c7a6ac1cafa73d809b02c42599 Mon Sep 17 00:00:00 2001 From: Dmitry Novotochinov Date: Tue, 19 Jun 2018 14:56:40 +0300 Subject: [PATCH] Add Help Center Signed-off-by: Igor Mandrigin --- src/status_im/translations/en.cljs | 5 ++++ .../ui/screens/help_center/styles.cljs | 4 +++ .../ui/screens/help_center/views.cljs | 29 +++++++++++++++++++ .../ui/screens/profile/user/views.cljs | 4 +++ src/status_im/ui/screens/views.cljs | 2 ++ src/status_im/utils/instabug.cljs | 11 +++++++ 6 files changed, 55 insertions(+) create mode 100644 src/status_im/ui/screens/help_center/styles.cljs create mode 100644 src/status_im/ui/screens/help_center/views.cljs diff --git a/src/status_im/translations/en.cljs b/src/status_im/translations/en.cljs index ea02ea2f0c..e1a8a0dbdc 100644 --- a/src/status_im/translations/en.cljs +++ b/src/status_im/translations/en.cljs @@ -136,6 +136,11 @@ :main-currency "Main currency" :message "Message" :notifications "Notifications" + :need-help "Need help?" + :help-center "Help Center" + :faq "Frequently asked questions" + :submit-bug "Submit a bug" + :request-feature "Request a feature" :not-specified "Not specified" :public-key "Public key" :phone-number "Phone number" diff --git a/src/status_im/ui/screens/help_center/styles.cljs b/src/status_im/ui/screens/help_center/styles.cljs new file mode 100644 index 0000000000..61f736a864 --- /dev/null +++ b/src/status_im/ui/screens/help_center/styles.cljs @@ -0,0 +1,4 @@ +(ns status-im.ui.screens.help-center.styles) + +(def wrapper + {:flex 1}) diff --git a/src/status_im/ui/screens/help_center/views.cljs b/src/status_im/ui/screens/help_center/views.cljs new file mode 100644 index 0000000000..302da9bee6 --- /dev/null +++ b/src/status_im/ui/screens/help_center/views.cljs @@ -0,0 +1,29 @@ +(ns status-im.ui.screens.help-center.views + (:require-macros [status-im.utils.views :as views]) + (:require [status-im.i18n :as i18n] + [status-im.ui.components.react :as react] + [status-im.ui.components.status-bar.view :as status-bar] + [status-im.ui.components.toolbar.view :as toolbar] + [status-im.ui.screens.help-center.styles :as styles] + [status-im.ui.screens.profile.components.views :as profile.components] + [status-im.utils.instabug :as instabug])) + +(views/defview help-center [] + [react/view styles/wrapper + [status-bar/status-bar] + [toolbar/simple-toolbar + (i18n/label :t/help-center)] + [react/scroll-view + [react/view + [profile.components/settings-item-separator] + [profile.components/settings-item {:label-kw :t/faq + :accessibility-label :faq-button + :action-fn #(.openURL react/linking "https://wiki.status.im/Questions_around_beta#firstHeading")}] + [profile.components/settings-item-separator] + [profile.components/settings-item {:label-kw :t/submit-bug + :accessibility-label :submit-bug-button + :action-fn #(instabug/submit-bug)}] + [profile.components/settings-item-separator] + [profile.components/settings-item {:label-kw :t/request-feature + :accessibility-label :request-feature-button + :action-fn #(instabug/request-feature)}]]]]) diff --git a/src/status_im/ui/screens/profile/user/views.cljs b/src/status_im/ui/screens/profile/user/views.cljs index 840db1d2dc..95b09d1da0 100644 --- a/src/status_im/ui/screens/profile/user/views.cljs +++ b/src/status_im/ui/screens/profile/user/views.cljs @@ -115,6 +115,10 @@ :action-fn #(re-frame/dispatch [:navigate-to :backup-seed]) :icon-content [components.common/counter {:size 22} 1]}]) [profile.components/settings-item-separator] + [profile.components/settings-item {:label-kw :t/need-help + :accessibility-label :help-button + :action-fn #(re-frame/dispatch [:navigate-to :help-center])}] + [profile.components/settings-item-separator] [react/view styles/my-profile-settings-logout-wrapper [react/view styles/my-profile-settings-logout [profile.components/settings-item {:label-kw :t/logout diff --git a/src/status_im/ui/screens/views.cljs b/src/status_im/ui/screens/views.cljs index f6a546bbd4..fcbdb14d20 100644 --- a/src/status_im/ui/screens/views.cljs +++ b/src/status_im/ui/screens/views.cljs @@ -43,6 +43,7 @@ [status-im.ui.screens.bootnodes-settings.views :refer [bootnodes-settings]] [status-im.ui.screens.bootnodes-settings.edit-bootnode.views :refer [edit-bootnode]] [status-im.ui.screens.currency-settings.views :refer [currency-settings]] + [status-im.ui.screens.help-center.views :refer [help-center]] [status-im.ui.screens.browser.views :refer [browser]] [status-im.ui.screens.add-new.open-dapp.views :refer [open-dapp dapp-description]] [status-im.ui.screens.intro.views :refer [intro]] @@ -92,6 +93,7 @@ :bootnodes-settings bootnodes-settings :edit-bootnode edit-bootnode :currency-settings currency-settings + :help-center help-center :recent-recipients recent-recipients :recipient-qr-code recipient-qr-code :contact-code contact-code diff --git a/src/status_im/utils/instabug.cljs b/src/status_im/utils/instabug.cljs index 041f3ca9d1..81de6e3498 100644 --- a/src/status_im/utils/instabug.cljs +++ b/src/status_im/utils/instabug.cljs @@ -5,6 +5,17 @@ (def instabug rn-dependencies/instabug) +(defn submit-bug [] + (.invokeWithInvocationMode + instabug + (.. instabug + -invocationMode + -newBug))) + +(defn request-feature [] + (.showFeatureRequests + instabug)) + (defn- prepare-event-name [event {:keys [target]}] (str event " " target))