Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/Http/Controllers/SupportTicketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
use App\Models\User;
use App\Notifications\SupportTicketCreatedNotification;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Notification;
use Inertia\Inertia;

class SupportTicketController extends Controller
Expand Down Expand Up @@ -80,7 +79,7 @@ public function store(Request $request)
->get();

if ($staff->isNotEmpty()) {
Notification::send($staff, new SupportTicketCreatedNotification($ticket, $user));
SupportTicketCreatedNotification::sendTo($staff, $ticket, $user);
}

return redirect()->route('support.my-tickets')->with('success', "Ticket {$ticket->ticket_number} created successfully! Our team will review and reply.");
Expand Down
38 changes: 37 additions & 1 deletion app/Notifications/SupportTicketCreatedNotification.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Notifications\Notification;
use Illuminate\Support\Collection;

class SupportTicketCreatedNotification extends Notification implements ShouldQueue
{
Expand All @@ -15,8 +16,42 @@ class SupportTicketCreatedNotification extends Notification implements ShouldQue
public function __construct(
public SupportTicket $ticket,
public User $user,
public int $count = 1,
) {}

/**
* Send or roll up a support ticket notification to staff users.
*
* @param Collection<int, User> $staffMembers
*/
public static function sendTo(Collection $staffMembers, SupportTicket $ticket, User $user): void
{
foreach ($staffMembers as $staff) {
$unread = $staff->unreadNotifications()
->where('type', self::class)
->first();

if ($unread) {
$data = $unread->data;
$count = ($data['count'] ?? 1) + 1;

$data['count'] = $count;
$data['title'] = "{$count} New Support Tickets";
$data['message'] = "Latest from {$user->name}: {$ticket->subject}";
$data['ticket_id'] = $ticket->id;
$data['ticket_number'] = $ticket->ticket_number;
$data['url'] = url('/admin/tickets');

$unread->update([
'data' => $data,
'created_at' => now(),
]);
} else {
$staff->notify(new self($ticket, $user, 1));
}
}
}

/**
* Get the notification's delivery channels.
*
Expand All @@ -40,7 +75,8 @@ public function toArray(object $notifiable): array
'ticket_number' => $this->ticket->ticket_number,
'title' => "New Support Ticket #{$this->ticket->ticket_number}",
'message' => "{$this->user->name}: {$this->ticket->subject}",
'url' => route('admin.tickets.index', ['search' => $this->ticket->ticket_number]),
'url' => url('/admin/tickets'),
'count' => $this->count,
];
}
}
154 changes: 42 additions & 112 deletions resources/js/components/navigation/Navigation.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* imported — only the navigation chrome itself is unified here.
*/
import { Link, router, usePage } from '@inertiajs/vue3';
import { Facebook, Instagram } from 'lucide-vue-next';
import {
Teleport,
Transition,
Expand Down Expand Up @@ -1045,20 +1046,9 @@ export const SiteDrawer = defineComponent({
),
);
const drawerNavItems = computed(() => {
const items = allNavItems.filter((item) => !item.showInBottom);

// Ensure Platform Guide is first in the phone drawer
return items.sort((a, b) => {
if (a.href === '/guide') {
return -1;
}

if (b.href === '/guide') {
return 1;
}

return 0;
});
return allNavItems.filter(
(item) => !item.showInBottom && item.href !== '/guide',
);
});

const showLogoutModal = ref(false);
Expand Down Expand Up @@ -1520,77 +1510,6 @@ export const SiteDrawer = defineComponent({
);
},
)}
{canAccessAdmin.value && (
<Link
href="/admin"
onClick={close}
class={[
'group flex items-center gap-2.5 rounded-[10px] px-2.5 py-2 text-[13px] font-medium tracking-tight transition-all duration-150 ease-out',
isActiveAdminRoute(
'/admin',
currentUrl.value,
)
? 'bg-indigo-50 text-indigo-700 ring-1 ring-indigo-200/60 dark:bg-indigo-500/10 dark:text-indigo-200 dark:ring-indigo-500/20'
: 'text-slate-600 hover:bg-slate-100/80 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800/70 dark:hover:text-slate-100',
]}
>
<MaterialIcon
name="dashboard"
size={22}
class={`shrink-0 transition-colors duration-150 ${
isActiveAdminRoute(
'/admin',
currentUrl.value,
)
? 'text-indigo-600 dark:text-indigo-300'
: 'text-slate-500 group-hover:text-slate-700 dark:text-slate-500 dark:group-hover:text-slate-300'
}`}
/>
<span class="truncate">
Dashboard
</span>
{isActiveAdminRoute(
'/admin',
currentUrl.value,
) && (
<span class="ml-auto h-1.5 w-1.5 shrink-0 rounded-full bg-indigo-600 dark:bg-indigo-400" />
)}
</Link>
)}
{user.value && (
<Link
href="/my-submissions"
onClick={close}
class={[
'group flex items-center gap-2.5 rounded-[10px] px-2.5 py-2 text-[13px] font-medium tracking-tight transition-all duration-150 ease-out',
isActive(
'/my-submissions',
)
? 'bg-indigo-50 text-indigo-700 ring-1 ring-indigo-200/60 dark:bg-indigo-500/10 dark:text-indigo-200 dark:ring-indigo-500/20'
: 'text-slate-600 hover:bg-slate-100/80 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800/70 dark:hover:text-slate-100',
]}
>
<MaterialIcon
name="upload_file"
size={22}
class={`shrink-0 transition-colors duration-150 ${
isActive(
'/my-submissions',
)
? 'text-indigo-600 dark:text-indigo-300'
: 'text-slate-500 group-hover:text-slate-700 dark:text-slate-500 dark:group-hover:text-slate-300'
}`}
/>
<span class="truncate">
My Submissions
</span>
{isActive(
'/my-submissions',
) && (
<span class="ml-auto h-1.5 w-1.5 shrink-0 rounded-full bg-indigo-600 dark:bg-indigo-400" />
)}
</Link>
)}
</nav>

