Sync mobile profile wallet card and 24h session idle timeout.
Deploy Ladill Link / deploy (push) Successful in 36s
Deploy Ladill Link / deploy (push) Successful in 36s
Show wallet balance prominently in the mobile profile bottom sheet with refresh on open; align session lifetime with the platform default. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+2
-1
@@ -25,7 +25,8 @@ PLATFORM_DB_USERNAME=ladill_link
|
|||||||
PLATFORM_DB_PASSWORD=
|
PLATFORM_DB_PASSWORD=
|
||||||
|
|
||||||
SESSION_DRIVER=database
|
SESSION_DRIVER=database
|
||||||
SESSION_LIFETIME=120
|
# Idle web session length in minutes (1440 = 24 hours of inactivity).
|
||||||
|
SESSION_LIFETIME=1440
|
||||||
SESSION_DOMAIN=.ladill.com
|
SESSION_DOMAIN=.ladill.com
|
||||||
|
|
||||||
LADILL_SSO_CLIENT_ID=
|
LADILL_SSO_CLIENT_ID=
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'lifetime' => (int) env('SESSION_LIFETIME', 120),
|
'lifetime' => (int) env('SESSION_LIFETIME', 1440),
|
||||||
|
|
||||||
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
|
'expire_on_close' => env('SESSION_EXPIRE_ON_CLOSE', false),
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,9 @@
|
|||||||
@php
|
@php
|
||||||
$gridCols = !empty($centerCompose) ? 'grid-cols-5' : 'grid-cols-4';
|
$showSearch = isset($searchUrl) && $searchUrl !== null && $searchUrl !== '#';
|
||||||
|
$gridCols = match (true) {
|
||||||
|
! empty($centerCompose) => $showSearch ? 'grid-cols-5' : 'grid-cols-4',
|
||||||
|
default => $showSearch ? 'grid-cols-4' : 'grid-cols-3',
|
||||||
|
};
|
||||||
$avatarUrl = $avatarUrl ?? null;
|
$avatarUrl = $avatarUrl ?? null;
|
||||||
$initials = $initials ?? 'U';
|
$initials = $initials ?? 'U';
|
||||||
$notificationsUrl = $notificationsUrl ?? '#';
|
$notificationsUrl = $notificationsUrl ?? '#';
|
||||||
@@ -11,6 +15,13 @@
|
|||||||
if ($profileMenuItems === [] && $profileUrl !== '#') {
|
if ($profileMenuItems === [] && $profileUrl !== '#') {
|
||||||
$profileMenuItems = [['type' => 'link', 'label' => 'Profile', 'href' => $profileUrl]];
|
$profileMenuItems = [['type' => 'link', 'label' => 'Profile', 'href' => $profileUrl]];
|
||||||
}
|
}
|
||||||
|
$walletBalanceRoute = (string) config('billing.wallet_balance_route', 'wallet.balance');
|
||||||
|
$showWalletInSheet = \Illuminate\Support\Facades\Route::has($walletBalanceRoute)
|
||||||
|
|| collect($profileMenuItems)->contains(fn (array $item): bool => ($item['type'] ?? '') === 'wallet');
|
||||||
|
$sheetMenuItems = array_values(array_filter(
|
||||||
|
$profileMenuItems,
|
||||||
|
fn (array $item): bool => ($item['type'] ?? 'link') !== 'wallet'
|
||||||
|
));
|
||||||
$navActive = fn (bool $active) => $active ? 'text-indigo-600' : 'text-slate-600';
|
$navActive = fn (bool $active) => $active ? 'text-indigo-600' : 'text-slate-600';
|
||||||
@endphp
|
@endphp
|
||||||
<div x-data="{ profileOpen: false }" class="lg:hidden">
|
<div x-data="{ profileOpen: false }" class="lg:hidden">
|
||||||
@@ -23,11 +34,13 @@
|
|||||||
<span class="text-[10px] font-medium">Home</span>
|
<span class="text-[10px] font-medium">Home</span>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="{{ $searchUrl }}"
|
@if ($showSearch)
|
||||||
class="flex flex-col items-center justify-center gap-1 px-2 py-2 transition hover:text-slate-900 {{ $navActive($searchActive ?? false) }}">
|
<a href="{{ $searchUrl }}"
|
||||||
<svg class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"/></svg>
|
class="flex flex-col items-center justify-center gap-1 px-2 py-2 transition hover:text-slate-900 {{ $navActive($searchActive ?? false) }}">
|
||||||
<span class="text-[10px] font-medium">Search</span>
|
<svg class="h-6 w-6" fill="none" stroke="currentColor" stroke-width="1.5" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"/></svg>
|
||||||
</a>
|
<span class="text-[10px] font-medium">Search</span>
|
||||||
|
</a>
|
||||||
|
@endif
|
||||||
|
|
||||||
@if (!empty($centerCompose))
|
@if (!empty($centerCompose))
|
||||||
<div class="flex items-center justify-center">
|
<div class="flex items-center justify-center">
|
||||||
@@ -113,8 +126,19 @@
|
|||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
@if ($showWalletInSheet)
|
||||||
|
<div class="border-b border-slate-100 px-4 py-4"
|
||||||
|
x-effect="profileOpen && window.dispatchEvent(new CustomEvent('wallet-balance-refresh'))">
|
||||||
|
<p class="mb-2 text-sm font-medium text-slate-700">Billing</p>
|
||||||
|
@include('partials.wallet-widget', [
|
||||||
|
'onNavigate' => 'profileOpen = false',
|
||||||
|
'class' => 'mx-0',
|
||||||
|
])
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
@include('partials.user-profile-menu', [
|
@include('partials.user-profile-menu', [
|
||||||
'items' => $profileMenuItems,
|
'items' => $sheetMenuItems,
|
||||||
'variant' => 'sheet',
|
'variant' => 'sheet',
|
||||||
'onNavigate' => 'profileOpen = false',
|
'onNavigate' => 'profileOpen = false',
|
||||||
])
|
])
|
||||||
|
|||||||
@@ -1,12 +1,19 @@
|
|||||||
{{-- Wallet balance peek (links to the account wallet on account.ladill.com). --}}
|
{{-- Wallet balance peek (links to the account wallet on account.ladill.com). --}}
|
||||||
@php
|
@php
|
||||||
|
$onNavigate = $onNavigate ?? null;
|
||||||
|
$class = trim((string) ($class ?? 'mx-1'));
|
||||||
$balanceRoute = (string) config('billing.wallet_balance_route', 'wallet.balance');
|
$balanceRoute = (string) config('billing.wallet_balance_route', 'wallet.balance');
|
||||||
$balanceUrl = \Illuminate\Support\Facades\Route::has($balanceRoute) ? route($balanceRoute) : null;
|
$balanceUrl = \Illuminate\Support\Facades\Route::has($balanceRoute) ? route($balanceRoute) : null;
|
||||||
|
$walletUrl = \Illuminate\Support\Facades\Route::has('user.wallet.index')
|
||||||
|
? route('user.wallet.index')
|
||||||
|
: (function_exists('ladill_account_url') ? ladill_account_url('/wallet') : '#');
|
||||||
@endphp
|
@endphp
|
||||||
@if ($balanceUrl)
|
@if ($balanceUrl)
|
||||||
<a href="{{ ladill_account_url('/wallet') }}"
|
<a href="{{ $walletUrl }}"
|
||||||
x-data="walletWidget({ url: {{ \Illuminate\Support\Js::from($balanceUrl) }} })" x-init="load()"
|
x-data="walletWidget({ url: {{ \Illuminate\Support\Js::from($balanceUrl) }} })" x-init="load()"
|
||||||
class="mx-1 flex items-center justify-between gap-3 rounded-xl border border-slate-100 bg-gradient-to-r from-indigo-50 to-slate-50 px-3 py-2.5 transition hover:border-indigo-200 hover:from-indigo-100/70">
|
@wallet-balance-refresh.window="load()"
|
||||||
|
@if ($onNavigate) @click="{{ $onNavigate }}" @endif
|
||||||
|
class="{{ $class }} flex items-center justify-between gap-3 rounded-xl border border-slate-100 bg-gradient-to-r from-indigo-50 to-slate-50 px-3 py-2.5 transition hover:border-indigo-200 hover:from-indigo-100/70">
|
||||||
<span class="flex items-center gap-2.5 min-w-0">
|
<span class="flex items-center gap-2.5 min-w-0">
|
||||||
<span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-indigo-100 text-indigo-600">
|
<span class="flex h-8 w-8 shrink-0 items-center justify-center rounded-lg bg-indigo-100 text-indigo-600">
|
||||||
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="1.6" viewBox="0 0 24 24">
|
<svg class="h-4 w-4" fill="none" stroke="currentColor" stroke-width="1.6" viewBox="0 0 24 24">
|
||||||
|
|||||||
Reference in New Issue
Block a user