Skip to content

Commit c04fcbf

Browse files
authored
Merge pull request #12 from base-org/cleanup
Cleanup and quality of life improvements
2 parents f895713 + 85c4d4d commit c04fcbf

File tree

8 files changed

+7
-557
lines changed

8 files changed

+7
-557
lines changed

app/component/footer.tsx

-84
This file was deleted.

app/helpers/getTransactionReceipt.ts

-30
This file was deleted.

app/page.tsx

+7-2
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export default function Home({ searchParams }: { searchParams: any }) {
1212
const { provider, account, connectWallet, switchWallet } = useWallet();
1313
const [address, setAddress] = useState(searchParams.address || account || '');
1414
const [amount, setAmount] = useState('');
15+
const [isRedirecting, setIsRedirecting] = useState(false);
1516

1617
const { resolvedAddress } = useEnsResolver(address, provider);
1718

@@ -35,6 +36,7 @@ export default function Home({ searchParams }: { searchParams: any }) {
3536

3637
const goToCheckout = () => {
3738
if (checkoutUrl) {
39+
setIsRedirecting(true);
3840
window.location.href = checkoutUrl;
3941
}
4042
}
@@ -106,17 +108,20 @@ export default function Home({ searchParams }: { searchParams: any }) {
106108
<span className="label-text">Amount</span>
107109
</div>
108110
<input
109-
type="text"
111+
type="number"
110112
placeholder=""
111113
className="input input-bordered input-lg w-full max-w-xs"
112114
onChange={handleAmountChange}
113115
/>
114116
</label>
115117
<button
116118
onClick={goToCheckout}
117-
disabled={!isAddress(resolvedAddress) || !amount}
119+
disabled={!isAddress(resolvedAddress) || !amount || isRedirecting}
118120
className="btn btn-primary btn-lg mt-4"
119121
>
122+
{isRedirecting && (
123+
<div className="loading loading-spinner" />
124+
)}
120125
Check out
121126
</button>
122127
</div>

app/payment/page.tsx

-5
This file was deleted.

app/payment/payment.tsx

-215
This file was deleted.

app/payment/paymentWrapper.tsx

-11
This file was deleted.

0 commit comments

Comments
 (0)