{/* Platform & Community Links */}
Expand Down Expand Up @@ -1627,32 +1546,6 @@ export const SiteDrawer = defineComponent({
<span class="ml-auto h-1.5 w-1.5 shrink-0 rounded-full bg-indigo-600 dark:bg-indigo-400" />
)}
</Link>
<Link
href="/join"
onClick={close}
class={[
'group flex items-center gap-2.5 rounded-[10px] px-2.5 py-2 text-[13px] font-medium tracking-tight transition-all duration-150 ease-out',
isActive('/join')
? 'bg-indigo-50 text-indigo-700 ring-1 ring-indigo-200/60 dark:bg-indigo-500/10 dark:text-indigo-200 dark:ring-indigo-500/20'
: 'text-slate-600 hover:bg-slate-100/80 hover:text-slate-900 dark:text-slate-400 dark:hover:bg-slate-800/70 dark:hover:text-slate-100',
]}
>
<MaterialIcon
name="person_add"
size={22}
class={`shrink-0 transition-colors duration-150 ${
isActive('/join')
? 'text-indigo-600 dark:text-indigo-300'
: 'text-slate-500 group-hover:text-slate-700 dark:text-slate-500 dark:group-hover:text-slate-300'
}`}
/>
<span class="truncate">
Join Our Team
</span>
{isActive('/join') && (
<span class="ml-auto h-1.5 w-1.5 shrink-0 rounded-full bg-indigo-600 dark:bg-indigo-400" />
)}
</Link>
<Link
href="/products"
onClick={close}
Expand Down Expand Up @@ -1684,6 +1577,35 @@ export const SiteDrawer = defineComponent({
</nav>
</div>

{/* Social Community Card */}
<div class="mt-4 px-2.5">
<div class="rounded-xl border border-slate-200/70 bg-gradient-to-br from-slate-50 to-indigo-50/30 p-3 dark:border-slate-800 dark:from-slate-800/40 dark:to-indigo-950/20">
<p class="text-[10px] font-bold tracking-[0.1em] text-slate-400 uppercase dark:text-slate-500">
Connect With Us
</p>
<div class="mt-2.5 grid grid-cols-2 gap-2">
<a
href="https://facebook.com/hscstackbd"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-2 rounded-lg border border-slate-200/80 bg-white px-2.5 py-1.5 text-xs font-semibold text-slate-700 shadow-2xs transition hover:border-blue-200 hover:bg-blue-50/50 hover:text-blue-600 dark:border-slate-700/80 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-blue-500/40 dark:hover:bg-blue-950/30 dark:hover:text-blue-400"
>
<Facebook class="h-3.5 w-3.5 text-blue-600 dark:text-blue-400" />
<span>Facebook</span>
</a>
<a
href="https://instagram.com/hscstack"
target="_blank"
rel="noopener noreferrer"
class="flex items-center gap-2 rounded-lg border border-slate-200/80 bg-white px-2.5 py-1.5 text-xs font-semibold text-slate-700 shadow-2xs transition hover:border-rose-200 hover:bg-rose-50/50 hover:text-rose-600 dark:border-slate-700/80 dark:bg-slate-800 dark:text-slate-200 dark:hover:border-rose-500/40 dark:hover:bg-rose-950/30 dark:hover:text-rose-400"
>
<Instagram class="h-3.5 w-3.5 text-rose-500 dark:text-rose-400" />
<span>Instagram</span>
</a>
</div>
</div>
</div>

{/* Legal & Info Links */}
<div class="mt-3 border-t border-slate-100 px-4 pt-3 dark:border-slate-800/60">
<div class="flex flex-wrap items-center gap-x-3 gap-y-1 text-[11px] font-medium text-slate-400 dark:text-slate-500">
Expand All @@ -1708,7 +1630,15 @@ export const SiteDrawer = defineComponent({
onClick={close}
class="transition hover:text-slate-700 dark:hover:text-slate-300"
>
Content Policy
Policy
</Link>
<span>•</span>
<Link
href="/guide"
onClick={close}
class="transition hover:text-slate-700 dark:hover:text-slate-300"
>
Guide
</Link>
</div>
</div>
Expand Down
7 changes: 7 additions & 0 deletions resources/js/pages/Chat/Index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1661,6 +1661,13 @@ onUnmounted(() => {
@scroll="handleScroll"
class="relative flex-1 space-y-1 overflow-y-auto px-3 py-4 sm:px-5"
>
<!-- More messages indicator -->
<div
class="py-2 text-center text-xs text-slate-400 dark:text-zinc-500"
>
... and more
</div>

<!-- Empty State -->
<div
v-if="messages.length === 0"
Expand Down
Loading
Loading