Patch "Show QR Code" functionality (#19893)
This commit is contained in:
parent
8a24185ad6
commit
a9b4d86b00
|
@ -277,23 +277,29 @@
|
||||||
:sub-label nil
|
:sub-label nil
|
||||||
:chevron? false}))
|
:chevron? false}))
|
||||||
|
|
||||||
;; TODO(OmarBasem): Requires design input.
|
|
||||||
(defn show-qr-entry
|
(defn show-qr-entry
|
||||||
[]
|
[public-key]
|
||||||
(entry {:icon :i/qr-code
|
(entry {:icon :i/qr-code
|
||||||
:label (i18n/label :t/show-qr)
|
:label (i18n/label :t/show-qr)
|
||||||
:on-press #(js/alert "TODO: to be implemented, requires design input")
|
:on-press (fn []
|
||||||
|
(rf/dispatch [:universal-links/generate-profile-url
|
||||||
|
{:public-key public-key
|
||||||
|
:on-success #(rf/dispatch [:open-modal
|
||||||
|
:share-contact])}]))
|
||||||
:danger? false
|
:danger? false
|
||||||
:accessibility-label :show-qr-code
|
:accessibility-label :show-qr-code
|
||||||
:sub-label nil
|
:sub-label nil
|
||||||
:chevron? false}))
|
:chevron? false}))
|
||||||
|
|
||||||
;; TODO(OmarBasem): to be implemented.
|
|
||||||
(defn share-profile-entry
|
(defn share-profile-entry
|
||||||
[]
|
[public-key]
|
||||||
(entry {:icon :i/share
|
(entry {:icon :i/share
|
||||||
:label (i18n/label :t/share-profile)
|
:label (i18n/label :t/share-profile)
|
||||||
:on-press #(js/alert "TODO: to be implemented")
|
:on-press (fn []
|
||||||
|
(rf/dispatch [:universal-links/generate-profile-url
|
||||||
|
{:public-key public-key
|
||||||
|
:on-success #(rf/dispatch [:open-share
|
||||||
|
{:options {:message %}}])}]))
|
||||||
:danger? false
|
:danger? false
|
||||||
:accessibility-label :share-profile
|
:accessibility-label :share-profile
|
||||||
:sub-label nil
|
:sub-label nil
|
||||||
|
@ -419,9 +425,6 @@
|
||||||
(notifications-entry false))
|
(notifications-entry false))
|
||||||
(when (and config/fetch-messages-enabled? inside-chat?)
|
(when (and config/fetch-messages-enabled? inside-chat?)
|
||||||
(chat-actions/fetch-messages chat-id))
|
(chat-actions/fetch-messages chat-id))
|
||||||
(when public?
|
|
||||||
(when config/show-not-implemented-features?
|
|
||||||
(show-qr-entry)))
|
|
||||||
(when public?
|
(when public?
|
||||||
(when config/show-not-implemented-features?
|
(when config/show-not-implemented-features?
|
||||||
(share-group-entry)))])
|
(share-group-entry)))])
|
||||||
|
@ -467,10 +470,8 @@
|
||||||
[[(view-profile-entry public-key)
|
[[(view-profile-entry public-key)
|
||||||
(when-not (= current-pub-key public-key)
|
(when-not (= current-pub-key public-key)
|
||||||
(edit-nickname-entry public-key))
|
(edit-nickname-entry public-key))
|
||||||
(when config/show-not-implemented-features?
|
(show-qr-entry public-key)
|
||||||
(show-qr-entry))
|
(share-profile-entry public-key)]
|
||||||
(when config/show-not-implemented-features?
|
|
||||||
(share-profile-entry))]
|
|
||||||
[(when-not (= current-pub-key public-key)
|
[(when-not (= current-pub-key public-key)
|
||||||
(when config/show-not-implemented-features?
|
(when config/show-not-implemented-features?
|
||||||
(mark-untrustworthy-entry)))
|
(mark-untrustworthy-entry)))
|
||||||
|
|
Loading…
Reference in New Issue