diff --git a/assets/_locales/en/messages.json b/assets/_locales/en/messages.json index 608509bc6..596c707ce 100644 --- a/assets/_locales/en/messages.json +++ b/assets/_locales/en/messages.json @@ -1693,8 +1693,8 @@ "message": "A provably neutral publishing platform aimed at dis-intermediating the truth. Publish assertions, and take your position in the Fact Marketplace!", "description": "placeholder for example get started" }, - "example_bark_description" : { - "message": "Bark is a decentralized exchange to swap assets on the aoComputer network.", + "example_botega_description" : { + "message": "Botega is a decentralized exchange to swap assets on the aoComputer network.", "description": "placeholder for example get started" }, "connect_with_us_title": { diff --git a/assets/_locales/zh_CN/messages.json b/assets/_locales/zh_CN/messages.json index 0bfc4df4b..6efe1cbca 100644 --- a/assets/_locales/zh_CN/messages.json +++ b/assets/_locales/zh_CN/messages.json @@ -1682,8 +1682,8 @@ "message": "一个旨在去中介化真相的证明中立出版平台。发布声明,并在事实市场中占据您的位置!", "description": "Placeholder for example get started" }, - "example_bark_description": { - "message": "Bark 是一个去中心化交易所,用于在 aoComputer 网络上交换资产。", + "example_botega_description": { + "message": "Botega 是一个去中心化交易所,用于在 aoComputer 网络上交换资产。", "description": "Placeholder for example get started" }, "connect_with_us_title": { diff --git a/assets/ecosystem/botega.svg b/assets/ecosystem/botega.svg new file mode 100644 index 000000000..e8a768ac3 --- /dev/null +++ b/assets/ecosystem/botega.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/src/components/popup/WalletHeader.tsx b/src/components/popup/WalletHeader.tsx index db3172fd7..a1a2d1c3c 100644 --- a/src/components/popup/WalletHeader.tsx +++ b/src/components/popup/WalletHeader.tsx @@ -206,10 +206,9 @@ export default function WalletHeader() { { icon: , title: "setting_contacts", - route: () => - browser.tabs.create({ - url: browser.runtime.getURL("tabs/dashboard.html#/contacts") - }) + route: () => { + push("/quick-settings/contacts"); + } }, { icon: , diff --git a/src/components/popup/WalletSwitcher.tsx b/src/components/popup/WalletSwitcher.tsx index f9039b3ed..e8dbca9e6 100644 --- a/src/components/popup/WalletSwitcher.tsx +++ b/src/components/popup/WalletSwitcher.tsx @@ -27,6 +27,7 @@ import Arweave from "arweave"; import { svgie } from "~utils/svgies"; import { Action } from "./WalletHeader"; import copy from "copy-to-clipboard"; +import { useHistory } from "~utils/hash_router"; export default function WalletSwitcher({ open, @@ -165,6 +166,8 @@ export default function WalletSwitcher({ // toasts const { setToast } = useToasts(); + const [push] = useHistory(); + return ( {open && ( @@ -239,6 +242,7 @@ export default function WalletSwitcher({ ))} + {showOptions && ( - browser.tabs.create({ - url: browser.runtime.getURL( - `tabs/dashboard.html#/wallets/${activeAddress}` - ) - }) - } + onClick={(e) => { + e.preventDefault(); + + push(`/quick-settings/wallets/${activeAddress}`); + }} /> diff --git a/src/injected.ts b/src/injected.ts index 423b71e19..b4e8b0f27 100644 --- a/src/injected.ts +++ b/src/injected.ts @@ -85,6 +85,35 @@ for (const mod of modules) { // @ts-expect-error window.arweaveWallet = WalletAPI; +/* +if (process.env.NODE_ENV === "development") { + // @ts-expect-error + window.arweaveWalletDev = WalletAPI; + + console.log(`Forcing development wallet (${ WalletAPI.walletName } ${ WalletAPI.walletVersion }) to be injected...`); + + const t0 = Date.now(); + + const intervalID = setInterval(() => { + if (window.arweaveWallet && window.arweaveWallet !== WalletAPI) { + // @ts-expect-error + console.log(`Another wallet (${ window.arweaveWallet.walletName } ${ window.arweaveWallet.walletVersion }) was injected. Overriding...`); + + // @ts-expect-error + window.arweaveWallet = WalletAPI; + } + + const elapsed = Date.now() - t0; + + if (elapsed >= 30000) { + console.log(`Stopped forcing development wallet (${ WalletAPI.walletName } ${ WalletAPI.walletVersion }) to be injected.`); + + clearInterval(intervalID); + } + }, 250); +} +*/ + // at the end of the injected script, // we dispatch the wallet loaded event dispatchEvent(new CustomEvent("arweaveWalletLoaded", { detail: {} })); diff --git a/src/routes/popup/tokens.tsx b/src/routes/popup/tokens.tsx index b15e3ead1..e9d55346b 100644 --- a/src/routes/popup/tokens.tsx +++ b/src/routes/popup/tokens.tsx @@ -22,7 +22,9 @@ import { useStorage } from "@plasmohq/storage/hook"; export default function Tokens() { const [isLoading, setIsLoading] = useState(false); - const [hasNextPage, setHasNextPage] = useState(true); + const [hasNextPage, setHasNextPage] = useState( + undefined + ); // all tokens const tokens = useTokens(); // ao Tokens @@ -166,9 +168,7 @@ export default function Tokens() { onClick={() => push(`/token/${token.id}`)} onSettingsClick={(e) => { e.preventDefault(); - window.open( - `${browser.runtime.getURL("tabs/dashboard.html")}#/tokens` - ); + push(`/quick-settings/tokens/${token.id}`); }} key={i} /> @@ -192,9 +192,10 @@ export default function Tokens() { }} /> ))} + {aoSupport && hasNextPage && ( @@ -207,8 +208,14 @@ export default function Tokens() { )} )} + { + e.preventDefault(); + push("/quick-settings/tokens"); + }} > {browser.i18n.getMessage("manage_assets_button")} diff --git a/src/routes/popup/transaction/[id].tsx b/src/routes/popup/transaction/[id].tsx index f70c9c64c..79349fe7f 100644 --- a/src/routes/popup/transaction/[id].tsx +++ b/src/routes/popup/transaction/[id].tsx @@ -151,7 +151,7 @@ export default function Transaction({ id: rawId, gw, message }: Props) { timestamp } } - } + } `, { id }, gateway @@ -387,15 +387,16 @@ export default function Transaction({ id: rawId, gw, message }: Props) { {browser.i18n.getMessage("user_not_in_contacts")}{" "} { + onClick={(e) => { + e.preventDefault(); + trackEvent(EventType.ADD_CONTACT, { fromSendFlow: true }); - browser.tabs.create({ - url: browser.runtime.getURL( - `tabs/dashboard.html#/contacts/new?address=${fromAddress}` - ) - }); + + push( + `/quick-settings/contacts/new?address=${fromAddress}` + ); }} > {browser.i18n.getMessage("create_contact")} @@ -438,15 +439,16 @@ export default function Transaction({ id: rawId, gw, message }: Props) { {browser.i18n.getMessage("user_not_in_contacts")}{" "} { + onClick={(e) => { + e.preventDefault(); + trackEvent(EventType.ADD_CONTACT, { fromSendFlow: true }); - browser.tabs.create({ - url: browser.runtime.getURL( - `tabs/dashboard.html#/contacts/new?address=${toAddress}` - ) - }); + + push( + `/quick-settings/contacts/new?address=${toAddress}` + ); }} > {browser.i18n.getMessage("create_contact")} diff --git a/src/routes/welcome/gettingStarted/explore.tsx b/src/routes/welcome/gettingStarted/explore.tsx index 4e7f936e4..068fe0330 100644 --- a/src/routes/welcome/gettingStarted/explore.tsx +++ b/src/routes/welcome/gettingStarted/explore.tsx @@ -1,7 +1,7 @@ import { Spacer, Text } from "@arconnect/components"; import AstroLogo from "url:/assets/ecosystem/astro.png"; import protocollandLogo from "url:/assets/ecosystem/protocolland.svg"; -import barkLogo from "url:/assets/ecosystem/bark.png"; +import botegaLogo from "url:/assets/ecosystem/botega.svg"; import Paragraph from "~components/Paragraph"; import browser from "webextension-polyfill"; import styled from "styled-components"; @@ -41,9 +41,9 @@ export default function Explore() { - {"Bark"} + {"Botega"} - {browser.i18n.getMessage("example_bark_description")} + {browser.i18n.getMessage("example_botega_description")} diff --git a/src/tokens/aoTokens/ao.ts b/src/tokens/aoTokens/ao.ts index 7be33ac23..4ae02a656 100644 --- a/src/tokens/aoTokens/ao.ts +++ b/src/tokens/aoTokens/ao.ts @@ -30,25 +30,11 @@ export const defaultAoTokens: TokenInfo[] = [ processId: "m3PaWzK4PTG9lAaqYQPaPdOcXdO8hYqi5Fe9NWqXd0w" }, { - Name: "TRUNK", - Ticker: "TRUNK", - Denomination: 3, - Logo: "4eTBOaxZSSyGbpKlHyilxNKhXbocuZdiMBYIORjS4f0", - processId: "OT9qTE2467gcozb2g8R6D6N3nQS94ENcaAIJfUzHCww" - }, - { - Name: "Bark", - Ticker: "BRKTST", - Denomination: 3, - Logo: "AdFxCN1eEPboxNpCNL23WZRNhIhiamOeS-TUwx_Nr3Q", - processId: "8p7ApPZxC_37M06QHVejCQrKsHbcJEerd3jWNkDUWPQ" - }, - { - Name: "Astro USD (Test)", - Ticker: "USDA-TST", + Name: "Q Arweave", + Ticker: "qAR", Denomination: 12, - Logo: "", - processId: "GcFxqTQnKHcr304qnOcq00ZqbaYGDn4Wbb0DHAM-wvU" + Logo: "26yDr08SuwvNQ4VnhAfV4IjJcOOlQ4tAQLc1ggrCPu0", + processId: "NG-0lVX882MG5nhARrSzyprEK6ejonHpdUmaaMPsHE8" } ]; diff --git a/src/utils/apps.ts b/src/utils/apps.ts index acdf2f34a..3608e1453 100644 --- a/src/utils/apps.ts +++ b/src/utils/apps.ts @@ -5,7 +5,7 @@ import arwikiLogo from "url:/assets/ecosystem/arwiki.png"; import bazarLogo from "url:/assets/ecosystem/bazar.png"; import protocollandLogo from "url:/assets/ecosystem/protocolland.svg"; import permaswapLogo from "url:/assets/ecosystem/permaswap.svg"; -import barkLogo from "url:/assets/ecosystem/bark.png"; +import botegaLogo from "url:/assets/ecosystem/botega.svg"; import arnsLogo from "url:/assets/ecosystem/arns.svg"; import astroLogo from "url:/assets/ecosystem/astro.png"; import permapagesLogo from "url:/assets/ecosystem/permapages.svg"; @@ -38,17 +38,17 @@ export interface App { export const apps: App[] = [ { - name: "Bark", + name: "Botega", category: "Exchange", - description: "Bark is the AO Computer's first decentralized exchange.", + description: "Botega is the AO Computer's first decentralized exchange.", assets: { - logo: barkLogo, - thumbnail: "/apps/bark/thumbnail.png", + logo: botegaLogo, + thumbnail: "", lightBackground: "rgba(230, 235, 240, 1)", darkBackground: "rgba(19, 28, 37, 1)" }, links: { - website: "https://bark.arweave.dev" + website: "https://botega.arweave.dev/#/swap" } }, {