From b085fbe65621a2935bc664cfe3dfa5647e5eae78 Mon Sep 17 00:00:00 2001 From: alantoa Date: Wed, 1 Nov 2023 15:28:28 +0800 Subject: [PATCH] Disable eth payment on dev --- .../creator-token/buy-creator-token.tsx | 30 ++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/packages/app/components/creator-token/buy-creator-token.tsx b/packages/app/components/creator-token/buy-creator-token.tsx index 1f819eda0..9407980b6 100644 --- a/packages/app/components/creator-token/buy-creator-token.tsx +++ b/packages/app/components/creator-token/buy-creator-token.tsx @@ -45,16 +45,24 @@ type Query = { }; const { useParam } = createParam(); -const PAYMENT_METHODS = [ - { - title: "USDC", - value: "USDC", - }, - { - title: "ETH", - value: "ETH", - }, -]; +// Disable ETH payment on dev for now because it doesn't support the dev environment yet. +const PAYMENT_METHODS = __DEV__ + ? [ + { + title: "USDC", + value: "USDC", + }, + ] + : [ + { + title: "USDC", + value: "USDC", + }, + { + title: "ETH", + value: "ETH", + }, + ]; const SELECT_LIST = [ { title: "Buy", @@ -81,7 +89,7 @@ export const BuyCreatorToken = () => { ); const [paymentMethod, setPaymentMethod] = useState<"ETH" | "USDC">( - selectedAction === "buy" ? "ETH" : "USDC" + __DEV__ ? "USDC" : selectedAction === "buy" ? "ETH" : "USDC" ); const buyToken = useCreatorTokenBuy({ username, tokenAmount, paymentMethod });