Wire QR overview create-code links into the two-step add-funds modal
Deploy Ladill QR Plus / deploy (push) Successful in 41s
Deploy Ladill QR Plus / deploy (push) Successful in 41s
The dashboard 'Create code' / 'Create your first code' links were plain hrefs to the create page, so a user with insufficient balance only met the top-up modal after filling the form. Gate them with balanceGate + mount the modal so they open Add funds directly when the wallet can't cover a QR code. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
b7adb69245
commit
296312ab4b
@@ -1,7 +1,13 @@
|
||||
<x-user-layout>
|
||||
<x-slot name="title">Overview</x-slot>
|
||||
@php $fmt = fn ($m) => 'GHS '.number_format($m / 100, 2); @endphp
|
||||
<div class="space-y-6">
|
||||
<div class="space-y-6"
|
||||
x-data="balanceGate({
|
||||
balance: @js((float) ($balanceMinor / 100)),
|
||||
price: @js((float) $pricePerQr),
|
||||
modalId: 'qr',
|
||||
href: @js(route('user.qr-codes.create')),
|
||||
})">
|
||||
<div>
|
||||
<h1 class="text-xl font-semibold text-slate-900">QR Plus</h1>
|
||||
<p class="mt-1 text-sm text-slate-500">Dynamic utility QR codes — links, WiFi, business pages & more.</p>
|
||||
@@ -23,10 +29,10 @@
|
||||
<div class="rounded-2xl border border-slate-200 bg-white">
|
||||
<div class="flex items-center justify-between border-b border-slate-100 px-6 py-4">
|
||||
<h2 class="font-semibold text-slate-900">Recent codes</h2>
|
||||
<a href="{{ route('user.qr-codes.create') }}" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">Create code</a>
|
||||
<a href="{{ route('user.qr-codes.create') }}" @click="goOrTopup($event)" class="text-sm font-medium text-indigo-600 hover:text-indigo-800">Create code</a>
|
||||
</div>
|
||||
@if($recentCodes->isEmpty())
|
||||
<p class="px-6 py-8 text-sm text-slate-500">No QR codes yet. <a href="{{ route('user.qr-codes.create') }}" class="font-medium text-indigo-600">Create your first code</a>.</p>
|
||||
<p class="px-6 py-8 text-sm text-slate-500">No QR codes yet. <a href="{{ route('user.qr-codes.create') }}" @click="goOrTopup($event)" class="font-medium text-indigo-600">Create your first code</a>.</p>
|
||||
@else
|
||||
<div class="divide-y divide-slate-100">
|
||||
@foreach($recentCodes as $code)
|
||||
@@ -41,5 +47,17 @@
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- Two-step add-funds modal (create links open this when balance is too low) --}}
|
||||
<x-user.service-topup-modal
|
||||
id="qr"
|
||||
title="Add funds"
|
||||
:topup-action="route('user.wallet.topup')"
|
||||
:price-per-action="(float) $pricePerQr"
|
||||
action-noun="QR code"
|
||||
:service-balance="(float) ($balanceMinor / 100)"
|
||||
service-balance-label="Wallet balance"
|
||||
:return-url="route('user.qr-codes.create')"
|
||||
:open-on-load="session('open_topup_modal') === 'qr'" />
|
||||
</div>
|
||||
</x-user-layout>
|
||||
|
||||
Reference in New Issue
Block a user