refactor(leads): combine QR and Search buttons into a single toggle
- Simplified Tab 2 interface by replacing segmented control with a single toggle button. - Updated button labels and icons to indicate the available switch action.
This commit is contained in:
@@ -30,25 +30,20 @@
|
||||
</script>
|
||||
|
||||
<div class="ae-tab-add flex flex-col items-center space-y-6 w-full mx-auto">
|
||||
<!-- Mode Toggle - Stable Width -->
|
||||
<div class="flex p-1 bg-surface-200-800 rounded-xl w-full max-w-md shadow-inner">
|
||||
<!-- Mode Toggle - Combined Button -->
|
||||
<div class="flex justify-center w-full">
|
||||
<button
|
||||
type="button"
|
||||
class="flex-1 btn btn-sm py-3 flex items-center justify-center gap-2 rounded-lg transition-all duration-200"
|
||||
class:preset-filled-primary={mode === 'qr'}
|
||||
onclick={() => set_mode('qr')}
|
||||
class="btn btn-sm variant-filled-secondary font-bold shadow-md px-6 py-3 flex items-center gap-2 transition-all duration-200"
|
||||
onclick={() => set_mode(mode === 'qr' ? 'search' : 'qr')}
|
||||
>
|
||||
<QrCode size="1.2em" />
|
||||
<span class="font-bold">Scan QR</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="flex-1 btn btn-sm py-3 flex items-center justify-center gap-2 rounded-lg transition-all duration-200"
|
||||
class:preset-filled-primary={mode === 'search'}
|
||||
onclick={() => set_mode('search')}
|
||||
>
|
||||
<Search size="1.2em" />
|
||||
<span class="font-bold">Search</span>
|
||||
{#if mode === 'qr'}
|
||||
<Search size="1.2em" />
|
||||
<span>Switch to Manual Search</span>
|
||||
{:else}
|
||||
<QrCode size="1.2em" />
|
||||
<span>Switch to QR Scan</span>
|
||||
{/if}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user