diff --git a/src/components/BuyProgressBar/index.tsx b/src/components/BuyProgressBar/index.tsx new file mode 100644 index 000000000..8065b79a4 --- /dev/null +++ b/src/components/BuyProgressBar/index.tsx @@ -0,0 +1,203 @@ +import React, { useEffect, useState, useMemo } from 'react' +import { Box, HStack, Circle, Text } from 'native-base' + +export type BuyStep = 1 | 2 | 3 + +export interface StepConfig { + number: number + label: string +} + +interface BuyProgressBarProps { + currentStep: BuyStep + isLoading?: boolean + steps?: StepConfig[] +} + +const BuyProgressBar: React.FC = ({ + currentStep, + isLoading = false, + steps = [ + { number: 1, label: 'Buy cUSD' }, + { number: 2, label: 'We swap cUSD to G$' }, + { number: 3, label: 'Done' }, + ], +}) => { + const [animatedWidth, setAnimatedWidth] = useState(0) + + // Handle animated progress line + useEffect(() => { + if (isLoading && currentStep >= 1) { + // Explicitly reset animatedWidth to 0 at the start of a new loading phase + setAnimatedWidth(0) + // Animate progress line when loading + let progress = 0 + const interval = setInterval(() => { + progress += 2 + if (progress <= 100) { + setAnimatedWidth(progress) + } else { + clearInterval(interval) + } + }, 50) // 50ms intervals for smooth animation + + return () => clearInterval(interval) + } else { + // Set to 100% if not loading (completed state) + setAnimatedWidth(100) + } + }, [isLoading, currentStep]) + + const getStepStatus = (stepNumber: number) => { + // Step 1 should ALWAYS be blue (active when current, completed when past) + if (stepNumber === 1) { + if (currentStep === 1) { + return isLoading ? 'loading' : 'active' + } else { + return 'completed' // Step 1 is completed when we're on step 2 or 3 + } + } + // Steps 2 and 3 follow normal logic + if (stepNumber < currentStep) return 'completed' + if (stepNumber === currentStep) return isLoading ? 'loading' : 'active' + return 'pending' + } + + // Memoize circle props objects to avoid recreation on every render + const circlePropsMap = useMemo( + () => ({ + completed: { + size: '12', + mb: 2, + justifyContent: 'center', + alignItems: 'center', + bg: 'blue.500', + }, + active: { + size: '12', + mb: 2, + justifyContent: 'center', + alignItems: 'center', + bg: 'blue.500', + }, + loading: { + size: '12', + mb: 2, + justifyContent: 'center', + alignItems: 'center', + bg: 'blue.500', + borderWidth: 3, + borderColor: 'blue.200', + animation: 'pulse 2s infinite', + }, + pending: { + size: '12', + mb: 2, + justifyContent: 'center', + alignItems: 'center', + bg: 'gray.300', + }, + }), + [] + ) + + const getCircleProps = (status: string) => { + return circlePropsMap[status as keyof typeof circlePropsMap] || circlePropsMap.pending + } + + const getLineProps = (stepNumber: number, lineIndex: number) => { + // Line between step 1 and 2 (lineIndex = 0) + if (lineIndex === 0) { + if (currentStep === 1 && isLoading) { + // Animation state: "1 Blue with progress bar animation" + return { + bg: 'blue.500', + width: `${animatedWidth}%`, + transition: 'width 0.1s ease-out', + } + } else if (currentStep >= 2) { + // Static line when step 2 or higher + return { + bg: 'blue.500', + width: '100%', + } + } + } + + // Line between step 2 and 3 (lineIndex = 1) + if (lineIndex === 1) { + if (currentStep === 2 && isLoading) { + // Animation state: "2 Blue with progress bar animation" + return { + bg: 'blue.500', + width: `${animatedWidth}%`, + transition: 'width 0.1s ease-out', + } + } else if (currentStep >= 3) { + // Static line when step 3 + return { + bg: 'blue.500', + width: '100%', + } + } + } + + // Default: gray line (not active) + return { + bg: 'gray.300', + width: '100%', + } + } + + const getTextColor = (status: string) => { + return status === 'pending' ? 'gray.500' : 'black' + } + + return ( + + + {steps.map((step, index) => { + const status = getStepStatus(step.number) + + return ( + + + + + {step.number} + + + + {step.label} + + + + {index < steps.length - 1 && ( + + + + )} + + ) + })} + + + ) +} + +export { BuyProgressBar } diff --git a/src/language/locales/af/catalog.po b/src/language/locales/af/catalog.po index bacbe6e25..160393195 100644 --- a/src/language/locales/af/catalog.po +++ b/src/language/locales/af/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "Verander" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "Bevestig hierdie transaksie in jou beursie" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "Sukses!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/ar/catalog.po b/src/language/locales/ar/catalog.po index 9ca5e150d..b041b7c8d 100644 --- a/src/language/locales/ar/catalog.po +++ b/src/language/locales/ar/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "تغيير" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "قم بتأكيد هذه المعاملة في محفظتك" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "النجاح!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/ca/catalog.po b/src/language/locales/ca/catalog.po index bae7e2938..3a533f3c4 100644 --- a/src/language/locales/ca/catalog.po +++ b/src/language/locales/ca/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/cs/catalog.po b/src/language/locales/cs/catalog.po index 45734d8c5..69c5055e9 100644 --- a/src/language/locales/cs/catalog.po +++ b/src/language/locales/cs/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/da/catalog.po b/src/language/locales/da/catalog.po index 17a873694..bff78032a 100644 --- a/src/language/locales/da/catalog.po +++ b/src/language/locales/da/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/de/catalog.po b/src/language/locales/de/catalog.po index b4ae5dab9..ae2fe953e 100644 --- a/src/language/locales/de/catalog.po +++ b/src/language/locales/de/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "Ändern" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "Bestätigen Sie diese Transaktion in Ihrer Brieftasche" msgid "Congratulations!" msgstr "Herzliche Glückwünsche!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "Ab 1.0 steigt Ihr Multiplikator nach einem Monat nach einem Monat zum Ve msgid "Success!" msgstr "Erfolg!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/el/catalog.po b/src/language/locales/el/catalog.po index eedf4001c..7a7b9df22 100644 --- a/src/language/locales/el/catalog.po +++ b/src/language/locales/el/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/en/catalog.po b/src/language/locales/en/catalog.po index 7b3edf3a5..3f78b7d31 100644 --- a/src/language/locales/en/catalog.po +++ b/src/language/locales/en/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/es-419/catalog.po b/src/language/locales/es-419/catalog.po index 5a075fd2c..b86ab985e 100644 --- a/src/language/locales/es-419/catalog.po +++ b/src/language/locales/es-419/catalog.po @@ -146,7 +146,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -253,6 +253,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -690,7 +694,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/es/catalog.po b/src/language/locales/es/catalog.po index 3b8259495..96c6992fc 100644 --- a/src/language/locales/es/catalog.po +++ b/src/language/locales/es/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "Cambio" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "Confirme esta transacción en su billetera." msgid "Congratulations!" msgstr "¡Felicidades!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "A partir de 1.0, su multiplicador aumentará a 2.0 después de un mes de msgid "Success!" msgstr "¡Éxito!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/fi/catalog.po b/src/language/locales/fi/catalog.po index 46ce53b76..cc7d3b9e2 100644 --- a/src/language/locales/fi/catalog.po +++ b/src/language/locales/fi/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/fr/catalog.po b/src/language/locales/fr/catalog.po index 365548569..b2ae420ee 100644 --- a/src/language/locales/fr/catalog.po +++ b/src/language/locales/fr/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "Toutes nos félicitations!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/he/catalog.po b/src/language/locales/he/catalog.po index d7b7ebcd0..0fc80f438 100644 --- a/src/language/locales/he/catalog.po +++ b/src/language/locales/he/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "שינוי" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "אשר את העסקה הזו בארנק שלך" msgid "Congratulations!" msgstr "מזל טוב!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "החל מ 1.0, מכפיל שלך יגדל ל 2.0 לאחר חודש אח msgid "Success!" msgstr "הַצלָחָה!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/hi/catalog.po b/src/language/locales/hi/catalog.po index 1abf295d0..9a885c25c 100644 --- a/src/language/locales/hi/catalog.po +++ b/src/language/locales/hi/catalog.po @@ -1539,7 +1539,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -1650,6 +1650,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -2113,7 +2117,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/hu/catalog.po b/src/language/locales/hu/catalog.po index 066e89edc..5305e0bfd 100644 --- a/src/language/locales/hu/catalog.po +++ b/src/language/locales/hu/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/it/catalog.po b/src/language/locales/it/catalog.po index 193b5b1ac..ebee42506 100644 --- a/src/language/locales/it/catalog.po +++ b/src/language/locales/it/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "Modificare" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "Conferma questa transazione nel tuo portafoglio" msgid "Congratulations!" msgstr "Congratulazioni!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "A partire da 1,0, il tuo moltiplicatore aumenterà fino a 2.0 dopo un me msgid "Success!" msgstr "Successo!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/ja/catalog.po b/src/language/locales/ja/catalog.po index 9a7625bda..9947dc46f 100644 --- a/src/language/locales/ja/catalog.po +++ b/src/language/locales/ja/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "おめでとう!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/ko/catalog.po b/src/language/locales/ko/catalog.po index 7e084f512..c60ab0c77 100644 --- a/src/language/locales/ko/catalog.po +++ b/src/language/locales/ko/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "축하합니다!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/nl/catalog.po b/src/language/locales/nl/catalog.po index 4162828f4..82c320f4d 100644 --- a/src/language/locales/nl/catalog.po +++ b/src/language/locales/nl/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/no/catalog.po b/src/language/locales/no/catalog.po index b79e8dcd2..26daf28d5 100644 --- a/src/language/locales/no/catalog.po +++ b/src/language/locales/no/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/pl/catalog.po b/src/language/locales/pl/catalog.po index f25c134a0..111789d8a 100644 --- a/src/language/locales/pl/catalog.po +++ b/src/language/locales/pl/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/pt-BR/catalog.po b/src/language/locales/pt-BR/catalog.po index 22144497c..e03334a4c 100644 --- a/src/language/locales/pt-BR/catalog.po +++ b/src/language/locales/pt-BR/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/pt/catalog.po b/src/language/locales/pt/catalog.po index e3c58c457..81f339929 100644 --- a/src/language/locales/pt/catalog.po +++ b/src/language/locales/pt/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/ro/catalog.po b/src/language/locales/ro/catalog.po index 8fe81c607..63607dbd6 100644 --- a/src/language/locales/ro/catalog.po +++ b/src/language/locales/ro/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "Schimbare" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "Confirmați această tranzacție în portofel" msgid "Congratulations!" msgstr "Felicitări!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "Începând cu 1.0, multiplicatorul dvs. va crește la 2.0 după o lună msgid "Success!" msgstr "Succes!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/ru/catalog.po b/src/language/locales/ru/catalog.po index ed0424275..bd0c6bd5a 100644 --- a/src/language/locales/ru/catalog.po +++ b/src/language/locales/ru/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "Изменять" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "Подтвердите эту транзакцию в вашем кош msgid "Congratulations!" msgstr "Поздравляю!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "Начиная с 1.0, ваш множитель увеличится д msgid "Success!" msgstr "Успех!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/sr/catalog.po b/src/language/locales/sr/catalog.po index 5849e310a..eb10b7fe0 100644 --- a/src/language/locales/sr/catalog.po +++ b/src/language/locales/sr/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/sv/catalog.po b/src/language/locales/sv/catalog.po index 6496dcbdb..4248ab07d 100644 --- a/src/language/locales/sv/catalog.po +++ b/src/language/locales/sv/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/tr/catalog.po b/src/language/locales/tr/catalog.po index b870ae38b..861c2095e 100644 --- a/src/language/locales/tr/catalog.po +++ b/src/language/locales/tr/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/uk/catalog.po b/src/language/locales/uk/catalog.po index 3458cc577..2b3ad3a22 100644 --- a/src/language/locales/uk/catalog.po +++ b/src/language/locales/uk/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/vi/catalog.po b/src/language/locales/vi/catalog.po index 84ddd066d..01e8bcad4 100644 --- a/src/language/locales/vi/catalog.po +++ b/src/language/locales/vi/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "Thay đổi" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "Xác nhận giao dịch này trong ví của bạn" msgid "Congratulations!" msgstr "Xin chúc mừng!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "Bắt đầu từ 1.0, hệ số nhân của bạn sẽ tăng lên 2.0 s msgid "Success!" msgstr "Sự thành công!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/zh-CN/catalog.po b/src/language/locales/zh-CN/catalog.po index 7a929bfd3..8086c6951 100644 --- a/src/language/locales/zh-CN/catalog.po +++ b/src/language/locales/zh-CN/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "改变" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "在钱包中确认此事务" msgid "Congratulations!" msgstr "祝贺!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "从1.0开始,您的乘数将增加到2.0,在一个月的绑定到信 msgid "Success!" msgstr "成功!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/zh-TW/catalog.po b/src/language/locales/zh-TW/catalog.po index 83ef6729e..228e0966a 100644 --- a/src/language/locales/zh-TW/catalog.po +++ b/src/language/locales/zh-TW/catalog.po @@ -2784,7 +2784,7 @@ msgstr "" msgid "Change" msgstr "改變" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2895,6 +2895,10 @@ msgstr "在錢包中確認此事務" msgid "Congratulations!" msgstr "祝賀!" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -3358,7 +3362,7 @@ msgstr "從1.0開始,您的乘數將增加到2.0,在一個月的綁定到信 msgid "Success!" msgstr "成功!" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/language/locales/zh/catalog.po b/src/language/locales/zh/catalog.po index 16d8892ee..4600fa564 100644 --- a/src/language/locales/zh/catalog.po +++ b/src/language/locales/zh/catalog.po @@ -2255,7 +2255,7 @@ msgstr "" msgid "Change" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:84 +#: src/pages/gd/BuyGD/index.tsx:83 msgid "Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$." msgstr "" @@ -2366,6 +2366,10 @@ msgstr "" msgid "Congratulations!" msgstr "" +#: src/pages/gd/BuyGD/index.tsx:90 +msgid "Connect a wallet to buy G$" +msgstr "" + #: src/pages/gd/MicroBridge/index.tsx:36 #: src/pages/gd/Portfolio/index.tsx:459 msgid "Connect a wallet to see your portfolio" @@ -2829,7 +2833,7 @@ msgstr "" msgid "Success!" msgstr "" -#: src/pages/gd/BuyGD/index.tsx:71 +#: src/pages/gd/BuyGD/index.tsx:70 msgid "Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$)." msgstr "" diff --git a/src/pages/gd/BuyGD/BuyGD.css b/src/pages/gd/BuyGD/BuyGD.css new file mode 100644 index 000000000..dbf429fac --- /dev/null +++ b/src/pages/gd/BuyGD/BuyGD.css @@ -0,0 +1,44 @@ +/* Ensure our custom progress bar is always visible and properly styled */ +[data-testid="custom-progress-bar"] { + display: block !important; + visibility: visible !important; + z-index: 1000; +} + +/* Style the onramper widget container */ +.onramper-widget-container { + width: 100%; + display: flex; + justify-content: center; +} + +/* Hide the built-in Onramper progress bar/stepper */ +iframe[title="Onramper widget"] { + /* Target elements inside the Onramper iframe */ +} + +/* Alternative approach - hide progress elements by common selectors */ +.progress-bar, +.stepper, +.steps-container, +[class*="progress"], +[class*="stepper"], +[class*="step"] { + display: none !important; +} + +/* More specific targeting for Onramper built-in progress elements - using broader compatibility selectors */ +div[style*="justify-content: space-between"] div, +div[style*="flex-direction: row"] div, +div[style*="display: flex"] div { + /* Target potential progress elements - may need refinement based on actual Onramper structure */ +} + +/* Hide elements containing specific text using data attributes or classes if available */ +[data-step="1"], +[data-step="2"], +[data-step="3"], +.onramper-step, +.onramper-progress { + display: none !important; +} \ No newline at end of file diff --git a/src/pages/gd/BuyGD/index.tsx b/src/pages/gd/BuyGD/index.tsx index 4a644d658..302180983 100644 --- a/src/pages/gd/BuyGD/index.tsx +++ b/src/pages/gd/BuyGD/index.tsx @@ -1,12 +1,15 @@ -import React, { memo, useCallback } from 'react' +import { memo, useCallback } from 'react' import { i18n } from '@lingui/core' import { t } from '@lingui/macro' -import { Converter, GdOnramperWidget, SlideDownTab } from '@gooddollar/good-design' +import { useAppKitAccount } from '@reown/appkit/react' +import { Converter, SlideDownTab, GdOnramperWidget } from '@gooddollar/good-design' import { Box, Text, useBreakpointValue } from 'native-base' -import { useG$Price, useGetEnvChainId } from '@gooddollar/web3sdk-v2' +import { useG$Price } from '@gooddollar/web3sdk-v2' import useSendAnalyticsData from 'hooks/useSendAnalyticsData' import { PageLayout } from 'components/Layout/PageLayout' +import Placeholder from 'components/gd/Placeholder' +import './BuyGD.css' const CalculatorTab = () => { const G$Price = useG$Price(3) @@ -19,20 +22,23 @@ const CalculatorTab = () => { titleFont: { fontSize: 'l', fontFamily: 'heading', fontWeight: '700', paddingLeft: 2 }, }} > - + + + ) } const BuyGd = memo(() => { const sendData = useSendAnalyticsData() - - const { connectedEnv } = useGetEnvChainId(42220) - const isProd = connectedEnv.includes('production') + const { address } = useAppKitAccount() const handleEvents = useCallback( (event: string, data?: any, error?: string) => { - sendData({ event: 'buy', action: event, ...(error && { error: error }) }) + const eventData: any = { event: 'buy', action: event } + if (data) eventData.data = data + if (error) eventData.error = error + sendData(eventData) }, [sendData] ) @@ -47,52 +53,42 @@ const BuyGd = memo(() => { }, }) - const onrampWrapper = useBreakpointValue({ - base: { - width: '110%', - }, - lg: { - width: '100%', - }, - }) - return ( - ]}> - - {i18n._( - t`Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$).` - )} - - - {i18n._( - t` - Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$.` - )} - - {/* todo: width on mobile should be more responsive */} - - - + ]}> + {address ? ( + <> + + {i18n._( + t`Support global financial inclusion and contribute to social impact by purchasing GoodDollars (G$).` + )} + + + {i18n._( + t`Choose the currency you want to use and buy cUSD. Your cUSD is then automatically converted into G$.` + )} + + + + + ) : ( + {i18n._(t`Connect a wallet to buy G$`)} + )} ) })