bugfix: improvemnets in UI, misc bugfixes

add tooltip to sidebar buttons
remove profile for admin
fix mobile menu not opening in home page
fix deal image input modal size in mobile view
make image scrollable in input modal
fix explore page filters are not clickable when recent search is maxed
out
change UI for the recent searches
add seeder for categories
improve deal card ui in broker dashboard
This commit is contained in:
kusowl 2026-01-29 14:02:39 +05:30
parent 450c8b4dce
commit 38d429e5d5
30 changed files with 251 additions and 139 deletions

View File

@ -11,7 +11,8 @@ class DealController extends Controller
public function index()
{
return view('dashboards.admin.deals.index')
->with('deals', $this->deals());
->with('pendingDeals', $this->pendingDeals())
->with('activeDeals', $this->activeDeals());
}
public function approve(Deal $deal)
@ -30,7 +31,8 @@ public function approve(Deal $deal)
}
}
public function reject(Deal $deal){
public function reject(Deal $deal)
{
try {
$deal->delete();
@ -42,8 +44,13 @@ public function reject(Deal $deal){
}
}
private function deals()
private function pendingDeals()
{
return Deal::where('active', false)->get();
}
private function activeDeals()
{
return Deal::where('active', true)->get();
}
}

View File

@ -10,12 +10,14 @@
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\User|null $user
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|Admin newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Admin newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Admin query()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Admin whereCreatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Admin whereId($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Admin whereUpdatedAt($value)
*
* @mixin \Eloquent
*/
class Admin extends Model

View File

@ -14,6 +14,7 @@
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\User|null $user
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|Broker newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Broker newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Broker query()
@ -24,6 +25,7 @@
* @method static \Illuminate\Database\Eloquent\Builder<static>|Broker wherePhone($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Broker whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Broker whereVerified($value)
*
* @mixin \Eloquent
*/
class Broker extends Model

View File

@ -13,6 +13,7 @@
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\User|null $user
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer query()
@ -22,6 +23,7 @@
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereLocation($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer wherePhone($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Customer whereUpdatedAt($value)
*
* @mixin \Eloquent
*/
class Customer extends Model

View File

@ -29,6 +29,7 @@
* @property-read int|null $interactions_count
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Report> $reports
* @property-read int|null $reports_count
*
* @method static Builder<static>|Deal WithActiveDeals()
* @method static Builder<static>|Deal WithCurrentUserInteractions()
* @method static Builder<static>|Deal WithLikePerDeal()
@ -50,6 +51,7 @@
* @method static Builder<static>|Deal whereUpdatedAt($value)
* @method static Builder<static>|Deal whereUserId($value)
* @method static Builder<static>|Deal withViewPerDeal()
*
* @mixin \Eloquent
*/
class Deal extends Model

View File

@ -16,6 +16,7 @@
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Deal> $deals
* @property-read int|null $deals_count
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|DealCategory newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|DealCategory newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|DealCategory query()
@ -27,10 +28,13 @@
* @method static \Illuminate\Database\Eloquent\Builder<static>|DealCategory whereOrder($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|DealCategory whereSlug($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|DealCategory whereUpdatedAt($value)
*
* @mixin \Eloquent
*/
class DealCategory extends Model
{
protected $fillable = ['name', 'description', 'slug', 'active', 'order'];
public function deals(): HasMany
{
return $this->hasMany(Deal::class);

View File

@ -16,6 +16,7 @@
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\Deal|null $deal
* @property-read \App\Models\Deal|null $user
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction query()
@ -26,6 +27,7 @@
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereType($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|Interaction whereUserId($value)
*
* @mixin \Eloquent
*/
class Interaction extends Model

View File

@ -12,6 +12,7 @@
* @property \Illuminate\Support\Carbon|null $created_at
* @property \Illuminate\Support\Carbon|null $updated_at
* @property-read \App\Models\User|null $user
*
* @method static \Illuminate\Database\Eloquent\Builder<static>|RecentSearch newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|RecentSearch newQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|RecentSearch query()
@ -20,6 +21,7 @@
* @method static \Illuminate\Database\Eloquent\Builder<static>|RecentSearch whereQuery($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|RecentSearch whereUpdatedAt($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|RecentSearch whereUserId($value)
*
* @mixin \Eloquent
*/
class RecentSearch extends Model

View File

@ -21,6 +21,7 @@
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Deal> $deals
* @property-read int|null $deals_count
* @property-read \App\Models\User|null $user
*
* @method static Builder<static>|Report newModelQuery()
* @method static Builder<static>|Report newQuery()
* @method static Builder<static>|Report orderByStatus(array $statusOrder)
@ -32,6 +33,7 @@
* @method static Builder<static>|Report whereType($value)
* @method static Builder<static>|Report whereUpdatedAt($value)
* @method static Builder<static>|Report whereUserId($value)
*
* @mixin \Eloquent
*/
class Report extends Model

View File

@ -39,6 +39,7 @@
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Report> $reports
* @property-read int|null $reports_count
* @property-read Model|\Eloquent|null $type
*
* @method static \Database\Factories\UserFactory factory($count = null, $state = [])
* @method static \Illuminate\Database\Eloquent\Builder<static>|User newModelQuery()
* @method static \Illuminate\Database\Eloquent\Builder<static>|User newQuery()
@ -55,6 +56,7 @@
* @method static \Illuminate\Database\Eloquent\Builder<static>|User whereRoleType($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|User whereStatus($value)
* @method static \Illuminate\Database\Eloquent\Builder<static>|User whereUpdatedAt($value)
*
* @mixin \Eloquent
*/
class User extends Authenticatable

66
composer.lock generated
View File

@ -3996,16 +3996,16 @@
},
{
"name": "symfony/finder",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/finder.git",
"reference": "01b24a145bbeaa7141e75887ec904c34a6728a5f"
"reference": "ad4daa7c38668dcb031e63bc99ea9bd42196a2cb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/finder/zipball/01b24a145bbeaa7141e75887ec904c34a6728a5f",
"reference": "01b24a145bbeaa7141e75887ec904c34a6728a5f",
"url": "https://api.github.com/repos/symfony/finder/zipball/ad4daa7c38668dcb031e63bc99ea9bd42196a2cb",
"reference": "ad4daa7c38668dcb031e63bc99ea9bd42196a2cb",
"shasum": ""
},
"require": {
@ -4040,7 +4040,7 @@
"description": "Finds files and directories via an intuitive fluent interface",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/finder/tree/v7.4.4"
"source": "https://github.com/symfony/finder/tree/v7.4.5"
},
"funding": [
{
@ -4060,20 +4060,20 @@
"type": "tidelift"
}
],
"time": "2026-01-12T12:19:02+00:00"
"time": "2026-01-26T15:07:59+00:00"
},
{
"name": "symfony/http-foundation",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "977a554a34cf8edc95ca351fbecb1bb1ad05cc94"
"reference": "446d0db2b1f21575f1284b74533e425096abdfb6"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/977a554a34cf8edc95ca351fbecb1bb1ad05cc94",
"reference": "977a554a34cf8edc95ca351fbecb1bb1ad05cc94",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/446d0db2b1f21575f1284b74533e425096abdfb6",
"reference": "446d0db2b1f21575f1284b74533e425096abdfb6",
"shasum": ""
},
"require": {
@ -4122,7 +4122,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-foundation/tree/v7.4.4"
"source": "https://github.com/symfony/http-foundation/tree/v7.4.5"
},
"funding": [
{
@ -4142,20 +4142,20 @@
"type": "tidelift"
}
],
"time": "2026-01-09T12:14:21+00:00"
"time": "2026-01-27T16:16:02+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "48b067768859f7b68acf41dfb857a5a4be00acdd"
"reference": "229eda477017f92bd2ce7615d06222ec0c19e82a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/48b067768859f7b68acf41dfb857a5a4be00acdd",
"reference": "48b067768859f7b68acf41dfb857a5a4be00acdd",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/229eda477017f92bd2ce7615d06222ec0c19e82a",
"reference": "229eda477017f92bd2ce7615d06222ec0c19e82a",
"shasum": ""
},
"require": {
@ -4241,7 +4241,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v7.4.4"
"source": "https://github.com/symfony/http-kernel/tree/v7.4.5"
},
"funding": [
{
@ -4261,7 +4261,7 @@
"type": "tidelift"
}
],
"time": "2026-01-24T22:13:01+00:00"
"time": "2026-01-28T10:33:42+00:00"
},
{
"name": "symfony/mailer",
@ -4349,16 +4349,16 @@
},
{
"name": "symfony/mime",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "40945014c0a9471ccfe19673c54738fa19367a3c"
"reference": "b18c7e6e9eee1e19958138df10412f3c4c316148"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/40945014c0a9471ccfe19673c54738fa19367a3c",
"reference": "40945014c0a9471ccfe19673c54738fa19367a3c",
"url": "https://api.github.com/repos/symfony/mime/zipball/b18c7e6e9eee1e19958138df10412f3c4c316148",
"reference": "b18c7e6e9eee1e19958138df10412f3c4c316148",
"shasum": ""
},
"require": {
@ -4369,15 +4369,15 @@
},
"conflict": {
"egulias/email-validator": "~3.0.0",
"phpdocumentor/reflection-docblock": "<3.2.2",
"phpdocumentor/type-resolver": "<1.4.0",
"phpdocumentor/reflection-docblock": "<5.2|>=6",
"phpdocumentor/type-resolver": "<1.5.1",
"symfony/mailer": "<6.4",
"symfony/serializer": "<6.4.3|>7.0,<7.0.3"
},
"require-dev": {
"egulias/email-validator": "^2.1.10|^3.1|^4",
"league/html-to-markdown": "^5.0",
"phpdocumentor/reflection-docblock": "^3.0|^4.0|^5.0",
"phpdocumentor/reflection-docblock": "^5.2",
"symfony/dependency-injection": "^6.4|^7.0|^8.0",
"symfony/process": "^6.4|^7.0|^8.0",
"symfony/property-access": "^6.4|^7.0|^8.0",
@ -4414,7 +4414,7 @@
"mime-type"
],
"support": {
"source": "https://github.com/symfony/mime/tree/v7.4.4"
"source": "https://github.com/symfony/mime/tree/v7.4.5"
},
"funding": [
{
@ -4434,7 +4434,7 @@
"type": "tidelift"
}
],
"time": "2026-01-08T16:12:55+00:00"
"time": "2026-01-27T08:59:58+00:00"
},
{
"name": "symfony/polyfill-ctype",
@ -5267,16 +5267,16 @@
},
{
"name": "symfony/process",
"version": "v7.4.4",
"version": "v7.4.5",
"source": {
"type": "git",
"url": "https://github.com/symfony/process.git",
"reference": "626f07a53f4b4e2f00e11824cc29f928d797783b"
"reference": "608476f4604102976d687c483ac63a79ba18cc97"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/process/zipball/626f07a53f4b4e2f00e11824cc29f928d797783b",
"reference": "626f07a53f4b4e2f00e11824cc29f928d797783b",
"url": "https://api.github.com/repos/symfony/process/zipball/608476f4604102976d687c483ac63a79ba18cc97",
"reference": "608476f4604102976d687c483ac63a79ba18cc97",
"shasum": ""
},
"require": {
@ -5308,7 +5308,7 @@
"description": "Executes commands in sub-processes",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/process/tree/v7.4.4"
"source": "https://github.com/symfony/process/tree/v7.4.5"
},
"funding": [
{
@ -5328,7 +5328,7 @@
"type": "tidelift"
}
],
"time": "2026-01-20T09:23:51+00:00"
"time": "2026-01-26T15:07:59+00:00"
},
{
"name": "symfony/routing",

View File

@ -0,0 +1,22 @@
<?php
namespace Database\Seeders;
use App\Models\DealCategory;
use Illuminate\Database\Seeder;
class CategorySeeder extends Seeder
{
public function run(): void
{
/**
* @var array<int, array{name: string, description: string, slug:string, active:bool, order:int}> $categories
*/
$categories = [
['name' => 'Food', 'description' => 'Share Food related deals', 'slug' => 'food', 'active' => true, 'order' => 1],
['name' => 'Real Estate', 'description' => 'Share Real Estate related deals', 'slug' => 'real-estate', 'active' => true, 'order' => 2],
['name' => 'Sell & Deal', 'description' => 'Sell your services', 'slug' => 'sell-and-deal', 'active' => true, 'order' => 3],
];
DealCategory::insert($categories);
}
}

View File

@ -1,5 +1,4 @@
import './bootstrap';
import {setSidebarState} from '@/sidebar.js';
import "./alert.js"
import "./image-input.js"
import "./menu.js"
@ -7,11 +6,13 @@ import "./modal.js"
import "./sidebar.js"
import "./toast.js"
import "./deal-view-modal.js"
import {setSidebarState} from './sidebar.js';
import {favorite, like, redirect} from "./interaction.js";
import {showReportModal} from "./report-deal.js";
import {initTabs} from "./tab.js";
import {loadModalFromQuery} from "./explore-page.js";
import {deleteRecentSearch} from "./deleteRecentSearch.js";
import {initNavMenu} from "./nav-menu.js";
document.deleteSearch = deleteRecentSearch;
document.like = like;
@ -37,7 +38,7 @@ window.addEventListener('load', async () => {
setSidebarState(savedState);
}
initNavMenu();
initTabs();
await loadModalFromQuery();
});

View File

@ -1,20 +1,22 @@
const openBtn = document.getElementById('openBtn');
const closeBtn = document.getElementById('closeBtn');
const mobileMenu = document.getElementById('mobileMenu');
const body = document.body;
export function initNavMenu() {
const openBtn = document.getElementById('openBtn');
const closeBtn = document.getElementById('closeBtn');
const mobileMenu = document.getElementById('mobileMenu');
const body = document.body;
if (openBtn) {
if (openBtn) {
openBtn.addEventListener('click', () => {
mobileMenu.classList.remove('translate-x-full');
mobileMenu.classList.add('translate-x-0');
body.style.overflow = 'hidden';
})
}
}
if (closeBtn) {
if (closeBtn) {
closeBtn.addEventListener('click', () => {
mobileMenu.classList.add('translate-x-full');
mobileMenu.classList.remove('translate-x-0');
body.style.overflow = 'visible';
})
}
}

View File

@ -37,7 +37,7 @@ class=" h-full items-center flex justify-center">
</x-ui.table.row>
@empty
<x-ui.table.row>
<td colspan="4" class="text-center text-sm text-accent-600 py-2">No Broker found</td>
<td colspan="3" class="text-center text-sm text-accent-600 py-2">No broker found</td>
</x-ui.table.row>
@endforelse
</x-ui.table>

View File

@ -0,0 +1,52 @@
@props(['deals' => []])
<x-dashboard.card class="w-full">
<h3 class="text-md font-bold mb-2">Approved deals</h3>
<x-ui.table>
<x-ui.table.head>
<th>Title</th>
<th>Description</th>
<th>Link</th>
<th>Category</th>
<th>Broker</th>
</x-ui.table.head>
@forelse($deals as $deal)
<x-ui.table.row>
<td class="text-sm font-medium px-4 text-center truncate max-w-20">{{ucfirst($deal->title)}}</td>
<td class="text-sm text-accent-600 px-4 text-center truncate max-w-60">{{$deal->description}}</td>
<td class="text-sm px-4 text-center">{{$deal->link}}</td>
<td class="text-sm px-4 text-center">{{$deal->category->name}}</td>
<td class="text-sm px-4 text-center">{{$deal->broker->name}}</td>
{{-- <x-slot:actions>--}}
{{-- <div class="flex items-center justify-center space-x-2 py-1 px-2">--}}
{{-- <form action="{{route('admin.deals.approve', $deal)}}"--}}
{{-- onsubmit="return confirm('Are you sure to activate the deal ?')" method="post"--}}
{{-- class=" h-full items-center flex justify-center">--}}
{{-- @csrf--}}
{{-- <x-ui.button-sm tooltip="Approve deal" variant="green">--}}
{{-- <x-heroicon-o-check class="w-4"/>--}}
{{-- </x-ui.button-sm>--}}
{{-- </form>--}}
{{-- <form action="{{route('admin.deals.reject', $deal)}}"--}}
{{-- onsubmit="return confirm('Are you sure to delete the deal ?')" method="post"--}}
{{-- class=" h-full items-center flex justify-center">--}}
{{-- @csrf--}}
{{-- <x-ui.button-sm tooltip="Delete deal" variant="red">--}}
{{-- <x-heroicon-o-x-mark class="w-4"/>--}}
{{-- </x-ui.button-sm>--}}
{{-- </form>--}}
{{-- <x-ui.button-sm data-deal-id="{{$deal->id}}" class="view-deal-btn" tooltip="View Content" variant="ghost">--}}
{{-- <x-heroicon-o-eye class="w-4"/>--}}
{{-- </x-ui.button-sm>--}}
{{-- </div>--}}
{{-- </x-slot:actions>--}}
</x-ui.table.row>
@empty
<x-ui.table.row>
<td colspan="5" class="text-center text-sm text-accent-600 py-2">No deals found</td>
</x-ui.table.row>
@endforelse
</x-ui.table>
</x-dashboard.card>

View File

@ -42,7 +42,7 @@ class=" h-full items-center flex justify-center">
</x-ui.table.row>
@empty
<x-ui.table.row>
<td colspan="4" class="text-center text-sm text-accent-600 py-2">No Broker found</td>
<td colspan="4" class="text-center text-sm text-accent-600 py-2">No broker found</td>
</x-ui.table.row>
@endforelse
</x-ui.table>

View File

@ -0,0 +1,52 @@
@props(['deals' => []])
<x-dashboard.card class="w-full">
<h3 class="text-md font-bold mb-2">Pending deals</h3>
<x-ui.table>
<x-ui.table.head>
<th>Title</th>
<th>Description</th>
<th>Link</th>
<th>Category</th>
<th>Broker</th>
</x-ui.table.head>
@forelse($deals as $deal)
<x-ui.table.row>
<td class="text-sm font-medium px-4 text-center truncate max-w-20">{{ucfirst($deal->title)}}</td>
<td class="text-sm text-accent-600 px-4 text-center truncate max-w-60">{{$deal->description}}</td>
<td class="text-sm px-4 text-center">{{$deal->link}}</td>
<td class="text-sm px-4 text-center">{{$deal->category->name}}</td>
<td class="text-sm px-4 text-center">{{$deal->broker->name}}</td>
<x-slot:actions>
<div class="flex items-center justify-center space-x-2 py-1 px-2">
<form action="{{route('admin.deals.approve', $deal)}}"
onsubmit="return confirm('Are you sure to activate the deal ?')" method="post"
class=" h-full items-center flex justify-center">
@csrf
<x-ui.button-sm tooltip="Approve deal" variant="green">
<x-heroicon-o-check class="w-4"/>
</x-ui.button-sm>
</form>
<form action="{{route('admin.deals.reject', $deal)}}"
onsubmit="return confirm('Are you sure to delete the deal ?')" method="post"
class=" h-full items-center flex justify-center">
@csrf
<x-ui.button-sm tooltip="Delete deal" variant="red">
<x-heroicon-o-x-mark class="w-4"/>
</x-ui.button-sm>
</form>
<x-ui.button-sm data-deal-id="{{$deal->id}}" class="view-deal-btn" tooltip="View Content" variant="ghost">
<x-heroicon-o-eye class="w-4"/>
</x-ui.button-sm>
</div>
</x-slot:actions>
</x-ui.table.row>
@empty
<x-ui.table.row>
<td colspan="5" class="text-center text-sm text-accent-600 py-2">No deals found</td>
</x-ui.table.row>
@endforelse
</x-ui.table>
</x-dashboard.card>

View File

@ -1,44 +1,45 @@
@props(['activeClass' => 'bg-gray-100 text-gray-900'])
<div
id="sidebarWrapper" {{$attributes->merge([ 'class' => 'border-r border-r-gray-300 transition-all duration-300 ease-in-out w-64 relative'])}}>
id="sidebarWrapper" {{$attributes->merge([ 'class' => 'border-r border-r-gray-300 group transition-all duration-300 ease-in-out w-64 relative'])}}>
<div class="hidden md:flex h-screen items-center">
<div id="sidebar"
class="flex flex-col p-4 pt-6 justify-between font-medium h-full w-full overflow-hidden transition-all duration-300 ease-in-out">
<div class="">
<div class="flex space-x-4 border-b border-b-gray-300 pb-6">
class="flex flex-col p-4 pt-6 justify-between font-medium h-full w-full transition-all duration-300 ease-in-out">
<div>
<div class="flex space-x-4 border-b border-b-gray-300 pb-6 n">
<x-logo/>
<a href="{{route('home')}}" class="whitespace-nowrap">
<a href="{{route('home')}}" class="whitespace-nowrap group-[.w-20]:hidden">
<p class="text-2xl font-bold">DealHub</p>
<p class="text-accent-600 text-sm">Admin Panel</p>
</a>
</div>
<div class="pt-6 flex flex-col space-y-3 whitespace-nowrap">
<x-dashboard.broker.sidebar.item :link="route('admin.dashboard')">
<x-dashboard.broker.sidebar.item tooltip="Dashboard" :link="route('admin.dashboard')">
<x-heroicon-o-squares-2x2 class="min-w-5 w-5"/>
<p class="sidebar-text transition-opacity duration-300 ease-in-out ">Dashboard</p>
</x-dashboard.broker.sidebar.item>
<x-dashboard.broker.sidebar.item
tooltip="Manage Customers"
:active="\Illuminate\Support\Facades\Route::is('admin.customers.*')"
:link="route('admin.customers.index')">
<x-heroicon-o-users class="min-w-5 w-5"/>
<p class="sidebar-text transition-opacity duration-300 ease-in-out ">Manage Customers</p>
</x-dashboard.broker.sidebar.item>
<x-dashboard.broker.sidebar.item :active="\Illuminate\Support\Facades\Route::is('admin.brokers.*')"
<x-dashboard.broker.sidebar.item tooltip="Manage Brokers" :active="\Illuminate\Support\Facades\Route::is('admin.brokers.*')"
:link="route('admin.brokers.index')">
<x-heroicon-o-user class="min-w-5 w-5"/>
<p class="sidebar-text transition-opacity duration-300 ease-in-out">Manage Brokers</p>
</x-dashboard.broker.sidebar.item>
<x-dashboard.broker.sidebar.item :link="route('admin.reports.index')">
<x-dashboard.broker.sidebar.item tooltip="Manage Reports" :link="route('admin.reports.index')">
<x-heroicon-o-exclamation-triangle class="w-5 min-w-5"/>
<p class="sidebar-text transition-opacity duration-300 ease-in-out">Manage Reports</p>
</x-dashboard.broker.sidebar.item>
<x-dashboard.broker.sidebar.item :link="route('admin.deals.index')">
<x-dashboard.broker.sidebar.item tooltip="Manage Deals" :link="route('admin.deals.index')">
<x-heroicon-o-fire class="w-5 min-w-5"/>
<p class="sidebar-text transition-opacity duration-300 ease-in-out">Manage Deals</p>
</x-dashboard.broker.sidebar.item>
@ -46,10 +47,6 @@ class="flex flex-col p-4 pt-6 justify-between font-medium h-full w-full overflow
</div>
<div class="">
<x-dashboard.broker.sidebar.item :link="route('broker.profile.show', auth()->user()->id)">
<x-heroicon-o-user class="w-5 min-w-5"/>
<p class="sidebar-text transition-opacity duration-300 ease-in-out">Profile</p>
</x-dashboard.broker.sidebar.item>
<form method="post" action="{{route('logout')}}">
@csrf

View File

@ -1,10 +1,18 @@
@props([ 'link' => '', 'active' => false])
@props([ 'link' => '', 'active' => false, 'tooltip' => ''])
@php
if (!$active){
$active = url()->current() === $link;
}
@endphp
@aware(['activeClass' => 'bg-gray-100 text-gray-900'])
<a href="{{$link}}" {{$attributes->class(["flex space-x-3 items-center pl-3 py-3 rounded-xl hover:bg-gray-100 border border-transparent ease-in-out transition-all duration-300 active:scale-80 hover:border-gray-300", $activeClass => $active])}} >
<div class="relative group/item w-full hover:z-10">
<a href="{{$link}}" {{$attributes->class(["flex space-x-3 items-center pl-3 py-3 rounded-xl hover:bg-gray-100 border border-transparent ease-in-out transition-all duration-300 active:scale-80 hover:border-gray-300", $activeClass => $active])}} >
{{$slot}}
</a>
</a>
@if($tooltip !== '')
<span
class="absolute z-10 top-[30%] hidden group-[.w-20]:group-hover/item:block left-[110%] py-1 px-2 rounded-lg bg-gray-900 text-xs whitespace-nowrap text-white">
{{$tooltip}}
</span>
@endif
</div>

View File

@ -1,3 +1,3 @@
<div {{$attributes->merge(['class' => 'p-4 md:p-6 border border-gray-200 rounded-xl'])}}>
<div {{$attributes->merge(['class' => 'bg-white p-4 md:p-6 border border-gray-200 rounded-xl'])}}>
{{$slot}}
</div>

View File

@ -1,6 +1,6 @@
@props(['item'])
<li class="flex space-x-2">
<a class="p-2 md:p-4 flex-1 flex items-center text-gray-600 hover:bg-gray-100 hover:font-bold hover:text-gray-900 rounded-xl"
<li class="flex items-center space-x-2 px-4 py-1 md:py-2 text-gray-600 hover:bg-gray-100 hover:font-bold hover:text-gray-900 rounded-xl">
<a class="flex-1 flex items-center"
href="{{route('explore', ['search' => $item])}}">
{{$item->query}}
<x-heroicon-o-arrow-up-right class="w-3 ml-2"/>

View File

@ -17,8 +17,8 @@
Connect with trusted brokers and discover opportunities you can count on.
</p>
<div class="mt-6 flex flex-col gap-4 md:flex-row">
<a href="" class="ui-btn ui-btn-neutral">Explore Deals <x-heroicon-o-arrow-right class="w-4 inline ml-4"/> </a>
<a href="" class="ui-btn ui-btn bg-white/80 border border-gray-300">Become a Broker</a>
<a href="{{route('explore')}}" class="ui-btn ui-btn-neutral">Explore Deals <x-heroicon-o-arrow-right class="w-4 inline ml-4"/> </a>
<a href="{{route('register.create')}}" class="ui-btn ui-btn bg-white/80 border border-gray-300">Become a Broker</a>
</div>
</div>
<!-- Left section end -->

View File

@ -36,7 +36,7 @@
</nav>
<!-- mobile menu btn-->
<div id='mobileMenu' class="hidden absolute top-0 h-[101vh] overflow-y-hidden w-[101vw] bg-gray-200 text-xl z-1 p-10">
<div id='mobileMenu' class="fixed top-0 left-0 z-100 h-screen w-full translate-x-full bg-gray-100/50 backdrop-blur-xl p-10 text-xl transition-transform duration-500 ease-in-out overflow-y-auto">
<div class="flex justify-between mb-8">
<x-logo/>
<x-ui.button id="closeBtn">
@ -46,7 +46,7 @@
<div class="nav-links mb-10">
<ul class="flex flex-col space-y-8 text-accent-600">
<x-nav-links :link="route('home')" name="Home"/>
<x-nav-links :link="route('home')" name="Explore deals"/>
<x-nav-links :link="route('explore')" name="Explore deals"/>
<x-nav-links :link="route('home')" name="About"/>
<x-nav-links :link="route('home')" name="Contact"/>
<a href="{{route('login.create')}}">Login</a>

View File

@ -1,7 +1,7 @@
@props(['image' => '', 'alt' => ''])
<div {{$attributes->merge(['class' => "border border-gray-200 rounded-xl overflow-clip flex flex-col h-full"])}}>
<div class="flex flex-col h-full">
<div class="rounded-t-xl h-70">
<div class="rounded-t-xl h-70 bg-gray-100 flex justify-center items-center">
<img src="{{$image}}" alt="" class="object-cover">
</div>
<div class="flex-1">

View File

@ -38,8 +38,8 @@ class="opacity-0 absolute w-full h-full top-0 left-0 cursor-pointer z-20"
</div>
<dialog id="image-modal"
class="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white rounded-lg p-4 shadow-lg">
<div>
class="fixed w-max max-h-[90vh] top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 bg-white rounded-lg p-4 shadow-lg">
<div class="overflow-scroll max-h-[75vh]">
<img src="" alt="" id="image-placeholder">
</div>
<div class="flex space-x-4 mt-6 justify-end">

View File

@ -1,5 +1,5 @@
<div id="preloader"
class="bg-white fixed top-0 left-0 h-screen w-screen z-1000 flex items-center justify-center opacity-100 transition-opacity duration-300 ease-in-out">
class="bg-gray-100 fixed top-0 left-0 h-screen w-screen z-1000 flex items-center justify-center opacity-100 transition-all duration-500 ease-in-out">
<div
class="inline-block h-8 w-8 animate-spin rounded-full border-4
border-solid border-black border-e-transparent align-[-0.125em]

View File

@ -44,7 +44,7 @@ class=" h-full items-center flex justify-center">
</x-ui.table.row>
@empty
<x-ui.table.row>
<td colspan="2" class="text-center text-sm text-accent-600 py-2">No Customer found</td>
<td colspan="3" class="text-center text-sm text-accent-600 py-2">No Customer found</td>
</x-ui.table.row>
@endforelse
</x-ui.table>

View File

@ -6,58 +6,9 @@
description="Approve or reject deals"
/>
</x-slot:heading>
<div class="flex items-center justify-center px-4 pb-4 pt-0 md:px-8 md:pb-8">
<x-dashboard.card class="w-full">
<h3 class="text-md font-bold mb-2">Approve deals</h3>
<x-ui.table>
<x-ui.table.head>
<th>Title</th>
<th>Description</th>
<th>Link</th>
<th>Category</th>
<th>Broker</th>
</x-ui.table.head>
@forelse($deals as $deal)
<x-ui.table.row>
<td class="text-sm font-medium px-4 text-center truncate max-w-20">{{ucfirst($deal->title)}}</td>
<td class="text-sm text-accent-600 px-4 text-center truncate max-w-60">{{$deal->description}}</td>
<td class="text-sm px-4 text-center">{{$deal->link}}</td>
<td class="text-sm px-4 text-center">{{$deal->category->name}}</td>
<td class="text-sm px-4 text-center">{{$deal->broker->name}}</td>
<x-slot:actions>
<div class="flex items-center justify-center space-x-2 py-1 px-2">
<form action="{{route('admin.deals.approve', $deal)}}"
onsubmit="return confirm('Are you sure to activate the deal ?')" method="post"
class=" h-full items-center flex justify-center">
@csrf
<x-ui.button-sm tooltip="Approve deal" variant="green">
<x-heroicon-o-check class="w-4"/>
</x-ui.button-sm>
</form>
<form action="{{route('admin.deals.reject', $deal)}}"
onsubmit="return confirm('Are you sure to delete the deal ?')" method="post"
class=" h-full items-center flex justify-center">
@csrf
<x-ui.button-sm tooltip="Delete deal" variant="red">
<x-heroicon-o-x-mark class="w-4"/>
</x-ui.button-sm>
</form>
<x-ui.button-sm data-deal-id="{{$deal->id}}" class="view-deal-btn" tooltip="View Content" variant="ghost">
<x-heroicon-o-eye class="w-4"/>
</x-ui.button-sm>
</div>
</x-slot:actions>
</x-ui.table.row>
@empty
<x-ui.table.row>
<td colspan="2" class="text-center text-sm text-accent-600 py-2">No Customer found</td>
</x-ui.table.row>
@endforelse
</x-ui.table>
</x-dashboard.card>
<div class="flex flex-col items-center justify-center space-y-4 md:space-y-8 px-4 pb-4 pt-0 md:px-8 md:pb-8">
<x-dashboard.admin.pending-deals :deals="$pendingDeals" />
<x-dashboard.admin.all-deals :deals="$activeDeals" />
</div>
<x-dashboard.user.deal-modal />
@vite('resources/js/admin-deals.js')

View File

@ -78,7 +78,7 @@ class=" h-full items-center flex justify-center">
</x-ui.table.row>
@empty
<x-ui.table.row>
<td colspan="2" class="text-center text-sm text-accent-600 py-2">No Customer found</td>
<td colspan="5" class="text-center text-sm text-accent-600 py-2">No deals found</td>
</x-ui.table.row>
@endforelse
</x-ui.table>