Skip to content

Commit 07ea421

Browse files
author
Nikhil Saboo
committed
Merge branch 'staging'
2 parents 7593223 + 58472b5 commit 07ea421

File tree

1 file changed

+44
-19
lines changed

1 file changed

+44
-19
lines changed

pages/deposit.tsx

Lines changed: 44 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -285,21 +285,7 @@ const DepositPage: NextPage = () => {
285285
const [currency, setCurrency] = useState<DepositCurrency | undefined>("ztg");
286286
const [paymentMethod, setPaymentMethod] = useState<
287287
DepositPaymentMethod | undefined
288-
>("crypto");
289-
290-
const disabledPaymentMethods = useMemo<
291-
DepositPaymentMethod[] | undefined
292-
>(() => {
293-
if (currency === "ztg") {
294-
return ["card"];
295-
}
296-
}, [currency]);
297-
298-
useEffect(() => {
299-
if (currency === "ztg" && method === "buy" && paymentMethod === "card") {
300-
setPaymentMethod(undefined);
301-
}
302-
}, [currency, method, paymentMethod]);
288+
>("card");
303289

304290
const encodedAddress =
305291
wallet.realAddress &&
@@ -342,21 +328,60 @@ const DepositPage: NextPage = () => {
342328
labels={DepositPaymentMethodLabels}
343329
selected={paymentMethod}
344330
onChange={setPaymentMethod}
345-
disabled={disabledPaymentMethods}
346-
disabledItemClassName="!bg-misty-harbor text-sky-600"
347331
className=""
348332
itemClassName="text-center center outline-none rounded-lg bg-white p-3 leading-10"
349333
selectedItemClassName="!bg-ice-hush"
350334
/>
351335
)}
336+
{method === "buy" &&
337+
currency === "ztg" &&
338+
paymentMethod === "card" &&
339+
encodedAddress && (
340+
<div className={"grid gap-3 " + `grid-cols-1`}>
341+
<ResultButtons
342+
items={[
343+
{
344+
label: "Banxa",
345+
url: `https://checkout.banxa.com/?coinType=ZTG&blockchain=ZTG&orderMode=BUY&walletAddress=${encodedAddress}`,
346+
},
347+
]}
348+
/>
349+
<div className="mt-7 flex flex-col gap-2 md:flex-row">
350+
<div className="item-center flex gap-2">
351+
<Image
352+
src="/currencies/ztg.svg"
353+
width={25}
354+
height={25}
355+
alt="Zeitgeist currency"
356+
/>
357+
<div>Zeitgeist Address:</div>
358+
</div>
359+
<div className="flex font-semibold">
360+
<span className="hidden sm:inline">{encodedAddress}</span>
361+
<span className="inline sm:hidden">
362+
{shortenAddress(encodedAddress, 12, 12)}
363+
</span>
364+
<CopyIcon
365+
size={24}
366+
className="ml-3 cursor-pointer"
367+
copyText={encodedAddress}
368+
/>
369+
</div>
370+
</div>
371+
<div className="mt-2">
372+
After purchasing ZTG return to this page and select the Deposit
373+
tab to move it to your account on Zeitgeist
374+
</div>
375+
</div>
376+
)}
352377
{method === "buy" &&
353378
currency === "ztg" &&
354379
paymentMethod === "crypto" && (
355380
<ResultButtons
356381
items={[
357382
{
358383
label: "Hydra DX",
359-
url: "https://app.hydradx.io/trade?assetIn=5&assetOut=12",
384+
url: "https://app.hydration.net/trade/swap?assetIn=5&assetOut=12",
360385
},
361386
{ label: "Gate.io", url: "https://www.gate.io/trade/ZTG_USDT" },
362387
]}
@@ -369,7 +394,7 @@ const DepositPage: NextPage = () => {
369394
items={[
370395
{
371396
label: "DEX",
372-
url: "https://app.hydradx.io/trade?assetIn=10&assetOut=5",
397+
url: "https://app.hydration.net/trade/swap?assetIn=10&assetOut=5",
373398
},
374399
{
375400
label: "CEX",

0 commit comments

Comments
 (0)