feature flags and a bit on the design
This commit is contained in:
@@ -42,13 +42,13 @@
|
||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
||||
<!-- Filters & Sorting -->
|
||||
<div class="mb-8">
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-200 p-6">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-xl shadow-sm border border-gray-200 dark:border-gray-700 p-6">
|
||||
<form method="GET" action="{{ route('products.index') }}" class="space-y-4 lg:space-y-0" x-data="{ showFilters: false }">
|
||||
<!-- Filter Toggle (Mobile) -->
|
||||
<div class="lg:hidden mb-4">
|
||||
<button @click="showFilters = !showFilters"
|
||||
type="button"
|
||||
class="w-full inline-flex items-center justify-between px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
||||
class="w-full inline-flex items-center justify-between px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
||||
<span class="flex items-center">
|
||||
<svg class="mr-2 h-5 w-5 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 6V4m0 2a2 2 0 100 4m0-4a2 2 0 110 4m-6 8a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4m6 6v10m6-2a2 2 0 100-4m0 4a2 2 0 110-4m0 4v2m0-6V4"></path>
|
||||
@@ -126,7 +126,7 @@
|
||||
Apply
|
||||
</button>
|
||||
<a href="{{ route('products.index') }}"
|
||||
class="flex-1 lg:flex-none inline-flex items-center justify-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
||||
class="flex-1 lg:flex-none inline-flex items-center justify-center px-4 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-primary-500">
|
||||
<svg class="mr-2 h-4 w-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12"></path>
|
||||
</svg>
|
||||
|
||||
@@ -18,13 +18,13 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="bg-white rounded-lg shadow-sm border border-gray-200">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700">
|
||||
<!-- Product Header -->
|
||||
<div class="px-6 py-8 border-b border-gray-200">
|
||||
<div class="px-6 py-8 border-b border-gray-200 dark:border-gray-700">
|
||||
<div class="flex flex-col md:flex-row md:items-start md:justify-between gap-4">
|
||||
<div class="flex-1">
|
||||
<div class="flex items-center gap-3 mb-3">
|
||||
<h1 class="text-3xl font-bold text-gray-900">{{ $product->title }}</h1>
|
||||
<h1 class="text-3xl font-bold text-gray-900 dark:text-white">{{ $product->title }}</h1>
|
||||
|
||||
<!-- Status Badges -->
|
||||
@if($product->isPending())
|
||||
@@ -42,8 +42,8 @@
|
||||
@endif
|
||||
</div>
|
||||
|
||||
<div class="flex items-center gap-3 text-sm text-gray-600">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-md bg-primary-100 text-primary-800 font-medium">
|
||||
<div class="flex items-center gap-3 text-sm text-gray-600 dark:text-gray-400">
|
||||
<span class="inline-flex items-center px-2.5 py-0.5 rounded-md bg-primary-100 dark:bg-primary-900 text-primary-800 dark:text-primary-200 font-medium">
|
||||
{{ $product->category->name }}
|
||||
</span>
|
||||
<span>•</span>
|
||||
@@ -60,7 +60,7 @@
|
||||
@auth
|
||||
<!-- Upvote Button -->
|
||||
<button
|
||||
class="upvote-btn flex items-center gap-2 px-4 py-2 rounded-md border transition-colors {{ $product->isUpvotedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 text-primary-700' : 'border-gray-300 bg-white text-gray-700 hover:border-primary-500 hover:bg-primary-50' }}"
|
||||
class="upvote-btn flex items-center gap-2 px-4 py-2 rounded-md border transition-colors {{ $product->isUpvotedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 dark:bg-primary-900 text-primary-700 dark:text-primary-200' : 'border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:border-primary-500 hover:bg-primary-50 dark:hover:bg-primary-900' }}"
|
||||
data-product-id="{{ $product->id }}"
|
||||
data-upvoted="{{ $product->isUpvotedBy(auth()->user()) ? 'true' : 'false' }}">
|
||||
<svg class="h-5 w-5" fill="{{ $product->isUpvotedBy(auth()->user()) ? 'currentColor' : 'none' }}" stroke="currentColor" viewBox="0 0 24 24">
|
||||
@@ -71,7 +71,7 @@
|
||||
|
||||
<!-- Bookmark Button -->
|
||||
<button
|
||||
class="bookmark-btn p-2 rounded-md border transition-colors {{ $product->isBookmarkedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 text-primary-700' : 'border-gray-300 bg-white text-gray-700 hover:border-gray-400' }}"
|
||||
class="bookmark-btn p-2 rounded-md border transition-colors {{ $product->isBookmarkedBy(auth()->user()) ? 'border-primary-500 bg-primary-50 dark:bg-primary-900 text-primary-700 dark:text-primary-200' : 'border-gray-300 dark:border-gray-600 bg-white dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:border-gray-400 dark:hover:border-gray-500' }}"
|
||||
data-product-id="{{ $product->id }}"
|
||||
data-bookmarked="{{ $product->isBookmarkedBy(auth()->user()) ? 'true' : 'false' }}">
|
||||
<svg class="h-5 w-5" fill="{{ $product->isBookmarkedBy(auth()->user()) ? 'currentColor' : 'none' }}" stroke="currentColor" viewBox="0 0 24 24">
|
||||
@@ -79,7 +79,7 @@
|
||||
</svg>
|
||||
</button>
|
||||
@else
|
||||
<div class="flex items-center gap-2 px-4 py-2 rounded-md border border-gray-300 bg-gray-50 text-gray-700">
|
||||
<div class="flex items-center gap-2 px-4 py-2 rounded-md border border-gray-300 dark:border-gray-600 bg-gray-50 dark:bg-gray-700 text-gray-700 dark:text-gray-300">
|
||||
<svg class="h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 15l7-7 7 7"></path>
|
||||
</svg>
|
||||
@@ -88,7 +88,7 @@
|
||||
@endauth
|
||||
|
||||
@can('edit-product', $product)
|
||||
<a href="{{ route('products.edit', $product) }}" class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50">
|
||||
<a href="{{ route('products.edit', $product) }}" class="inline-flex items-center px-3 py-2 border border-gray-300 dark:border-gray-600 shadow-sm text-sm font-medium rounded-md text-gray-700 dark:text-gray-300 bg-white dark:bg-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
|
||||
Edit
|
||||
</a>
|
||||
@endcan
|
||||
@@ -97,7 +97,7 @@
|
||||
<form action="{{ route('products.destroy', $product) }}" method="POST" onsubmit="return confirm('Are you sure you want to delete this product?');">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="inline-flex items-center px-3 py-2 border border-red-300 shadow-sm text-sm font-medium rounded-md text-red-700 bg-white hover:bg-red-50">
|
||||
<button type="submit" class="inline-flex items-center px-3 py-2 border border-red-300 dark:border-red-700 shadow-sm text-sm font-medium rounded-md text-red-700 dark:text-red-400 bg-white dark:bg-gray-700 hover:bg-red-50 dark:hover:bg-red-900">
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
@@ -110,17 +110,17 @@
|
||||
<div class="px-6 py-8">
|
||||
<!-- Product Thumbnail -->
|
||||
@if($product->thumbnail_url)
|
||||
<div class="mb-8 rounded-lg overflow-hidden border border-gray-200">
|
||||
<div class="mb-8 rounded-lg overflow-hidden border border-gray-200 dark:border-gray-700">
|
||||
<img src="{{ $product->thumbnail_url }}"
|
||||
alt="{{ $product->title }}"
|
||||
class="w-full h-auto max-h-96 object-contain bg-gray-50">
|
||||
class="w-full h-auto max-h-96 object-contain bg-gray-50 dark:bg-gray-900">
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Product Description -->
|
||||
<div class="mb-8">
|
||||
<h2 class="text-xl font-semibold text-gray-900 mb-4">About</h2>
|
||||
<p class="text-gray-700 text-lg leading-relaxed whitespace-pre-line">{{ $product->description }}</p>
|
||||
<h2 class="text-xl font-semibold text-gray-900 dark:text-white mb-4">About</h2>
|
||||
<p class="text-gray-700 dark:text-gray-300 text-lg leading-relaxed whitespace-pre-line">{{ $product->description }}</p>
|
||||
</div>
|
||||
|
||||
<!-- Visit Website Button -->
|
||||
@@ -138,27 +138,27 @@
|
||||
|
||||
<!-- Product Metadata -->
|
||||
@if($product->isApproved() && $product->approved_at)
|
||||
<div class="pt-6 border-t border-gray-200">
|
||||
<div class="pt-6 border-t border-gray-200 dark:border-gray-700">
|
||||
<dl class="grid grid-cols-1 gap-x-4 gap-y-4 sm:grid-cols-2">
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Submitted by</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">
|
||||
<a href="{{ route('profile.show', $product->user) }}" class="hover:text-primary-600">
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Submitted by</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">
|
||||
<a href="{{ route('profile.show', $product->user) }}" class="hover:text-primary-600 dark:hover:text-primary-400">
|
||||
{{ $product->user->name }}
|
||||
</a>
|
||||
</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Submitted on</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $product->created_at->format('F j, Y') }}</dd>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Submitted on</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">{{ $product->created_at->format('F j, Y') }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Approved on</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $product->approved_at->format('F j, Y') }}</dd>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Approved on</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">{{ $product->approved_at->format('F j, Y') }}</dd>
|
||||
</div>
|
||||
<div>
|
||||
<dt class="text-sm font-medium text-gray-500">Category</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900">{{ $product->category->name }}</dd>
|
||||
<dt class="text-sm font-medium text-gray-500 dark:text-gray-400">Category</dt>
|
||||
<dd class="mt-1 text-sm text-gray-900 dark:text-white">{{ $product->category->name }}</dd>
|
||||
</div>
|
||||
</dl>
|
||||
</div>
|
||||
@@ -167,9 +167,9 @@
|
||||
</div>
|
||||
|
||||
<!-- Comments Section -->
|
||||
<div class="bg-white rounded-lg shadow-sm border border-gray-200 mt-6">
|
||||
<div class="px-6 py-4 border-b border-gray-200">
|
||||
<h2 class="text-xl font-semibold text-gray-900">
|
||||
<div class="bg-white dark:bg-gray-800 rounded-lg shadow-sm border border-gray-200 dark:border-gray-700 mt-6">
|
||||
<div class="px-6 py-4 border-b border-gray-200 dark:border-gray-700">
|
||||
<h2 class="text-xl font-semibold text-gray-900 dark:text-white">
|
||||
Comments ({{ $product->comments()->count() }})
|
||||
</h2>
|
||||
</div>
|
||||
@@ -200,8 +200,8 @@
|
||||
</div>
|
||||
</form>
|
||||
@else
|
||||
<div class="text-center py-6 bg-gray-50 rounded-lg mb-8">
|
||||
<p class="text-gray-600">
|
||||
<div class="text-center py-6 bg-gray-50 dark:bg-gray-900 rounded-lg mb-8">
|
||||
<p class="text-gray-600 dark:text-gray-400">
|
||||
<a href="{{ route('login') }}" class="font-medium text-primary-600 hover:text-primary-500">Log in</a>
|
||||
to post a comment
|
||||
</p>
|
||||
@@ -229,11 +229,11 @@
|
||||
<div class="flex-1 min-w-0">
|
||||
<div class="flex items-center justify-between">
|
||||
<div class="flex items-center gap-2">
|
||||
<a href="{{ route('profile.show', $comment->user) }}" class="font-medium text-gray-900 hover:text-primary-600">
|
||||
<a href="{{ route('profile.show', $comment->user) }}" class="font-medium text-gray-900 dark:text-white hover:text-primary-600 dark:hover:text-primary-400">
|
||||
{{ $comment->user->name }}
|
||||
</a>
|
||||
<span class="text-gray-500 text-sm">·</span>
|
||||
<span class="text-gray-500 text-sm">{{ $comment->created_at->diffForHumans() }}</span>
|
||||
<span class="text-gray-500 dark:text-gray-400 text-sm">·</span>
|
||||
<span class="text-gray-500 dark:text-gray-400 text-sm">{{ $comment->created_at->diffForHumans() }}</span>
|
||||
</div>
|
||||
@can('delete-comment', $comment)
|
||||
<form action="{{ route('comments.destroy', $comment) }}" method="POST" onsubmit="return confirm('Are you sure you want to delete this comment?');">
|
||||
@@ -245,15 +245,15 @@
|
||||
</form>
|
||||
@endcan
|
||||
</div>
|
||||
<p class="mt-2 text-gray-700 whitespace-pre-line">{{ $comment->body }}</p>
|
||||
<p class="mt-2 text-gray-700 dark:text-gray-300 whitespace-pre-line">{{ $comment->body }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@empty
|
||||
<div class="text-center py-12 bg-gray-50 rounded-lg">
|
||||
<div class="text-center py-12 bg-gray-50 dark:bg-gray-900 rounded-lg">
|
||||
<svg class="mx-auto h-12 w-12 text-gray-400" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 12h.01M12 12h.01M16 12h.01M21 12c0 4.418-4.03 8-9 8a9.863 9.863 0 01-4.255-.949L3 20l1.395-3.72C3.512 15.042 3 13.574 3 12c0-4.418 4.03-8 9-8s9 3.582 9 8z"></path>
|
||||
</svg>
|
||||
<p class="mt-2 text-gray-600">No comments yet. Be the first to share your thoughts!</p>
|
||||
<p class="mt-2 text-gray-600 dark:text-gray-400">No comments yet. Be the first to share your thoughts!</p>
|
||||
</div>
|
||||
@endforelse
|
||||
</div>
|
||||
@@ -287,7 +287,7 @@
|
||||
|
||||
<!-- Back Button -->
|
||||
<div class="mt-6">
|
||||
<a href="{{ route('products.index') }}" class="inline-flex items-center text-sm font-medium text-gray-600 hover:text-gray-900">
|
||||
<a href="{{ route('products.index') }}" class="inline-flex items-center text-sm font-medium text-gray-600 dark:text-gray-400 hover:text-gray-900 dark:hover:text-white">
|
||||
<svg class="mr-2 h-5 w-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 19l-7-7m0 0l7-7m-7 7h18"></path>
|
||||
</svg>
|
||||
|
||||
Reference in New Issue
Block a user