mirror of
https://github.com/status-im/status-react.git
synced 2025-02-26 17:41:03 +00:00
feat: dapp connected notification
81cfce70...177688f8
Signed-off-by: yqrashawn <namy.19@gmail.com>
This commit is contained in:
parent
2983af67d6
commit
511a4c0646
@ -57,13 +57,17 @@
|
||||
[item]
|
||||
(-> item
|
||||
rpc->type
|
||||
(set/rename-keys {:lastMessage :last-message
|
||||
:replyMessage :reply-message
|
||||
:chatId :chat-id
|
||||
:contactVerificationStatus :contact-verification-status
|
||||
:communityId :community-id
|
||||
:membershipStatus :membership-status
|
||||
:albumMessages :album-messages})
|
||||
(set/rename-keys {:lastMessage :last-message
|
||||
:replyMessage :reply-message
|
||||
:chatId :chat-id
|
||||
:contactVerificationStatus :contact-verification-status
|
||||
:communityId :community-id
|
||||
:membershipStatus :membership-status
|
||||
:albumMessages :album-messages
|
||||
:walletProviderSessionTopic :wallet-provider-session-topic
|
||||
:dappURL :dapp-url
|
||||
:dappName :dapp-name
|
||||
:dappIconURL :dapp-icon-url})
|
||||
(update :last-message #(when % (messages/<-rpc %)))
|
||||
(update :message #(when % (messages/<-rpc %)))
|
||||
(update :reply-message #(when % (messages/<-rpc %)))
|
||||
|
@ -0,0 +1,35 @@
|
||||
(ns status-im.contexts.shell.activity-center.notification.dapp-connection.view
|
||||
(:require
|
||||
[quo.core :as quo]
|
||||
[quo.foundations.resources :as quo.resources]
|
||||
[status-im.contexts.shell.activity-center.notification.common.view :as common]
|
||||
[utils.datetime :as datetime]
|
||||
[utils.i18n :as i18n]
|
||||
utils.url))
|
||||
|
||||
(defn view
|
||||
[{:keys [customization-color notification extra-fn]}]
|
||||
(let [{:keys [timestamp read dapp-url dapp-icon-url]} notification]
|
||||
[common/swipeable
|
||||
{:left-button common/swipe-button-read-or-unread
|
||||
:left-on-press common/swipe-on-press-toggle-read
|
||||
:right-button common/swipe-button-delete
|
||||
:right-on-press common/swipe-on-press-delete
|
||||
:extra-fn extra-fn}
|
||||
[quo/activity-log
|
||||
{:title (i18n/label :t/connected-to-dapp)
|
||||
:customization-color customization-color
|
||||
:icon :i/dapps
|
||||
:timestamp (datetime/timestamp->relative timestamp)
|
||||
:unread? (not read)
|
||||
:context [[quo/context-tag
|
||||
{:type :dapp
|
||||
:size 24
|
||||
:dapp-logo dapp-icon-url
|
||||
:dapp-name (utils.url/url-host dapp-url)}]
|
||||
(i18n/label :t/via)
|
||||
[quo/context-tag
|
||||
{:type :dapp
|
||||
:size 24
|
||||
:dapp-logo (quo.resources/get-dapp :wallet-connect)
|
||||
:dapp-name "WalletConnect"}]]}]]))
|
@ -10,6 +10,8 @@
|
||||
(def ^:const admin 8)
|
||||
(def ^:const community-kicked 9)
|
||||
(def ^:const contact-verification 10)
|
||||
(def ^:const dapp-connected 23)
|
||||
(def ^:const dapp-disconnected 24)
|
||||
|
||||
(def ^:const all-supported
|
||||
#{one-to-one-chat
|
||||
@ -20,7 +22,8 @@
|
||||
community-request
|
||||
admin
|
||||
community-kicked
|
||||
contact-verification})
|
||||
contact-verification
|
||||
dapp-connected})
|
||||
|
||||
;; TODO: Replace with correct enum values once status-go implements them.
|
||||
(def ^:const tx 66612)
|
||||
|
@ -16,6 +16,7 @@
|
||||
contact-requests]
|
||||
[status-im.contexts.shell.activity-center.notification.contact-verification.view :as
|
||||
contact-verification]
|
||||
[status-im.contexts.shell.activity-center.notification.dapp-connection.view :as dapp-connection]
|
||||
[status-im.contexts.shell.activity-center.notification.membership.view :as membership]
|
||||
[status-im.contexts.shell.activity-center.notification.mentions.view :as mentions]
|
||||
[status-im.contexts.shell.activity-center.notification.reply.view :as reply]
|
||||
@ -51,6 +52,9 @@
|
||||
(= type types/admin)
|
||||
[admin/view props]
|
||||
|
||||
(= type types/dapp-connected)
|
||||
[dapp-connection/view props]
|
||||
|
||||
(some types/membership [type])
|
||||
(condp = type
|
||||
types/private-group-chat [membership/view props]
|
||||
|
@ -326,6 +326,7 @@
|
||||
:on-success (fn []
|
||||
(log/info "Wallet Connect session persisted")
|
||||
(rf/dispatch [:wallet-connect/fetch-persisted-sessions])
|
||||
(rf/dispatch [:activity-center.notifications/fetch-unread-count])
|
||||
(rf/dispatch [:wallet-connect/redirect-to-dapp redirect-url]))
|
||||
:on-error #(log/info "Wallet Connect session persistence failed" %)}]]]})))
|
||||
|
||||
|
@ -3,7 +3,6 @@
|
||||
[clojure.string :as string]
|
||||
[native-module.core :as native-module]
|
||||
[quo.foundations.resources :as quo.resources]
|
||||
[quo.foundations.resources]
|
||||
[re-frame.core :as rf]
|
||||
[status-im.contexts.wallet.common.activity-tab.constants :as constants]
|
||||
[utils.datetime :as datetime]
|
||||
|
@ -3,7 +3,7 @@
|
||||
"_comment": "Instead use: scripts/update-status-go.sh <rev>",
|
||||
"owner": "status-im",
|
||||
"repo": "status-go",
|
||||
"version": "v0.184.52",
|
||||
"commit-sha1": "81cfce709e8d123eb1956b87f8e0f19dc47c122c",
|
||||
"src-sha256": "0hna30ms4ccxmi20l5v36y84pva1s4jjkqg11whwmdjgw75d0fan"
|
||||
"version": "feat/wallet-connect-session-notification",
|
||||
"commit-sha1": "177688f8c483ccc492834bcdae36ae76a3074a1b",
|
||||
"src-sha256": "1y8dv545lzpy9dfvjj973hxsrzzhh0wab73d9fad16r5bs0wivc5"
|
||||
}
|
||||
|
@ -468,6 +468,7 @@
|
||||
"connected": "Connected",
|
||||
"connected-dapps": "Connected dApps",
|
||||
"connected-to": "Connected to",
|
||||
"connected-to-dapp": "Connected to dApp",
|
||||
"connecting": "Connecting...",
|
||||
"connecting-requires-login": "Connecting to another network requires login",
|
||||
"connection-request": "Connection Request",
|
||||
|
Loading…
x
Reference in New Issue
Block a user