diff --git a/src/GiftForm.css b/src/GiftForm.css index 92371e8..962a7a8 100644 --- a/src/GiftForm.css +++ b/src/GiftForm.css @@ -3,7 +3,8 @@ flex-direction: column; align-items: center; justify-content: center; - margin: 2rem 2rem; + margin: 0rem 2rem; + width: 100%; max-width: 40rem; } diff --git a/src/GiftForm.tsx b/src/GiftForm.tsx index 9451cdd..d17376a 100644 --- a/src/GiftForm.tsx +++ b/src/GiftForm.tsx @@ -39,6 +39,15 @@ export function GiftForm({ errorCallback }: GiftFormProps) { const debouncedUsdAmount = useDebounce(usdAmount, 500); const handleUSDChange = (e: React.ChangeEvent) => { + const amount = Number(e.target.value); + if (amount > 10000) { + setUsdAmount(10000); + return; + } + if (amount < 0) { + setUsdAmount(0); + return; + } setUsdAmount(Number(Number(e.target.value).toFixed(2))); }; @@ -113,13 +122,15 @@ export function GiftForm({ errorCallback }: GiftFormProps) {
- $ + {"$".toLocaleUpperCase()}
@@ -128,7 +139,7 @@ export function GiftForm({ errorCallback }: GiftFormProps) {
{wincForOneGiB && (
- $ + {"$".toLocaleUpperCase()} {usdWhenCreditsWereLastUpdatedRef.current} {" "}