Co-authored-by: wolfoftyreso-debug <250630591+wolfoftyreso-debug@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-07-11 10:42:52 +00:00
parent 2e922e4023
commit 399b720781
+23 -2
View File
@@ -28,6 +28,7 @@ type PaymentMethod = "card" | "invoice";
const PlansSection = () => { const PlansSection = () => {
const [employees, setEmployees] = useState(10); const [employees, setEmployees] = useState(10);
const [loadingMethod, setLoadingMethod] = useState<PaymentMethod | null>(null); const [loadingMethod, setLoadingMethod] = useState<PaymentMethod | null>(null);
const [showPaymentOptions, setShowPaymentOptions] = useState(false);
const { products, isLoading: productsLoading } = useShopifyProducts( const { products, isLoading: productsLoading } = useShopifyProducts(
"product_type:Abonnemang" "product_type:Abonnemang"
@@ -163,8 +164,20 @@ const PlansSection = () => {
<div className="text-muted-foreground text-xs mt-1">exklusive moms</div> <div className="text-muted-foreground text-xs mt-1">exklusive moms</div>
</div> </div>
{/* Two CTAs — pick payment method, then straight to Shopify checkout */} {!showPaymentOptions ? (
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3 pt-2"> <button
onClick={() => setShowPaymentOptions(true)}
disabled={isBusy}
className="btn-classic w-full py-4 text-base md:text-lg rounded-sm disabled:opacity-50 mt-2"
>
Starta abonnemang
</button>
) : (
<div className="animate-fade-in space-y-3 pt-2">
<p className="text-muted-foreground text-sm">
Välj betalningsmetod
</p>
<div className="grid grid-cols-1 sm:grid-cols-2 gap-3">
<button <button
onClick={() => handleStart("card")} onClick={() => handleStart("card")}
disabled={isBusy} disabled={isBusy}
@@ -194,10 +207,18 @@ const PlansSection = () => {
)} )}
</button> </button>
</div> </div>
<button
onClick={() => setShowPaymentOptions(false)}
className="text-muted-foreground text-xs underline hover:text-foreground"
>
Tillbaka
</button>
<p className="text-muted-foreground text-xs"> <p className="text-muted-foreground text-xs">
Du slutför beställningen säkert hos Shopify. Du slutför beställningen säkert hos Shopify.
</p> </p>
</div> </div>
)}
</div>
</div> </div>
</div> </div>
</section> </section>