Skip to content

Commit 66811da

Browse files
committed
tweak colors and styles
1 parent 8c83219 commit 66811da

File tree

2 files changed

+16
-15
lines changed

2 files changed

+16
-15
lines changed

components/DonateCheckout.tsx

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,16 @@ import ArrowLeftIcon from "../public/ui/arrow-left.svg?inline"
1515
import { Button } from "./Button"
1616

1717
interface DonateCheckoutProps {
18-
onComplete: () => void
19-
className?: string
2018
backUrl?: string
19+
className?: string
20+
onComplete: () => void
2121
}
2222

23-
export function DonateCheckout({ className, backUrl }: DonateCheckoutProps) {
23+
export function DonateCheckout({
24+
className,
25+
backUrl,
26+
onComplete,
27+
}: DonateCheckoutProps) {
2428
const checkout = useCheckout()
2529

2630
const [email, setEmail] = useState("")
@@ -58,19 +62,17 @@ export function DonateCheckout({ className, backUrl }: DonateCheckoutProps) {
5862
return
5963
}
6064

61-
const confirmResult = await checkout.confirm()
65+
const confirmResult = await checkout.confirm({
66+
redirect: "if_required", // Only redirect if required
67+
})
6268

63-
// This point will only be reached if there is an immediate error when
64-
// confirming the payment. Otherwise, your customer will be redirected to
65-
// your `return_url`. For some payment methods like iDEAL, your customer will
66-
// be redirected to an intermediate site first to authorize the payment, then
67-
// redirected to the `return_url`.
6869
if (confirmResult.type === "error") {
6970
setMessage(confirmResult.error.message)
7071
setIsLoading(false)
7172
}
73+
onComplete()
7274
},
73-
[checkout, email]
75+
[checkout, email, onComplete]
7476
)
7577

7678
return (
@@ -128,14 +130,14 @@ export function DonateCheckout({ className, backUrl }: DonateCheckoutProps) {
128130
onChange={handleChange}
129131
placeholder="[email protected]"
130132
className={classNames(
131-
"w-full p-4 bg-gray-2 rounded-md placeholder:text-gray-1"
133+
"w-full p-4 rounded-md transition-colors",
134+
"border-2 border-gray-2 hocus:border-gray-1 dark:border-gray-1",
135+
"disabled:border-gray-2 disabled:hocus:border-gray-2"
132136
)}
133137
onBlur={handleEmailBlur}
138+
disabled={isLoading}
134139
/>
135140
</label>
136-
{/* <hr className="my-4 border-t border-gray-3" />
137-
<h4 className="mb-2 mt-4">Billing Address</h4>
138-
<AddressElement options={{ mode: "billing" }} /> */}
139141
</div>
140142

141143
<div className="w-full">

pages/donate/checkout.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ export default function DonateCheckoutPage({
4242
theme: "flat",
4343
variables: {
4444
colorPrimary: "#333333",
45-
colorBackground: "#9b9b9b",
4645
colorText: "#000000",
4746
borderRadius: "0.5rem",
4847
logoColor: theme,

0 commit comments

Comments
 (0)