Skip to content

Commit 2fb4724

Browse files
author
tiltom
authored
SOV-5053: Add PowPeg option to the Fund Wallet dialog (#2627)
* Add PowPeg to Fund Wallet dialog * Do not mark PowPeg as recommended
1 parent f8efa72 commit 2fb4724

4 files changed

Lines changed: 65 additions & 11 deletions

File tree

src/app/components/UserAssets/components/UserAssetsTableRow.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ import { contractReader } from 'utils/sovryn/contract-reader';
1212
import { useAccount, useBlockSync } from 'app/hooks/useAccount';
1313
import { AssetRenderer } from '../../AssetRenderer/';
1414
import { Sovryn } from 'utils/sovryn';
15-
import { useMaintenance } from 'app/hooks/useMaintenance';
1615
import { Button, ButtonSize, ButtonStyle } from '../../Button';
1716
import { BridgeLink } from './BridgeLink';
1817
import { useDollarValue } from 'app/hooks/useDollarValue';
@@ -24,6 +23,7 @@ import usdtIcon from 'app/pages/BridgeDepositPage/dictionaries/assets/icons/usdt
2423
import usdcIcon from 'app/pages/BridgeDepositPage/dictionaries/assets/icons/usdc.svg';
2524
import daiIcon from 'app/pages/BridgeDepositPage/dictionaries/assets/icons/dai.svg';
2625
import { BABELFISH_APP_LINK } from 'utils/classifiers';
26+
import { useMaintenance } from 'app/hooks/useMaintenance';
2727

2828
interface IUserAssetsTableRow {
2929
item: AssetDetails;
@@ -199,6 +199,29 @@ export const UserAssetsTableRow: React.FC<IUserAssetsTableRow> = ({
199199
</Tooltip>
200200
</>
201201
)}
202+
{/* {asset === Asset.RBTC && (
203+
<>
204+
<Tooltip
205+
position="top"
206+
hoverOpenDelay={0}
207+
hoverCloseDelay={0}
208+
interactionKind="hover"
209+
content={t(translations.userAssets.sendOrReceiveMessage, {
210+
asset,
211+
})}
212+
className="tw-flex tw-items-center"
213+
>
214+
<Button
215+
text={t(translations.common.sendOrReceive)}
216+
href={POWPEG_LINK}
217+
hrefExternal
218+
style={ButtonStyle.link}
219+
size={ButtonSize.sm}
220+
dataActionId={`portfolio-action-open-powpeg-${asset}`}
221+
/>
222+
</Tooltip>
223+
</>
224+
)} */}
202225
{[Asset.USDT, Asset.RDOC].includes(asset) && (
203226
<Button
204227
text={t(translations.userAssets.actions.convert)}

src/app/pages/ReceiveRBTCPage/index.tsx

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { Trans, useTranslation } from 'react-i18next';
1313
import { translations } from 'locales/i18n';
1414
import { Tooltip } from '@blueprintjs/core';
1515
import { useMaintenance } from 'app/hooks/useMaintenance';
16-
import { discordInvite } from 'utils/classifiers';
16+
import { discordInvite, POWPEG_LINK } from 'utils/classifiers';
1717

1818
export const ReceiveRBTCPage: React.FC = () => {
1919
const { t } = useTranslation();
@@ -30,7 +30,7 @@ export const ReceiveRBTCPage: React.FC = () => {
3030
[fastBtcReceiveLocked],
3131
);
3232

33-
const btcButton = useMemo(
33+
const fastBtcButton = useMemo(
3434
() => (
3535
<Link onClick={onBtcClicked} to="/fast-btc/deposit">
3636
<SelectBox disabled={fastBtcReceiveLocked}>
@@ -41,6 +41,17 @@ export const ReceiveRBTCPage: React.FC = () => {
4141
[fastBtcReceiveLocked, onBtcClicked],
4242
);
4343

44+
const powPegButton = useMemo(
45+
() => (
46+
<a href={POWPEG_LINK} target="_blank" rel="noreferrer noopener">
47+
<SelectBox>
48+
<img src={btcIcon} alt="PowPeg" />
49+
</SelectBox>
50+
</a>
51+
),
52+
[],
53+
);
54+
4455
const onBankClicked = useCallback(
4556
e => {
4657
if (fastBtcReceiveLocked || transakLocked) {
@@ -96,8 +107,22 @@ export const ReceiveRBTCPage: React.FC = () => {
96107
<div className="tw-mb-20 tw-text-base tw-text-center tw-font-semibold">
97108
{t(translations.receiveRBTCPage.selectSource)}
98109
</div>
99-
<div className="tw-flex tw-items-center tw-justify-center">
100-
<div className="tw-text-center">
110+
<div className="tw-flex tw-items-stretch tw-justify-center">
111+
<div className="tw-text-center tw-h-full">
112+
{powPegButton}
113+
<p className="tw-mt-3 tw-font-medium">
114+
{t(translations.receiveRBTCPage.powPeg)}
115+
</p>
116+
{/* <p className="tw-mt-3 tw-mb-1 tw-font-medium">
117+
{t(translations.receiveRBTCPage.powPeg)} <br />
118+
</p>
119+
120+
<p className="tw-my-0 tw-text-xs tw-font-medium tw-text-success-50">
121+
{t(translations.common.recommended)}
122+
</p> */}
123+
</div>
124+
125+
<div className="tw-text-center tw-h-full">
101126
{fastBtcReceiveLocked ? (
102127
<Tooltip
103128
position="top"
@@ -122,17 +147,17 @@ export const ReceiveRBTCPage: React.FC = () => {
122147
</>
123148
}
124149
>
125-
{btcButton}
150+
{fastBtcButton}
126151
</Tooltip>
127152
) : (
128-
btcButton
153+
fastBtcButton
129154
)}
130155
<p className="tw-mt-3 tw-font-medium">
131-
{t(translations.receiveRBTCPage.bitcoinNetwork)}
156+
{t(translations.receiveRBTCPage.fastBtc)}
132157
</p>
133158
</div>
134159

135-
<div className="tw-text-center">
160+
<div className="tw-text-center tw-h-full">
136161
{fastBtcReceiveLocked || transakLocked ? (
137162
<Tooltip
138163
position="top"

src/locales/en/translation.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@
3737
"walletCompatibility": "Wallet Compatibility",
3838
"send": "Send",
3939
"receive": "Receive",
40-
"save": "Save"
40+
"sendOrReceive": "Send / Receive",
41+
"save": "Save",
42+
"recommended": "Recommended"
4143
},
4244
"tradeEvents": {
4345
"CloseWithSwap": "Withdraw",
@@ -233,7 +235,8 @@
233235
"title": "Receive RBTC",
234236
"description": "Receive RBTC via bitcoin or bank/card transfer",
235237
"selectSource": "Select Source",
236-
"bitcoinNetwork": "Bitcoin Network",
238+
"fastBtc": "Fast BTC",
239+
"powPeg": "PowPeg",
237240
"bankCard": "Bank/Card"
238241
},
239242
"fastBtcPage": {
@@ -1287,6 +1290,7 @@
12871290
},
12881291
"sendMessage": "Send {{asset}} from your connected address in the RSK network",
12891292
"receiveMessage": "Receive {{asset}} to your connected address in the RSK network",
1293+
"sendOrReceiveMessage": "Send or receive {{asset}} from/to your connected address in the RSK network",
12901294
"convertDialog": {
12911295
"title": "Convert",
12921296
"from": "From",

src/utils/classifiers.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,8 @@ export const CREATE_TICKET_LINK = 'https://help.sovryn.app/';
159159

160160
export const BABELFISH_APP_LINK = 'https://app.babelfish.money';
161161

162+
export const POWPEG_LINK = 'https://powpeg.rootstock.io/';
163+
162164
export const WIKI_LIMIT_ORDER_LIMITS_LINK =
163165
'https://wiki.sovryn.app/en/sovryn-dapp/limit-order-limitations';
164166
export const WIKI_LIMIT_ORDER_WALLETS_LINK =

0 commit comments

Comments
 (0)