Skip to content

Commit

Permalink
Merge pull request #462 from arconnectio/staging
Browse files Browse the repository at this point in the history
ArConnect 1.18.1
  • Loading branch information
nicholaswma authored Aug 9, 2024
2 parents 700d4dc + f3d299d commit ceffbb7
Showing 1 changed file with 38 additions and 17 deletions.
55 changes: 38 additions & 17 deletions src/routes/popup/purchase.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import {
ListItem,
ButtonV2,
Loading,
useToasts
useToasts,
ListItemIcon
} from "@arconnect/components";
import browser from "webextension-polyfill";
import { ChevronRight } from "@untitled-ui/icons-react";
import { ChevronRight, Bank, BankNote01 } from "@untitled-ui/icons-react";
import switchIcon from "url:/assets/ecosystem/switch-vertical.svg";
import styled from "styled-components";
import HeadV2 from "~components/popup/HeadV2";
Expand Down Expand Up @@ -227,8 +228,14 @@ export default function Purchase() {
<InputButton
label={browser.i18n.getMessage("buy_screen_payment_method")}
onClick={() => setShowPaymentSelector(true)}
disabled={false}
body={paymentMethod?.name || ""}
disabled={!paymentMethod}
body={
paymentMethod?.id === "pm_us_wire_bank_transfer"
? "Wire Transfer"
: paymentMethod?.id === "pm_cash_app"
? "Cash App"
: paymentMethod?.name || ""
}
icon={
<div
style={{
Expand Down Expand Up @@ -324,19 +331,33 @@ const PaymentSelectorScreen = ({
padding={"0 0 15px 0;"}
/>
{payments.map((payment, index) => {
return (
<ListItem
key={index}
small
title={payment.name}
description={`processing time ${payment.processingTime}`}
img={payment.icon}
onClick={() => {
updatePayment(payment);
onClose();
}}
/>
);
if (payment.isActive) {
const isWireTransfer = payment.id === "pm_us_wire_bank_transfer";
const isCashApp = payment.id === "pm_cash_app";
return (
<ListItem
key={index}
small
title={
isWireTransfer
? "Wire Transfer"
: isCashApp
? "Cash App"
: payment.name
}
description={`processing time ${payment.processingTime}`}
img={!isWireTransfer && !isCashApp && payment.icon}
onClick={() => {
updatePayment(payment);
onClose();
}}
>
{isWireTransfer && <ListItemIcon as={Bank} />}
{isCashApp && <ListItemIcon as={BankNote01} />}
</ListItem>
);
}
return null;
})}
</SelectorWrapper>
);
Expand Down

0 comments on commit ceffbb7

Please sign in to comment.