Skip to content

Commit

Permalink
fix: added warning for transferring exp
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholaswma committed Jan 17, 2025
1 parent 7d50590 commit f7d7260
Show file tree
Hide file tree
Showing 6 changed files with 75 additions and 14 deletions.
16 changes: 13 additions & 3 deletions assets/_locales/en/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2034,14 +2034,24 @@
"message": "Congrats on earning AO Tokens for hodling AR! 🥳",
"description": "ao token announcement title text"
},
"ao_token_send_popup": {
"AO_token_send_popup": {
"message": "The AO token is non transferable until February 8th, 2025 when 15% of AO has been minted.",
"description": "Popup description about ao token transfer"
},
"ao_token_send_popup_title": {
"message": "AO Token Transfer Notice",
"EXP_token_send_popup": {
"message": "The EXP Token is non transferable",
"description": "Popup description about ao token transfer"
},
"token_send_popup_title": {
"message": "$TOKEN$ Token Transfer Notice",
"description": "Popup description about token transfer",
"placeholders": {
"token": {
"content": "$1",
"example": "AO"
}
}
},
"ao_token_send_popup_learn_more": {
"message": "Learn More",
"description": "Popup description about ao token transfer learn more"
Expand Down
18 changes: 16 additions & 2 deletions assets/_locales/zh_CN/messages.json
Original file line number Diff line number Diff line change
Expand Up @@ -2024,8 +2024,22 @@
"message": "恭喜您通过持有 AR 获得 AO 代币!🥳",
"description": "ao token announcement title text"
},
"ao_token_send_popup": {
"message": "AO 代币在 2025 年 2 月 8 日之前不可转让,届时 AO 的 15% 已被铸造。",
"token_send_popup_title": {
"message": "$TOKEN$ 代币转账提示",
"description": "Popup description about token transfer",
"placeholders": {
"token": {
"content": "$1",
"example": "AO"
}
}
},
"AO_token_send_popup": {
"message": "在2025年2月8日前,当AO代币铸造量达到15%之前,AO代币无法转账。",
"description": "Popup description about ao token transfer"
},
"EXP_token_send_popup": {
"message": "EXP代币无法转账",
"description": "Popup description about ao token transfer"
},
"ao_token_send_popup_title": {
Expand Down
Binary file added assets/ecosystem/exp-token-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 38 additions & 6 deletions src/routes/popup/send/announcement.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@ import { ButtonV2, ModalV2, Spacer } from "@arconnect/components";
import { useRef } from "react";
import browser from "webextension-polyfill";
import aoLogo from "url:/assets/ecosystem/ao-token-logo.png";
import expLogo from "url:/assets/ecosystem/exp-token-logo.png";

import {
HeaderText,
CenterText,
Content,
ContentWrapper
} from "~components/modals/Components";

export const AnnouncementPopup = ({ isOpen, setOpen }) => {
const tokenData = {
AO: {
learnMoreLink:
"https://mirror.xyz/0x1EE4bE8670E8Bd7E9E2E366F530467030BE4C840/-UWra0q0KWecSpgg2-c37dbZ0lnOMEScEEkabVm9qaQ",
image: aoLogo
},
EXP: {
learnMoreLink: "https://x.com/ar_io_network/status/1879961321170706490",
image: expLogo
}
} as const;

export const AnnouncementPopup = ({ isOpen, setOpen, ticker }) => {
const modalRef = useRef(null);

return (
Expand All @@ -22,21 +36,39 @@ export const AnnouncementPopup = ({ isOpen, setOpen }) => {
<Content>
<div>
<img
src={aoLogo}
alt="ao logo"
src={(() => {
switch (ticker) {
case "AO":
return tokenData.AO.image;
case "EXP":
return tokenData.EXP.image;
default:
return "";
}
})()}
alt={`${ticker} logo`}
style={{ width: "100px", height: "auto" }}
/>
<HeaderText noMargin heading>
{browser.i18n.getMessage("ao_token_send_popup_title")}
{browser.i18n.getMessage("token_send_popup_title", [ticker])}
</HeaderText>
<Spacer y={1} />
<CenterText>
{browser.i18n.getMessage("ao_token_send_popup")}
{browser.i18n.getMessage(`${ticker}_token_send_popup`)}
</CenterText>
<Spacer y={1} />
<CenterText>
<a
href="https://mirror.xyz/0x1EE4bE8670E8Bd7E9E2E366F530467030BE4C840/-UWra0q0KWecSpgg2-c37dbZ0lnOMEScEEkabVm9qaQ"
href={(() => {
switch (ticker) {
case "AO":
return tokenData.AO.learnMoreLink;
case "EXP":
return tokenData.EXP.learnMoreLink;
default:
return "#";
}
})()}
target="_blank"
rel="noopener noreferrer"
onClick={(e) => e.stopPropagation()}
Expand Down
10 changes: 7 additions & 3 deletions src/routes/popup/send/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ import { useContact } from "~contacts/hooks";
import aoLogo from "url:/assets/ecosystem/ao-logo.svg";
import { useAoTokens } from "~tokens/aoTokens/ao";
import BigNumber from "bignumber.js";
import { AO_NATIVE_TOKEN } from "~utils/ao_import";
import { AO_NATIVE_TOKEN, EXP_TOKEN } from "~utils/ao_import";
import { AnnouncementPopup } from "./announcement";
import type { CommonRouteProps } from "~wallets/router/router.types";

Expand Down Expand Up @@ -382,8 +382,12 @@ export function SendView({ params: { id } }: SendViewProps) {
}}
title={browser.i18n.getMessage("send")}
/>
{AO_NATIVE_TOKEN === tokenID && (
<AnnouncementPopup isOpen={isOpen} setOpen={setOpen} />
{(AO_NATIVE_TOKEN === tokenID || EXP_TOKEN === tokenID) && (
<AnnouncementPopup
isOpen={isOpen}
setOpen={setOpen}
ticker={token.ticker}
/>
)}
<Wrapper showOverlay={showSlider || degraded}>
<SendForm>
Expand Down
1 change: 1 addition & 0 deletions src/utils/ao_import.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { getAoTokens } from "~tokens";
import { ExtensionStorage } from "./storage";

export const AO_NATIVE_TOKEN = "m3PaWzK4PTG9lAaqYQPaPdOcXdO8hYqi5Fe9NWqXd0w";
export const EXP_TOKEN = "aYrCboXVSl1AXL9gPFe3tfRxRf0ZmkOXH65mKT0HHZw";
export const AO_NATIVE_TOKEN_BALANCE_MIRROR =
"Pi-WmAQp2-mh-oWH9lWpz5EthlUDj_W0IusAv-RXhRk";
export const AO_NATIVE_OLD_TOKEN =
Expand Down

0 comments on commit f7d7260

Please sign in to comment.