diff --git a/resources/images/contacts/3Box.png b/resources/images/contacts/3Box.png deleted file mode 100644 index 649fffca7e..0000000000 Binary files a/resources/images/contacts/3Box.png and /dev/null differ diff --git a/resources/images/contacts/Dentacoin.png b/resources/images/contacts/Dentacoin.png deleted file mode 100644 index 9040a45727..0000000000 Binary files a/resources/images/contacts/Dentacoin.png and /dev/null differ diff --git a/resources/images/contacts/airswap.png b/resources/images/contacts/airswap.png deleted file mode 100644 index c6eb5326f8..0000000000 Binary files a/resources/images/contacts/airswap.png and /dev/null differ diff --git a/resources/images/contacts/aragon.png b/resources/images/contacts/aragon.png deleted file mode 100644 index 27c70c5bd9..0000000000 Binary files a/resources/images/contacts/aragon.png and /dev/null differ diff --git a/resources/images/contacts/augur.png b/resources/images/contacts/augur.png deleted file mode 100644 index 5228e026fd..0000000000 Binary files a/resources/images/contacts/augur.png and /dev/null differ diff --git a/resources/images/contacts/bancor.png b/resources/images/contacts/bancor.png deleted file mode 100644 index 291377f88d..0000000000 Binary files a/resources/images/contacts/bancor.png and /dev/null differ diff --git a/resources/images/contacts/bchat.png b/resources/images/contacts/bchat.png deleted file mode 100644 index a31e185212..0000000000 Binary files a/resources/images/contacts/bchat.png and /dev/null differ diff --git a/resources/images/contacts/blockimmo.png b/resources/images/contacts/blockimmo.png deleted file mode 100644 index ab823719d4..0000000000 Binary files a/resources/images/contacts/blockimmo.png and /dev/null differ diff --git a/resources/images/contacts/bounties-network.png b/resources/images/contacts/bounties-network.png deleted file mode 100644 index c0f27c74fe..0000000000 Binary files a/resources/images/contacts/bounties-network.png and /dev/null differ diff --git a/resources/images/contacts/cent.png b/resources/images/contacts/cent.png deleted file mode 100644 index 3ea6c9b34a..0000000000 Binary files a/resources/images/contacts/cent.png and /dev/null differ diff --git a/resources/images/contacts/civitas.png b/resources/images/contacts/civitas.png deleted file mode 100644 index bd53976926..0000000000 Binary files a/resources/images/contacts/civitas.png and /dev/null differ diff --git a/resources/images/contacts/commiteth.png b/resources/images/contacts/commiteth.png deleted file mode 100644 index 8a43c9b7df..0000000000 Binary files a/resources/images/contacts/commiteth.png and /dev/null differ diff --git a/resources/images/contacts/console.png b/resources/images/contacts/console.png deleted file mode 100644 index 9aa3dea2c1..0000000000 Binary files a/resources/images/contacts/console.png and /dev/null differ diff --git a/resources/images/contacts/cryptocribs.png b/resources/images/contacts/cryptocribs.png deleted file mode 100644 index 6f82c2bda9..0000000000 Binary files a/resources/images/contacts/cryptocribs.png and /dev/null differ diff --git a/resources/images/contacts/cryptofighters.png b/resources/images/contacts/cryptofighters.png deleted file mode 100644 index cbf5df6ca4..0000000000 Binary files a/resources/images/contacts/cryptofighters.png and /dev/null differ diff --git a/resources/images/contacts/cryptographics.png b/resources/images/contacts/cryptographics.png deleted file mode 100644 index 6fc9e17850..0000000000 Binary files a/resources/images/contacts/cryptographics.png and /dev/null differ diff --git a/resources/images/contacts/cryptokitties.png b/resources/images/contacts/cryptokitties.png deleted file mode 100644 index 4a93ca5a97..0000000000 Binary files a/resources/images/contacts/cryptokitties.png and /dev/null differ diff --git a/resources/images/contacts/cryptopunks.png b/resources/images/contacts/cryptopunks.png deleted file mode 100644 index be0acdcade..0000000000 Binary files a/resources/images/contacts/cryptopunks.png and /dev/null differ diff --git a/resources/images/contacts/cryptopurr.png b/resources/images/contacts/cryptopurr.png deleted file mode 100644 index 1385610937..0000000000 Binary files a/resources/images/contacts/cryptopurr.png and /dev/null differ diff --git a/resources/images/contacts/cryptostrikers.png b/resources/images/contacts/cryptostrikers.png deleted file mode 100644 index b3ad4dbf06..0000000000 Binary files a/resources/images/contacts/cryptostrikers.png and /dev/null differ diff --git a/resources/images/contacts/cryptotakeovers.png b/resources/images/contacts/cryptotakeovers.png deleted file mode 100644 index fe7c9880a0..0000000000 Binary files a/resources/images/contacts/cryptotakeovers.png and /dev/null differ diff --git a/resources/images/contacts/dai.png b/resources/images/contacts/dai.png deleted file mode 100644 index 8a3abc25f7..0000000000 Binary files a/resources/images/contacts/dai.png and /dev/null differ diff --git a/resources/images/contacts/ddex.png b/resources/images/contacts/ddex.png deleted file mode 100644 index 27901eaad6..0000000000 Binary files a/resources/images/contacts/ddex.png and /dev/null differ diff --git a/resources/images/contacts/decentraland.png b/resources/images/contacts/decentraland.png deleted file mode 100644 index e3bd381510..0000000000 Binary files a/resources/images/contacts/decentraland.png and /dev/null differ diff --git a/resources/images/contacts/dragonereum.png b/resources/images/contacts/dragonereum.png deleted file mode 100644 index a8ddb6e4ef..0000000000 Binary files a/resources/images/contacts/dragonereum.png and /dev/null differ diff --git a/resources/images/contacts/easytrade.png b/resources/images/contacts/easytrade.png deleted file mode 100644 index 5ce627528a..0000000000 Binary files a/resources/images/contacts/easytrade.png and /dev/null differ diff --git a/resources/images/contacts/emoon.png b/resources/images/contacts/emoon.png deleted file mode 100644 index d250ff408f..0000000000 Binary files a/resources/images/contacts/emoon.png and /dev/null differ diff --git a/resources/images/contacts/eth2phone.png b/resources/images/contacts/eth2phone.png deleted file mode 100644 index 11e7594439..0000000000 Binary files a/resources/images/contacts/eth2phone.png and /dev/null differ diff --git a/resources/images/contacts/ethcro.png b/resources/images/contacts/ethcro.png deleted file mode 100644 index 5fb9ff420b..0000000000 Binary files a/resources/images/contacts/ethcro.png and /dev/null differ diff --git a/resources/images/contacts/etherbots.png b/resources/images/contacts/etherbots.png deleted file mode 100644 index e9d265b044..0000000000 Binary files a/resources/images/contacts/etherbots.png and /dev/null differ diff --git a/resources/images/contacts/etheremon.png b/resources/images/contacts/etheremon.png deleted file mode 100644 index 9f9ff498fd..0000000000 Binary files a/resources/images/contacts/etheremon.png and /dev/null differ diff --git a/resources/images/contacts/etherplay.png b/resources/images/contacts/etherplay.png deleted file mode 100644 index 52992ee7f6..0000000000 Binary files a/resources/images/contacts/etherplay.png and /dev/null differ diff --git a/resources/images/contacts/ethlance.png b/resources/images/contacts/ethlance.png deleted file mode 100644 index 80db5d7f05..0000000000 Binary files a/resources/images/contacts/ethlance.png and /dev/null differ diff --git a/resources/images/contacts/ethlend.png b/resources/images/contacts/ethlend.png deleted file mode 100644 index c35ec23930..0000000000 Binary files a/resources/images/contacts/ethlend.png and /dev/null differ diff --git a/resources/images/contacts/gnosis.png b/resources/images/contacts/gnosis.png deleted file mode 100644 index abf790ed67..0000000000 Binary files a/resources/images/contacts/gnosis.png and /dev/null differ diff --git a/resources/images/contacts/hexel.png b/resources/images/contacts/hexel.png deleted file mode 100644 index a2f78645a2..0000000000 Binary files a/resources/images/contacts/hexel.png and /dev/null differ diff --git a/resources/images/contacts/kickback.png b/resources/images/contacts/kickback.png deleted file mode 100644 index b6cd2b150b..0000000000 Binary files a/resources/images/contacts/kickback.png and /dev/null differ diff --git a/resources/images/contacts/kickback@2x.png b/resources/images/contacts/kickback@2x.png deleted file mode 100644 index 884b0b4c5e..0000000000 Binary files a/resources/images/contacts/kickback@2x.png and /dev/null differ diff --git a/resources/images/contacts/kickback@3x.png b/resources/images/contacts/kickback@3x.png deleted file mode 100644 index fd668416ac..0000000000 Binary files a/resources/images/contacts/kickback@3x.png and /dev/null differ diff --git a/resources/images/contacts/kyber.png b/resources/images/contacts/kyber.png deleted file mode 100644 index 016d36b310..0000000000 Binary files a/resources/images/contacts/kyber.png and /dev/null differ diff --git a/resources/images/contacts/livepeer.png b/resources/images/contacts/livepeer.png deleted file mode 100644 index d1841c5b38..0000000000 Binary files a/resources/images/contacts/livepeer.png and /dev/null differ diff --git a/resources/images/contacts/local-ethereum.png b/resources/images/contacts/local-ethereum.png deleted file mode 100644 index 0c76b257b9..0000000000 Binary files a/resources/images/contacts/local-ethereum.png and /dev/null differ diff --git a/resources/images/contacts/melonport.png b/resources/images/contacts/melonport.png deleted file mode 100644 index b216a921ad..0000000000 Binary files a/resources/images/contacts/melonport.png and /dev/null differ diff --git a/resources/images/contacts/mkr-market.png b/resources/images/contacts/mkr-market.png deleted file mode 100644 index d132a6f7e8..0000000000 Binary files a/resources/images/contacts/mkr-market.png and /dev/null differ diff --git a/resources/images/contacts/name-bazaar.png b/resources/images/contacts/name-bazaar.png deleted file mode 100644 index bf99369ea7..0000000000 Binary files a/resources/images/contacts/name-bazaar.png and /dev/null differ diff --git a/resources/images/contacts/oaken-water-meter.png b/resources/images/contacts/oaken-water-meter.png deleted file mode 100644 index c83c115f6e..0000000000 Binary files a/resources/images/contacts/oaken-water-meter.png and /dev/null differ diff --git a/resources/images/contacts/opensea.png b/resources/images/contacts/opensea.png deleted file mode 100644 index a03cdd772c..0000000000 Binary files a/resources/images/contacts/opensea.png and /dev/null differ diff --git a/resources/images/contacts/peepeth.png b/resources/images/contacts/peepeth.png deleted file mode 100644 index 052de5ef64..0000000000 Binary files a/resources/images/contacts/peepeth.png and /dev/null differ diff --git a/resources/images/contacts/slowtrade.png b/resources/images/contacts/slowtrade.png deleted file mode 100644 index 16c12f787a..0000000000 Binary files a/resources/images/contacts/slowtrade.png and /dev/null differ diff --git a/resources/images/contacts/smartz.png b/resources/images/contacts/smartz.png deleted file mode 100644 index 19f0c2d476..0000000000 Binary files a/resources/images/contacts/smartz.png and /dev/null differ diff --git a/resources/images/contacts/snt-voting.png b/resources/images/contacts/snt-voting.png deleted file mode 100644 index 2bc0e1e83c..0000000000 Binary files a/resources/images/contacts/snt-voting.png and /dev/null differ diff --git a/resources/images/contacts/superrare.png b/resources/images/contacts/superrare.png deleted file mode 100644 index 7d8faa483d..0000000000 Binary files a/resources/images/contacts/superrare.png and /dev/null differ diff --git a/src/status_im/browser/core.cljs b/src/status_im/browser/core.cljs index d0be5af51b..8b986d0225 100644 --- a/src/status_im/browser/core.cljs +++ b/src/status_im/browser/core.cljs @@ -8,7 +8,6 @@ [status-im.js-dependencies :as dependencies] [status-im.native-module.core :as status] [status-im.ui.components.list-selection :as list-selection] - [status-im.ui.screens.browser.default-dapps :as default-dapps] [status-im.ui.screens.navigation :as navigation] [status-im.utils.ethereum.core :as ethereum] [status-im.utils.ethereum.ens :as ens] @@ -21,7 +20,8 @@ [status-im.utils.types :as types] [status-im.utils.universal-links.core :as utils.universal-links] [taoensso.timbre :as log] - [status-im.js-dependencies :as js-dependencies])) + [status-im.js-dependencies :as js-dependencies] + [status-im.utils.universal-links.core :as universal-links])) (fx/defn initialize-browsers [{:keys [db all-stored-browsers]}] @@ -59,16 +59,8 @@ {:db (update-in db [:browser/browsers] dissoc browser-id) :data-store/tx [(browser-store/remove-browser-tx browser-id)]}) -(defn check-if-dapp-in-list [{:keys [history history-index name] :as browser}] - (let [history-host (http/url-host (try (nth history history-index) (catch js/Error _))) - dapp (first (filter #(= history-host (http/url-host (http/normalize-url (:dapp-url %)))) - (apply concat (mapv :data default-dapps/all))))] - (if dapp - ;;TODO(yenda): the consequence of this is that if user goes to a different - ;;url from a dapp browser, the name of the browser in the home screen will - ;;change - (assoc browser :dapp? true :name (:name dapp)) - (assoc browser :dapp? false :name (or name (i18n/label :t/browser)))))) +(defn update-dapp-name [{:keys [name] :as browser}] + (assoc browser :dapp? false :name (or name (i18n/label :t/browser)))) (defn check-if-phishing-url [{:keys [history history-index] :as browser}] (let [history-host (http/url-host (try (nth history history-index) (catch js/Error _)))] @@ -118,7 +110,7 @@ [{:keys [db now]} {:keys [browser-id] :as browser}] (let [updated-browser (-> (assoc browser :timestamp now) - (check-if-dapp-in-list) + (update-dapp-name) (check-if-phishing-url))] {:db (update-in db [:browser/browsers browser-id] @@ -250,8 +242,7 @@ If the browser is reused, the history is flushed" [{:keys [db] :as cofx} url] (let [normalized-url (http/normalize-and-decode-url url) - host (http/url-host normalized-url) - browser {:browser-id (or host (random/id)) + browser {:browser-id (random/id) :history-index 0 :history [normalized-url]}] (if (utils.universal-links/universal-link? normalized-url) @@ -394,3 +385,8 @@ :browser/show-web-browser-selection (fn [link] (list-selection/browse-in-web-browser link))) + +(defn share-link [url] + (let [link (universal-links/generate-link :browse :external url) + message (i18n/label :t/share-dapp-text {:link link})] + (list-selection/open-share {:message message}))) diff --git a/src/status_im/chat/models/loading.cljs b/src/status_im/chat/models/loading.cljs index d05239f355..34ae7aab25 100644 --- a/src/status_im/chat/models/loading.cljs +++ b/src/status_im/chat/models/loading.cljs @@ -63,7 +63,7 @@ (fx/defn initialize-chats "Initialize persisted chats on startup" - [{:keys [db default-dapps get-all-stored-chats] :as cofx} + [{:keys [db get-all-stored-chats] :as cofx} {:keys [from to] :or {from 0 to nil}}] (let [old-chats (:chats db) chats (reduce (fn [acc {:keys [chat-id] :as chat}] @@ -76,9 +76,7 @@ (get-all-stored-chats from to)) chats (merge old-chats chats)] (fx/merge cofx - {:db (assoc db - :chats chats - :contacts/dapps default-dapps)} + {:db (assoc db :chats chats)} (commands/load-commands commands/register)))) (defn load-more-messages diff --git a/src/status_im/contact/subs.cljs b/src/status_im/contact/subs.cljs index 8963a4a198..e8dd443880 100644 --- a/src/status_im/contact/subs.cljs +++ b/src/status_im/contact/subs.cljs @@ -3,11 +3,6 @@ [status-im.utils.identicon :as identicon] [status-im.contact.db :as contact.db])) -(re-frame/reg-sub - ::dapps - (fn [db] - (:contacts/dapps db))) - (re-frame/reg-sub ::contacts (fn [db] @@ -68,28 +63,6 @@ contact.db/public-key->new-contact contact.db/enrich-contact)))) -(re-frame/reg-sub - :contacts/all-dapps - :<- [::dapps] - :<- [:account/account] - (fn [[dapps {:keys [dev-mode?]}]] - (map (fn [m] (update m :data - #(contact.db/filter-dapps % dev-mode?))) - dapps))) - -(re-frame/reg-sub - :contacts/dapps-by-name - :<- [:contacts/all-dapps] - (fn [dapps] - (reduce (fn [dapps-by-name category] - (merge dapps-by-name - (reduce (fn [acc {:keys [name] :as dapp}] - (assoc acc name dapp)) - {} - (:data category)))) - {} - dapps))) - (re-frame/reg-sub :contacts/contact-name-by-identity :<- [:contacts/contacts] diff --git a/src/status_im/events.cljs b/src/status_im/events.cljs index ea2de634e2..e48289c712 100644 --- a/src/status_im/events.cljs +++ b/src/status_im/events.cljs @@ -103,7 +103,6 @@ (handlers/register-handler-fx :init-rest-of-chats [(re-frame/inject-cofx :web3/get-web3) - (re-frame/inject-cofx :get-default-dapps) (re-frame/inject-cofx :data-store/all-chats)] (fn [{:keys [db] :as cofx} [_]] (log/debug "PERF" :init-rest-of-chats (.now js/Date)) @@ -131,7 +130,6 @@ (re-frame/inject-cofx :data-store/get-all-installations) (re-frame/inject-cofx :data-store/all-browsers) (re-frame/inject-cofx :data-store/all-dapp-permissions) - (re-frame/inject-cofx :get-default-dapps) (re-frame/inject-cofx :data-store/all-chats)] account-change-success) @@ -1455,7 +1453,7 @@ (handlers/register-handler-fx :browser/loading-started (fn [cofx _] - (browser/update-browser-option cofx :error? false))) + (browser/update-browser-options cofx {:error? false :loading? true}))) (handlers/register-handler-fx :browser.callback/resolve-ens-multihash-success diff --git a/src/status_im/react_native/resources.cljs b/src/status_im/react_native/resources.cljs index f8df294aba..eed19d8698 100644 --- a/src/status_im/react_native/resources.cljs +++ b/src/status_im/react_native/resources.cljs @@ -1,61 +1,5 @@ (ns status-im.react-native.resources) -(def contacts - {:mkr-market (js/require "./resources/images/contacts/mkr-market.png") - :oaken-water-meter (js/require "./resources/images/contacts/oaken-water-meter.png") - :gnosis (js/require "./resources/images/contacts/gnosis.png") - :melonport (js/require "./resources/images/contacts/melonport.png") - :bchat (js/require "./resources/images/contacts/bchat.png") - :dentacoin (js/require "./resources/images/contacts/Dentacoin.png") - :augur (js/require "./resources/images/contacts/augur.png") - :ethlance (js/require "./resources/images/contacts/ethlance.png") - :commiteth (js/require "./resources/images/contacts/commiteth.png") - :etherplay (js/require "./resources/images/contacts/etherplay.png") - :ethcro (js/require "./resources/images/contacts/ethcro.png") - :easytrade (js/require "./resources/images/contacts/easytrade.png") - - :dragonereum (js/require "./resources/images/contacts/dragonereum.png") - :name-bazaar (js/require "./resources/images/contacts/name-bazaar.png") - :cryptographics (js/require "./resources/images/contacts/cryptographics.png") - :cryptopunks (js/require "./resources/images/contacts/cryptopunks.png") - :cryptotakeovers (js/require "./resources/images/contacts/cryptotakeovers.png") - :cryptokitties (js/require "./resources/images/contacts/cryptokitties.png") - :decentraland (js/require "./resources/images/contacts/decentraland.png") - :etheremon (js/require "./resources/images/contacts/etheremon.png") - :cryptostrikers (js/require "./resources/images/contacts/cryptostrikers.png") - :cent (js/require "./resources/images/contacts/cent.png") - :kickback (js/require "./resources/images/contacts/kickback.png") - :hexel (js/require "./resources/images/contacts/hexel.png") - :peepeth (js/require "./resources/images/contacts/peepeth.png") - :etherbots (js/require "./resources/images/contacts/etherbots.png") - :opensea (js/require "./resources/images/contacts/opensea.png") - :kyber (js/require "./resources/images/contacts/kyber.png") - :bancor (js/require "./resources/images/contacts/bancor.png") - :blockimmo (js/require "./resources/images/contacts/blockimmo.png") - :cryptocribs (js/require "./resources/images/contacts/cryptocribs.png") - :cryptofighters (js/require "./resources/images/contacts/cryptofighters.png") - :etherman (js/require "./resources/images/contacts/etherman.png") - :airswap (js/require "./resources/images/contacts/airswap.png") - :civitas (js/require "./resources/images/contacts/civitas.png") - :dai (js/require "./resources/images/contacts/dai.png") - :local-ethereum (js/require "./resources/images/contacts/local-ethereum.png") - :eth2phone (js/require "./resources/images/contacts/eth2phone.png") - :bounties-network (js/require "./resources/images/contacts/bounties-network.png") - :cryptopurr (js/require "./resources/images/contacts/cryptopurr.png") - :ethlend (js/require "./resources/images/contacts/ethlend.png") - :smartz (js/require "./resources/images/contacts/smartz.png") - :snt-voting (js/require "./resources/images/contacts/snt-voting.png") - :superrare (js/require "./resources/images/contacts/superrare.png") - :3box (js/require "./resources/images/contacts/3Box.png") - :aragon (js/require "./resources/images/contacts/aragon.png") - :slowtrade (js/require "./resources/images/contacts/slowtrade.png") - - :ddex (js/require "./resources/images/contacts/ddex.png") - :emoon (js/require "./resources/images/contacts/emoon.png") - :livepeer (js/require "./resources/images/contacts/livepeer.png") - - :console (js/require "./resources/images/contacts/console.png")}) - (def ui {:empty-hashtags (js/require "./resources/images/ui/empty-hashtags.png") :empty-recent (js/require "./resources/images/ui/empty-recent.png") diff --git a/src/status_im/ui/screens/browser/default_dapps.cljs b/src/status_im/ui/screens/browser/default_dapps.cljs deleted file mode 100644 index 917c466677..0000000000 --- a/src/status_im/ui/screens/browser/default_dapps.cljs +++ /dev/null @@ -1,184 +0,0 @@ -(ns status-im.ui.screens.browser.default-dapps - (:require [re-frame.core :as re-frame] - [status-im.i18n :as i18n])) - -(def all - [{:title (i18n/label :t/default-dapps-exchanges) - :data [{:name "Airswap" - :dapp-url "https://instant.airswap.io/" - :photo-path "contacts://airswap" - :description "Meet the future of trading."} - {:name "Bancor" - :dapp-url "https://www.bancor.network/" - :photo-path "contacts://bancor" - :description "Bancor is a decentralized liquidity network"} - {:name "Kyber" - :dapp-url "https://web3.kyber.network" - :photo-path "contacts://kyber" - :description "On-chain, instant and liquid platform for exchange and payment service"} - {:name "DAI by MakerDao" - :dapp-url "https://dai.makerdao.com" - :photo-path "contacts://dai" - :description "Stability for the blockchain"} - {:name "LocalEthereum" - :dapp-url "https://localethereum.com/" - :photo-path "contacts://local-ethereum" - :description "The smartest way to buy and sell Ether"} - {:name "Eth2phone" - :dapp-url "https://eth2.io" - :photo-path "contacts://eth2phone" - :description "Send Ether by phone number"} - {:name "DDEX" - :dapp-url "https://ddex.io/" - :photo-path "contacts://ddex" - :description "Instant, real-time order matching with secure on-chain settlement"} - {:name "EasyTrade" - :dapp-url "https://easytrade.io" - :photo-path "contacts://easytrade" - :description "One exchange for every token"} - {:name "slow.trade" - :dapp-url "https://slow.trade/" - :photo-path "contacts://slowtrade" - :description "Trade fairly priced crypto assets on the first platform built with the DutchX protocol."}]} - {:title (i18n/label :t/default-dapps-marketplaces) - :data [{:name "blockimmo" - :dapp-url "https://blockimmo.ch" - :photo-path "contacts://blockimmo" - :description "blockimmo is a blockchain powered, regulated platform enabling shared property investments and ownership."} - {:name "CryptoCribs" - :dapp-url "https://cryptocribs.com" - :photo-path "contacts://cryptocribs" - :description "Travel the globe. Pay in crypto."} - {:name "Ethlance" - :dapp-url "https://ethlance.com" - :photo-path "contacts://ethlance" - :description "The future of work is now. Hire people or work yourself in return for ETH."} - {:name "OpenSea" - :dapp-url "https://opensea.io" - :photo-path "contacts://opensea" - :description "The largest decentralized marketplace for cryptogoods"} - {:name "Name Bazaar" - :dapp-url "https://namebazaar.io" - :photo-path "contacts://name-bazaar" - :description "ENS name marketplace"} - {:name "The Bounties Network" - :dapp-url "https://bounties.network/" - :photo-path "contacts://bounties-network" - :description "Bounties on any task, paid in any token"} - {:name "Emoon" - :dapp-url "https://www.emoon.io/" - :photo-path "contacts://emoon" - :description "A decentralized marketplace for buying & selling crypto assets"} - {:name "SuperRare" - :dapp-url "https://superrare.co/market" - :photo-path "contacts://superrare" - :description "Buy, sell and collect unique digital creations by artists around the world"}]} - {:title (i18n/label :t/default-dapps-fun-games) - :data [{:name "CryptoKitties" - :dapp-url "https://www.cryptokitties.co" - :photo-path "contacts://cryptokitties" - :description "Collect and breed adorable digital cats."} - {:name "CryptoFighters" - :dapp-url "https://cryptofighters.io" - :photo-path "contacts://cryptofighters" - :description "Collect train and fight digital fighters."} - {:name "Cryptographics" - :dapp-url "https://cryptographics.app/" - :photo-path "contacts://cryptographics" - :description "Cryptographics is a digital art hub where artists, creators and collectors can submit asset packs, create unique cryptographics and trade them."} - {:name "CryptoPunks" - :dapp-url "https://www.larvalabs.com/cryptopunks" - :photo-path "contacts://cryptopunks" - :description "10,000 unique collectible punks"} - {:name "Crypto Takeovers" - :dapp-url "https://cryptotakeovers.com/" - :photo-path "contacts://cryptotakeovers" - :description "Predict and conquer the world. Make a crypto fortune."} - {:name "Decentraland" - :dapp-url "https://market.decentraland.org/" - :photo-path "contacts://decentraland" - :description "Decentraland is a virtual reality platform powered by the Ethereum blockchain."} - {:name "Dragonereum" - :dapp-url "https://dapp.dragonereum.io" - :photo-path "contacts://dragonereum" - :description "Own and trade dragons, fight with other players."} - {:name "Etherbots" - :dapp-url "https://etherbots.io/" - :photo-path "contacts://etherbots" - :description "Robot wars on the Ethereum Platform"} - {:name "Etheremon" - :dapp-url "https://www.etheremon.com/" - :photo-path "contacts://etheremon" - :description "Decentralized World of Ether Monsters"} - {:name "CryptoStrikers" - :dapp-url "https://www.cryptostrikers.com/" - :photo-path "contacts://cryptostrikers" - :description "The Beautiful (card) Game"} - {:name "Etherman" - :dapp-url "https://www.etherman.app" - :photo-path "contacts://etherman" - :description "Bomberman on Ethereum"}]} - {:title (i18n/label :t/default-dapps-social-networks) - :data [{:name "Cent" - :dapp-url "https://beta.cent.co/" - :photo-path "contacts://cent" - :description "Get wisdom, get money"} - {:name "Kickback" - :dapp-url "https://kickback.events/" - :photo-path "contacts://kickback" - :description "Event no shows? No problem. Kickback asks event attendees to put skin in the game with Ethereum."} - {:name "Peepeth" - :dapp-url "https://peepeth.com/" - :photo-path "contacts://peepeth" - :description "Blockchain-powered microblogging"} - {:name "Purrbook" - :dapp-url "https://cryptopurr.co/" - :photo-path "contacts://cryptopurr" - :description "A social network for CryptoKitties"}]} - {:title (i18n/label :t/default-dapps-media) - :data [{:name "livepeer.tv" - :dapp-url "http://livepeer.tv/" - :photo-path "contacts://livepeer" - :description "Decentralized video broadcasting"}]} - {:title (i18n/label :t/default-dapps-social-utilities) - :data [{:name "3Box" - :dapp-url "https://3box.io/" - :photo-path "contacts://3box" - :description "Create and manage your Ethereum Profile."} - {:name "Aragon" - :dapp-url "https://mainnet.aragon.org/" - :photo-path "contacts://aragon" - :description "Build unstoppable organizations on Ethereum."} - {:name "Civitas" - :dapp-url "https://communities.colu.com/" - :photo-path "contacts://civitas" - :description "Blockchain-powered local communities"} - {:name "ETHLend" - :dapp-url "https://app.ethlend.io" - :photo-path "contacts://ethlend" - :description "Decentralized lending on Ethereum"} - {:name "Hexel" - :dapp-url "https://www.onhexel.com/" - :photo-path "contacts://hexel" - :description "Create your own cryptocurrency"} - {:name "Livepeer" - :dapp-url "https://explorer.livepeer.org/" - :photo-path "contacts://livepeer" - :description "Decentralized video broadcasting"} - {:name "Smartz" - :dapp-url "https://smartz.io" - :photo-path "contacts://smartz" - :description "Easy smart contract management"} - {:name "SNT Voting DApp" - :dapp-url "https://vote.status.im" - :photo-path "contacts://snt-voting" - :description "Let your SNT be heard! Vote on decisions exclusive to SNT holders, or create a poll of your own."} - {:name "Status Test DApp" - :dapp-url "simpledapp.eth" - :description "Request test assets and test basic web3 functionality." - :developer? true}]}]) - -(re-frame/reg-cofx - :get-default-dapps - (fn [coeffects _] - (assoc coeffects :default-dapps all))) diff --git a/src/status_im/ui/screens/browser/open_dapp/styles.cljs b/src/status_im/ui/screens/browser/open_dapp/styles.cljs index d7163df05f..c1a036c7ab 100644 --- a/src/status_im/ui/screens/browser/open_dapp/styles.cljs +++ b/src/status_im/ui/screens/browser/open_dapp/styles.cljs @@ -17,5 +17,28 @@ {:flex 1 :padding-horizontal 14 :desktop {:height 30 - :width "100%"} + :width "100%"} :android {:padding 0}}) + +(def browser-icon-container + {:width 40 + :height 40 + :border-radius 20 + :background-color colors/gray-lighter + :align-items :center + :justify-content :center}) + +(def dapp-store-container + {:margin 16 + :border-color colors/gray-lighter + :border-width 1 + :border-radius 12 + :padding-vertical 16 + :padding-horizontal 44 + :align-items :center}) + +(def open-dapp-store + {:margin-top 12 + :font-size 15 + :font-weight "500" + :line-height 22}) diff --git a/src/status_im/ui/screens/browser/open_dapp/views.cljs b/src/status_im/ui/screens/browser/open_dapp/views.cljs index cd7062a998..bc5128e9b0 100644 --- a/src/status_im/ui/screens/browser/open_dapp/views.cljs +++ b/src/status_im/ui/screens/browser/open_dapp/views.cljs @@ -7,64 +7,46 @@ [status-im.ui.components.status-bar.view :as status-bar] [status-im.ui.screens.browser.open-dapp.styles :as styles] [status-im.ui.components.list.views :as list] - [status-im.ui.screens.home.views.inner-item :as inner-item] [status-im.ui.components.common.common :as components.common] [status-im.ui.screens.wallet.components.views :as components] [status-im.ui.components.bottom-bar.styles :as tabs.styles] [status-im.react-native.resources :as resources] - [status-im.ui.components.chat-icon.screen :as chat-icon]) + [status-im.ui.components.list-item.views :as list-item] + [status-im.ui.components.icons.vector-icons :as vector-icons]) (:require-macros [status-im.utils.views :as views])) -(defn list-item [{:keys [browser-id] :as home-item}] +(defn list-item [{:keys [browser-id name url]}] [list/deletable-list-item {:type :browsers :id browser-id :on-delete #(do (re-frame/dispatch [:set-swipe-position :browsers browser-id false]) (re-frame/dispatch [:browser.ui/remove-browser-pressed browser-id]))} - [inner-item/home-list-browser-item-inner-view home-item]]) + [list-item/list-item + {:on-press #(re-frame/dispatch [:browser.ui/browser-item-selected browser-id]) + :title name + :subtitle (or url (i18n/label :t/dapp)) + :image [react/view styles/browser-icon-container + [vector-icons/icon :main-icons/browser {:color colors/gray}]]}]]) -(defn- render-dapp [{:keys [dapp-url recent? description name] :as dapp}] - (if recent? - [list-item dapp] - [react/touchable-highlight {:on-press #(re-frame/dispatch [:browser.ui/open-dapp-button-pressed dapp-url])} - [react/view {:style {:padding-top 11 :padding-horizontal 16 :padding-bottom 7 :flex-direction :row}} - [chat-icon/contact-icon-contacts-tab dapp] - [react/view {:padding-left 16 :padding-right 2 :flex 1} - [react/text {:style {:typography :main-medium}} name] - [react/text {:flex 1} - [react/text {:style {:font-size 13 - :color "#939BA1" - :margin-top 5 - :margin-bottom 2}} - description]] - [react/text {:style {:font-size 12 - :color "#4360DF"}} - (str dapp-url " ->")]]]])) +(def dapp-image-data {:image (:dapp-store resources/ui) :width 768 :height 333}) +(def dapp-image (components.common/image-contain nil dapp-image-data)) (defn list-header [empty?] [react/view (when empty? {:flex 1}) - [react/view {:margin 16 - :border-color colors/gray-lighter - :border-width 1 - :border-radius 12 - :padding-vertical 16 - :padding-horizontal 44 - :align-items :center} - [components.common/image-contain {:container-style {}} {:image (:dapp-store resources/ui) :width 768 :height 333}] - [react/text {:style {:typography :main-medium - :margin-top 12}} - "Open the ÐApp Store"] - [react/text {:style {:color colors/blue - :font-size 13}} "https://discover.dapps.eth ->"]] + [react/touchable-highlight {:on-press #(re-frame/dispatch [:browser.ui/dapp-url-submitted "https://dap.ps"])} + [react/view styles/dapp-store-container + [dapp-image nil dapp-image-data] + [react/text {:style styles/open-dapp-store} (i18n/label :t/open-dapp-store)] + [react/text {:style {:color colors/blue :font-size 13 :line-height 22}} "https://dap.ps ->"]]] (if empty? [react/view {:flex 1 :align-items :center :justify-content :center} - [react/text {:style {:color colors/gray}} "Browsed websites will appear here."]] + [react/text {:style {:color colors/gray :font-size 15}} (i18n/label :t/browsed-websites)]] [react/view {:margin-top 14 :margin-left 16 :margin-bottom 4} - [react/text {:style {:color colors/gray}} (i18n/label :t/recent)]])]) + [react/text {:style {:line-height 22 :font-size 15 :color colors/gray}} + (i18n/label :t/recent)]])]) (views/defview open-dapp [] (views/letsubs [browsers [:browser/browsers-vals] - dapps [:contacts/all-dapps] url-text (atom nil)] [react/keyboard-avoiding-view {:style {:flex 1}} [status-bar/status-bar] @@ -78,25 +60,13 @@ :accessibility-label :dapp-url-input :return-key-type :go}]] [components/separator] - [list/section-list {:sections (cond-> dapps - (not (empty? browsers)) - (conj {:title (i18n/label :t/recent) - :data (map #(assoc % :dapp-url (:url %) :recent? true) browsers)})) - :key-fn :dapp-url - :render-fn render-dapp - :enableEmptySections true - :footer [react/view - {:style {:height tabs.styles/tabs-diff - :align-self :stretch}}] - :keyboardShouldPersistTaps :always}] - ;;TODO next iteration in next PR - #_(if (empty? browsers) - [list-header true] - [list/flat-list {:header [list-header false] - :data (vals browsers) - :footer [react/view - {:style {:height tabs.styles/tabs-diff - :align-self :stretch}}] - :key-fn :browser-id - :end-fill-color colors/white - :render-fn list-item}])])) + (if (empty? browsers) + [list-header true] + [list/flat-list {:header [list-header false] + :data browsers + :footer [react/view + {:style {:height tabs.styles/tabs-diff + :align-self :stretch}}] + :key-fn :browser-id + :end-fill-color colors/white + :render-fn list-item}])])) \ No newline at end of file diff --git a/src/status_im/ui/screens/browser/subs.cljs b/src/status_im/ui/screens/browser/subs.cljs index 385c0fe5ed..9a8ee91fee 100644 --- a/src/status_im/ui/screens/browser/subs.cljs +++ b/src/status_im/ui/screens/browser/subs.cljs @@ -10,12 +10,9 @@ (re-frame/reg-sub :browser/browsers :<- [:browsers] - :<- [:contacts/dapps-by-name] - (fn [[browsers dapps]] - (reduce (fn [acc [k {:keys [dapp? name] :as browser}]] - (cond-> (update acc k assoc - :url (browser/get-current-url browser)) - dapp? (assoc-in [k :dapp] (get dapps name)))) + (fn [browsers] + (reduce (fn [acc [k browser]] + (update acc k assoc :url (browser/get-current-url browser))) browsers browsers))) diff --git a/src/status_im/ui/screens/browser/views.cljs b/src/status_im/ui/screens/browser/views.cljs index a5f90d0fc9..1134a47adf 100644 --- a/src/status_im/ui/screens/browser/views.cljs +++ b/src/status_im/ui/screens/browser/views.cljs @@ -6,7 +6,6 @@ [status-im.i18n :as i18n] [status-im.ui.components.colors :as colors] [status-im.ui.components.icons.vector-icons :as icons] - [status-im.ui.components.list-selection :as list-selection] [status-im.ui.components.react :as react] [status-im.ui.components.status-bar.view :as status-bar] [status-im.ui.components.styles :as components.styles] @@ -17,7 +16,6 @@ [status-im.ui.screens.browser.permissions.views :as permissions.views] [status-im.ui.screens.browser.site-blocked.views :as site-blocked.views] [status-im.ui.screens.browser.styles :as styles] - [status-im.ui.screens.wallet.actions :as wallet.actions] [status-im.utils.ethereum.core :as ethereum] [status-im.utils.http :as http] [status-im.utils.js-resources :as js-res] @@ -94,7 +92,7 @@ :accessibility-label :modal-chat-button} [icons/icon :main-icons/message]] [react/touchable-highlight - {:on-press #(wallet.actions/share-link browser-id) + {:on-press #(browser/share-link url) :accessibility-label :modal-share-link-button} [icons/icon :main-icons/share]] [react/touchable-highlight {:on-press #(.reload @webview) diff --git a/src/status_im/ui/screens/db.cljs b/src/status_im/ui/screens/db.cljs index 1aa7b8774f..61ec09ed4a 100644 --- a/src/status_im/ui/screens/db.cljs +++ b/src/status_im/ui/screens/db.cljs @@ -200,7 +200,6 @@ (spec/def :extensions/profile (spec/nilable any?)) (spec/def ::db (spec/keys :opt [:contacts/contacts - :contacts/dapps :contacts/new-identity :contacts/new-identity-error :contacts/identity diff --git a/src/status_im/ui/screens/home/styles.cljs b/src/status_im/ui/screens/home/styles.cljs index 2f1b54914a..589cbc2ed7 100644 --- a/src/status_im/ui/screens/home/styles.cljs +++ b/src/status_im/ui/screens/home/styles.cljs @@ -27,14 +27,6 @@ :android {:height 76} :ios {:height 74}}) -(def browser-icon-container - {:width 40 - :height 40 - :border-radius 20 - :background-color colors/gray-lighter - :align-items :center - :justify-content :center}) - (defstyle chat-info-container {:margin-bottom 13 :justify-content :space-between diff --git a/src/status_im/ui/screens/home/views/inner_item.cljs b/src/status_im/ui/screens/home/views/inner_item.cljs index 0c6de73f4e..03d87af7d9 100644 --- a/src/status_im/ui/screens/home/views/inner_item.cljs +++ b/src/status_im/ui/screens/home/views/inner_item.cljs @@ -14,9 +14,6 @@ [status-im.ui.components.icons.vector-icons :as vector-icons] [status-im.ui.components.chat-icon.screen :as chat-icon.screen] [status-im.ui.components.common.common :as components.common] - [status-im.ui.components.list-item.views :as list-item] - [clojure.string :as string] - [status-im.ui.components.chat-icon.screen :as chat-icon] [status-im.ui.components.list.views :as list])) (defview command-short-preview [message] @@ -123,18 +120,4 @@ :on-delete #(do (re-frame/dispatch [:set-swipe-position :chats home-item-id false]) (re-frame/dispatch [delete-action home-item-id]))} - [home-list-chat-item-inner-view home-item]])) - -(defn home-list-browser-item-inner-view [{:keys [dapp url name browser-id]}] - (let [photo-path (:photo-path dapp)] - [list-item/list-item - (merge - {:title name - :subtitle (or url (i18n/label :t/dapp)) - :on-press #(re-frame/dispatch [:browser.ui/browser-item-selected browser-id])} - (if dapp - (if (and photo-path (not (string/blank? (:photo-path dapp)))) - {:image-path photo-path} - {:image [chat-icon/default-browser-icon name]}) - {:image [react/view styles/browser-icon-container - [vector-icons/icon :main-icons/browser {:color colors/gray}]]}))])) + [home-list-chat-item-inner-view home-item]])) \ No newline at end of file diff --git a/src/status_im/ui/screens/wallet/actions.cljs b/src/status_im/ui/screens/wallet/actions.cljs deleted file mode 100644 index fa973cd76e..0000000000 --- a/src/status_im/ui/screens/wallet/actions.cljs +++ /dev/null @@ -1,17 +0,0 @@ -(ns status-im.ui.screens.wallet.actions - (:require [status-im.i18n :as i18n] - [re-frame.core :as re-frame] - [status-im.utils.universal-links.core :as universal-links] - [status-im.ui.components.list-selection :as list-selection])) - -(defn share-link [browser-id] - (let [link (universal-links/generate-link :browse :external browser-id) - message (i18n/label :t/share-dapp-text {:link link})] - (list-selection/open-share {:message message}))) - -(defn share [browser-id] - {:label (i18n/label :t/share-link) - :action #(share-link browser-id)}) - -(defn actions [browser-id] - [(share browser-id)]) diff --git a/src/status_im/utils/image.cljs b/src/status_im/utils/image.cljs index 967b57613f..d07ab2c644 100644 --- a/src/status_im/utils/image.cljs +++ b/src/status_im/utils/image.cljs @@ -1,11 +1,7 @@ (ns status-im.utils.image - (:require [clojure.string :as string] - [status-im.react-native.resources :as resources])) + (:require [clojure.string :as string])) (defn source [photo-path] - (if (and (not (string/blank? photo-path)) - (string/starts-with? photo-path "contacts://")) - (->> (string/replace photo-path #"contacts://" "") - (keyword) - (get resources/contacts)) + (when-not (and (not (string/blank? photo-path)) + (string/starts-with? photo-path "contacts://")) {:uri photo-path})) \ No newline at end of file diff --git a/test/cljs/status_im/test/browser/core.cljs b/test/cljs/status_im/test/browser/core.cljs index 6e7b090f63..8b46035c2b 100644 --- a/test/cljs/status_im/test/browser/core.cljs +++ b/test/cljs/status_im/test/browser/core.cljs @@ -1,7 +1,7 @@ (ns status-im.test.browser.core (:require [cljs.test :refer-macros [deftest is testing]] [status-im.browser.core :as browser] - [status-im.utils.types :as types])) + [status-im.utils.http :as http])) (defn has-navigated-to-browser? [result] (and (= (get result :status-im.ui.screens.navigation/navigate-to) @@ -20,23 +20,28 @@ nil (keys expected-browser)))) +(defn get-dapp-id [result dapp-url] + (some #(when (= (http/normalize-and-decode-url dapp-url) (first (:history %))) (:browser-id %)) + (vals (get-in result [:db :browser/browsers])))) + (deftest browser-test (let [dapp1-url "cryptokitties.co" dapp2-url "http://test2.com"] (testing "user opens a dapp" - (let [result-open (browser/open-url {:db {} :now 1} dapp1-url)] - (is (= dapp1-url (get-in result-open [:db :browser/options :browser-id])) + (let [result-open (browser/open-url {:db {} :now 1} dapp1-url) + dapp1-id (get-dapp-id result-open dapp1-url)] + (is (= dapp1-id (get-in result-open [:db :browser/options :browser-id])) "browser-id should be dapp1-url") (is (has-navigated-to-browser? result-open) "should navigate to :browser") (is (not (has-wrong-properties? result-open - dapp1-url - {:browser-id "cryptokitties.co" + dapp1-id + {:browser-id dapp1-id :history-index 0 :history ["http://cryptokitties.co"] - :dapp? true - :name "CryptoKitties" + :dapp? false + :name "browser" :timestamp 1})) "some properties of the browser are not correct") @@ -44,14 +49,14 @@ (let [result-open-2 (browser/open-url {:db (:db result-open) :now 2} dapp2-url) - dapp2-host "test2.com"] - (is (= dapp2-host (get-in result-open-2 [:db :browser/options :browser-id])) + dapp2-id (get-dapp-id result-open-2 dapp2-url)] + (is (= dapp2-id (get-in result-open-2 [:db :browser/options :browser-id])) "browser-id should be dapp2 host") (is (has-navigated-to-browser? result-open-2) "should navigate to :browser") (is (not (has-wrong-properties? result-open-2 - dapp2-host - {:browser-id "test2.com" + dapp2-id + {:browser-id dapp2-id :history-index 0 :history ["http://test2.com"] :dapp? false @@ -59,24 +64,23 @@ "some properties of the browser are not correct") (testing "then removes the second dapp" - (let [result-remove-2 (browser/remove-browser {:db (:db result-open-2)} dapp2-host)] - (is (= #{dapp1-url} + (let [result-remove-2 (browser/remove-browser {:db (:db result-open-2)} dapp2-id)] + (is (= #{dapp1-id} (set (keys (get-in result-remove-2 [:db :browser/browsers])))) "the second dapp shouldn't be in the browser list anymore"))))) (testing "then opens the dapp again" (let [result-open-existing (browser/open-existing-browser {:db (:db result-open) :now 2} - dapp1-url) - dapp1-url2 (str "http://" dapp1-url "/nav2") - browser (get-in result-open-existing [:db :browser/browsers dapp1-url])] + dapp1-id) + dapp1-url2 (str "http://" dapp1-url "/nav2")] (is (not (has-wrong-properties? result-open-existing - dapp1-url - {:browser-id "cryptokitties.co" + dapp1-id + {:browser-id dapp1-id :history-index 0 :history ["http://cryptokitties.co"] - :dapp? true - :name "CryptoKitties" + :dapp? false + :name "browser" :timestamp 2})) "some properties of the browser are not correct") (is (nil? (browser/navigate-to-next-page result-open-existing)) @@ -92,12 +96,12 @@ "loading" false}) false)] (is (not (has-wrong-properties? result-navigate - dapp1-url - {:browser-id "cryptokitties.co" + dapp1-id + {:browser-id dapp1-id :history-index 1 :history ["http://cryptokitties.co" dapp1-url2] - :dapp? true - :name "CryptoKitties" + :dapp? false + :name "browser" :timestamp 4})) "some properties of the browser are not correct") @@ -105,12 +109,12 @@ (let [result-previous (browser/navigate-to-previous-page {:db (:db result-navigate) :now 5})] (is (not (has-wrong-properties? result-previous - dapp1-url - {:browser-id "cryptokitties.co" + dapp1-id + {:browser-id dapp1-id :history-index 0 :history ["http://cryptokitties.co" dapp1-url2] - :dapp? true - :name "CryptoKitties" + :dapp? false + :name "browser" :timestamp 5})) "some properties of the browser are not correct") @@ -118,11 +122,11 @@ (let [result-next (browser/navigate-to-next-page {:db (:db result-previous) :now 6})] (is (not (has-wrong-properties? result-next - dapp1-url - {:browser-id "cryptokitties.co" + dapp1-id + {:browser-id dapp1-id :history-index 1 :history ["http://cryptokitties.co" dapp1-url2] - :dapp? true - :name "CryptoKitties" + :dapp? false + :name "browser" :timestamp 6})) "some properties of the browser are not correct")))))))))))) diff --git a/test/cljs/status_im/test/browser/permissions.cljs b/test/cljs/status_im/test/browser/permissions.cljs index 030b3362ac..049721044f 100644 --- a/test/cljs/status_im/test/browser/permissions.cljs +++ b/test/cljs/status_im/test/browser/permissions.cljs @@ -2,16 +2,18 @@ (:require [cljs.test :refer-macros [deftest is testing]] [status-im.browser.permissions :as permissions] [status-im.utils.types :as types] - [status-im.browser.core :as browser])) + [status-im.browser.core :as browser] + [status-im.test.browser.core :as core.tests])) (deftest permissions-test (let [dapp-name "test.com" dapp-name2 "test2.org" cofx {:db (assoc-in (:db (browser/open-url {:db {}} dapp-name)) - [:account/account :public-key] "public-key")}] + [:account/account :public-key] "public-key")} + dapp-id (core.tests/get-dapp-id cofx dapp-name)] (testing "dapps permissions are initialized" (is (zero? (count (get-in cofx [:db :dapps/permissions])))) - (is (= dapp-name (get-in cofx [:db :browser/options :browser-id])))) + (is (= dapp-id (get-in cofx [:db :browser/options :browser-id])))) (testing "receiving an unsupported permission" (let [result-ask (browser/process-bridge-message cofx diff --git a/test/cljs/status_im/test/chat/views/photos.cljs b/test/cljs/status_im/test/chat/views/photos.cljs index 24f376d18e..df96cec52d 100644 --- a/test/cljs/status_im/test/chat/views/photos.cljs +++ b/test/cljs/status_im/test/chat/views/photos.cljs @@ -1,13 +1,8 @@ (ns status-im.test.chat.views.photos (:require [cljs.test :refer [deftest testing is]] - [status-im.react-native.resources :as resources] [status-im.utils.image :as utils.image])) (deftest photos-test (testing "a normal string" (let [actual (utils.image/source "some-string")] - (is (= {:uri "some-string"} actual)))) - (testing "a contact string" - (with-redefs [resources/contacts {:test "something"}] - (let [actual (utils.image/source "contacts://test")] - (is (= "something" actual)))))) + (is (= {:uri "some-string"} actual))))) diff --git a/test/cljs/status_im/test/sign_in/flow.cljs b/test/cljs/status_im/test/sign_in/flow.cljs index 440e526f5e..88c2a4b9e4 100644 --- a/test/cljs/status_im/test/sign_in/flow.cljs +++ b/test/cljs/status_im/test/sign_in/flow.cljs @@ -5,7 +5,6 @@ (:require [cljs.test :refer-macros [deftest is are testing]] [status-im.accounts.login.core :as login.core] [status-im.events :as events] - [status-im.ui.screens.browser.default-dapps :as default-dapps] [status-im.test.sign-in.data :as data] [status-im.signals.core :as signals])) @@ -41,7 +40,6 @@ :all-installations [] :all-stored-browsers [] :all-dapp-permissions [] - :default-dapps default-dapps/all :get-all-stored-chats data/get-chats} efx (events/account-change-success cofx [nil "address"]) new-db (:db efx)] diff --git a/translations/en.json b/translations/en.json index cbd6319bf1..5ebc4949f3 100644 --- a/translations/en.json +++ b/translations/en.json @@ -998,5 +998,7 @@ "invalid-format": "Invalid format\nMust be {{format}}", "mailserver-format": "enode://{enode-id}:{password}@{ip-address}:{port}", "bootnode-format": "enode://{enode-id}@{ip-address}:{port}", - "fetch-messages": "↓ Fetch messages" + "fetch-messages": "↓ Fetch messages", + "open-dapp-store": "Discover ÐApps", + "browsed-websites": "Browsed websites will appear here." }