Skip to content

Commit

Permalink
fix(ui-ux): add dxchf backing address to proof of backing (#1933)
Browse files Browse the repository at this point in the history
* added dXCHF

* added dXCHF in e2e test

* Check if cake exists
  • Loading branch information
nattadex authored Apr 30, 2024
1 parent f6b7663 commit 55700f7
Show file tree
Hide file tree
Showing 4 changed files with 106 additions and 65 deletions.
4 changes: 4 additions & 0 deletions cypress/fixtures/proof-of-backing/backingAddresses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,8 @@ export const quantumBackingAddresses = [
token: "dEUROC",
link: "https://etherscan.io/address/0xc3F5f07143c567D657beFAE6752382b160d17317",
},
{
token: "dXCHF",
link: "https://etherscan.io/address/0xc3F5f07143c567D657beFAE6752382b160d17317",
},
];
12 changes: 11 additions & 1 deletion src/constants/TokenBackedAddress.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
interface BackedAddress {
[key: string]: {
cake: {
cake?: {
link: string;
address: string;
};
Expand Down Expand Up @@ -109,6 +109,12 @@ export const TOKEN_BACKED_ADDRESS: BackedAddress = {
"0xe319ee27de5d3cb4a2345c8b714a69d6710ca05395e3709983d886061b1b818d",
},
},
XCHF: {
quantum: {
link: "https://etherscan.io/address/0xc3F5f07143c567D657beFAE6752382b160d17317",
address: "0xc3F5f07143c567D657beFAE6752382b160d17317",
},
},
};

interface TokenBacked {
Expand Down Expand Up @@ -165,4 +171,8 @@ export const TOKEN_BACKED: TokenBacked[] = [
name: "dSUI",
symbol: "SUI",
},
{
name: "dXCHF",
symbol: "XCHF",
},
];
2 changes: 1 addition & 1 deletion src/pages/proof-of-backing/_components/BackingTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ function TableRow({
{backedAddress.cake.address}
</a>
) : (
<div className="h-full px-6 flex items-center text-gray-500 dark:text-dark-gray-500 border-gray-300 dark:border-dark-gray-300 border-r-[0.5px]">
<div className="h-full border-x-[0.5px] px-6 flex items-center text-gray-500 dark:text-dark-gray-500 border-gray-300 dark:border-dark-gray-300 border-r-[0.5px]">
N/A
</div>
)}
Expand Down
153 changes: 90 additions & 63 deletions src/pages/tokens/[id].page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -281,80 +281,107 @@ function BackingAddress({ tokenSymbol }: { tokenSymbol: string }): JSX.Element {
{(() => {
switch (tokenSymbol) {
case "BCH":
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.BCH.cake.link}
text={TOKEN_BACKED_ADDRESS.BCH.cake.address}
testId="BackingAddress.BCH"
/>
);
if (TOKEN_BACKED_ADDRESS.BCH.cake) {
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.BCH.cake.link}
text={TOKEN_BACKED_ADDRESS.BCH.cake.address}
testId="BackingAddress.BCH"
/>
);
}
break;
case "LTC":
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.LTC.cake.link}
text={TOKEN_BACKED_ADDRESS.LTC.cake.address}
testId="BackingAddress.LTC"
/>
);
if (TOKEN_BACKED_ADDRESS.LTC.cake) {
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.LTC.cake.link}
text={TOKEN_BACKED_ADDRESS.LTC.cake.address}
testId="BackingAddress.LTC"
/>
);
}
break;
case "DOGE":
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.DOGE.cake.link}
text={TOKEN_BACKED_ADDRESS.DOGE.cake.address}
testId="BackingAddress.DOGE"
/>
);
if (TOKEN_BACKED_ADDRESS.DOGE.cake) {
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.DOGE.cake.link}
text={TOKEN_BACKED_ADDRESS.DOGE.cake.address}
testId="BackingAddress.DOGE"
/>
);
}
break;
case "BTC":
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.BTC.cake.link}
text={TOKEN_BACKED_ADDRESS.BTC.cake.address}
testId="BackingAddress.BTC"
/>
);
if (TOKEN_BACKED_ADDRESS.BTC.cake) {
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.BTC.cake.link}
text={TOKEN_BACKED_ADDRESS.BTC.cake.address}
testId="BackingAddress.BTC"
/>
);
}
break;
case "MATIC":
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.MATIC.cake.link}
text={TOKEN_BACKED_ADDRESS.MATIC.cake.address}
testId="BackingAddress.MATIC"
/>
);
if (TOKEN_BACKED_ADDRESS.MATIC.cake) {
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.MATIC.cake.link}
text={TOKEN_BACKED_ADDRESS.MATIC.cake.address}
testId="BackingAddress.MATIC"
/>
);
}
break;
case "SOL":
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.SOL.cake.link}
text={TOKEN_BACKED_ADDRESS.SOL.cake.address}
testId="BackingAddress.SOL"
/>
);
if (TOKEN_BACKED_ADDRESS.SOL.cake) {
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.SOL.cake.link}
text={TOKEN_BACKED_ADDRESS.SOL.cake.address}
testId="BackingAddress.SOL"
/>
);
}
break;
case "DOT":
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.DOT.cake.link}
text={TOKEN_BACKED_ADDRESS.DOT.cake.address}
testId="BackingAddress.DOT"
/>
);
if (TOKEN_BACKED_ADDRESS.DOT.cake) {
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.DOT.cake.link}
text={TOKEN_BACKED_ADDRESS.DOT.cake.address}
testId="BackingAddress.DOT"
/>
);
}
break;
case "SUI":
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.SUI.cake.link}
text={TOKEN_BACKED_ADDRESS.SUI.cake.address}
testId="BackingAddress.SUI"
/>
);
if (TOKEN_BACKED_ADDRESS.SUI.cake) {
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.SUI.cake.link}
text={TOKEN_BACKED_ADDRESS.SUI.cake.address}
testId="BackingAddress.SUI"
/>
);
}
break;
case "ETH":
case "USDC":
case "USDT":
case "EUROC":
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.ETH.cake.link}
text={TOKEN_BACKED_ADDRESS.ETH.cake.address}
testId="BackingAddress.ETH"
/>
);
if (TOKEN_BACKED_ADDRESS.ETH.cake) {
return (
<AddressLinkExternal
url={TOKEN_BACKED_ADDRESS.ETH.cake.link}
text={TOKEN_BACKED_ADDRESS.ETH.cake.address}
testId="BackingAddress.ETH"
/>
);
}
break;
}
})()}
</AdaptiveList.Row>
Expand Down

0 comments on commit 55700f7

Please sign in to comment.