Add dark mode

This commit is contained in:
2026-01-10 15:27:37 +01:00
parent 5f575024e2
commit 4c2a6024d7
2 changed files with 16 additions and 18 deletions

View File

@@ -5,7 +5,7 @@
</div> </div>
<div class="flex-grow"> <div class="flex-grow">
<div> <div>
<a href="#" class="font-medium text-gray-900">{{ $comment->user->name }}</a> <p class="font-medium text-gray-900 dark:text-gray-100">{{ $comment->user->name }}</p>
</div> </div>
<div class="mt-1 flex-grow w-full"> <div class="mt-1 flex-grow w-full">
@if ($isEditing) @if ($isEditing)
@@ -13,7 +13,7 @@
<div> <div>
<label for="comment" class="sr-only">Comment body</label> <label for="comment" class="sr-only">Comment body</label>
<textarea id="comment" name="comment" rows="3" <textarea id="comment" name="comment" rows="3"
class="shadow-sm block w-full focus:ring-rose-500 focus:border-rose-500 border-gray-300 rounded-md class="bg-white dark:bg-neutral-700 shadow-sm block w-full focus:ring-rose-500 focus:border-rose-500 border-gray-300 dark:border-gray-400/40 text-gray-900 dark:text-gray-200 placeholder:text-gray-400 rounded-md
@error('editState.body') border-red-500 @enderror" @error('editState.body') border-red-500 @enderror"
placeholder="Write something" wire:model.defer="editState.body"></textarea> placeholder="Write something" wire:model.defer="editState.body"></textarea>
@error('editState.body') @error('editState.body')
@@ -28,24 +28,22 @@
</div> </div>
</form> </form>
@else @else
<p class="text-gray-700">{!! $comment->presenter()->markdownBody() !!}</p> <div class="text-gray-700 dark:text-gray-200">{!! $comment->presenter()->markdownBody() !!}</div>
@endif @endif
</div> </div>
<div class="mt-2 space-x-2"> <div class="mt-2 space-x-2">
<span class="text-gray-500 font-medium"> <span class="text-gray-500 dark:text-gray-300 font-medium">
{{ $comment->presenter()->relativeCreatedAt() }} {{ $comment->presenter()->relativeCreatedAt() }}
</span> </span>
@auth @auth
{{--@if ($comment->hasParent())--}}
@if ($comment->depth() < 2) @if ($comment->depth() < 2)
<button wire:click="$toggle('isReplying')" type="button" class="text-gray-900 font-medium"> <button wire:click="$toggle('isReplying')" type="button" class="text-gray-900 dark:text-gray-100 font-medium">
Reply Reply
</button> </button>
@endif @endif
{{--@endif--}}
@can ('update', $comment) @can ('update', $comment)
<button wire:click="$toggle('isEditing')" type="button" class="text-gray-900 font-medium"> <button wire:click="$toggle('isEditing')" type="button" class="text-gray-900 dark:text-gray-100 font-medium">
Edit Edit
</button> </button>
@endcan @endcan
@@ -60,7 +58,7 @@
}" }"
@click="confirmCommentDeletion" @click="confirmCommentDeletion"
type="button" type="button"
class="text-gray-900 font-medium" class="text-gray-900 dark:text-gray-100 font-medium"
> >
Delete Delete
</button> </button>
@@ -76,7 +74,7 @@
<div> <div>
<label for="comment" class="sr-only">Reply body</label> <label for="comment" class="sr-only">Reply body</label>
<textarea id="comment" name="comment" rows="3" <textarea id="comment" name="comment" rows="3"
class="shadow-sm block w-full focus:ring-rose-500 focus:border-rose-500 border-gray-300 rounded-md class="bg-white dark:bg-neutral-700 shadow-sm block w-full focus:ring-rose-500 focus:border-rose-500 border-gray-300 dark:border-gray-400/40 text-gray-900 dark:text-gray-200 placeholder:text-gray-400 rounded-md
@error('replyState.body') border-red-500 @enderror" @error('replyState.body') border-red-500 @enderror"
placeholder="Write something" wire:model.defer="replyState.body"></textarea> placeholder="Write something" wire:model.defer="replyState.body"></textarea>
@error('replyState.body') @error('replyState.body')

View File

@@ -1,8 +1,8 @@
<section> <section>
<div class="bg-white shadow sm:rounded-lg sm:overflow-hidden"> <div class="bg-white dark:bg-neutral-800 shadow sm:rounded-lg sm:overflow-hidden">
<div class="divide-y divide-gray-200"> <div class="divide-y divide-gray-200 dark:divide-gray-400/40">
<div class="px-4 py-5 sm:px-6"> <div class="px-4 py-5 sm:px-6">
<h2 class="text-lg font-medium text-gray-900">Comments</h2> <h2 class="text-lg font-medium text-gray-900 dark:text-gray-200">Comments</h2>
</div> </div>
<div class="px-4 py-6 sm:px-6"> <div class="px-4 py-6 sm:px-6">
<div class="space-y-8"> <div class="space-y-8">
@@ -12,12 +12,12 @@
@endforeach @endforeach
{{ $comments->links() }} {{ $comments->links() }}
@else @else
<p>No comments yet.</p> <p class="text-gray-900 dark:text-gray-200">No comments yet.</p>
@endif @endif
</div> </div>
</div> </div>
</div> </div>
<div class="bg-gray-50 px-4 py-6 sm:px-6"> <div class="bg-gray-50 dark:bg-neutral-800 px-4 py-6 sm:px-6">
@auth @auth
<div class="flex"> <div class="flex">
<div class="flex-shrink-0 mr-4"> <div class="flex-shrink-0 mr-4">
@@ -28,7 +28,7 @@
<div> <div>
<label for="comment" class="sr-only">Comment body</label> <label for="comment" class="sr-only">Comment body</label>
<textarea id="comment" name="comment" rows="3" <textarea id="comment" name="comment" rows="3"
class="shadow-sm block w-full focus:ring-rose-500 focus:border-rose-500 border-gray-300 rounded-md class="bg-white dark:bg-neutral-700 shadow-sm block w-full focus:ring-rose-500 focus:border-rose-500 border-gray-300 dark:border-gray-400/40 text-gray-900 dark:text-gray-200 placeholder:text-gray-400 rounded-md
@error('newCommentState.body') border-red-500 @enderror" @error('newCommentState.body') border-red-500 @enderror"
placeholder="Write something" wire:model.defer="newCommentState.body"></textarea> placeholder="Write something" wire:model.defer="newCommentState.body"></textarea>
@error('newCommentState.body') @error('newCommentState.body')
@@ -37,7 +37,7 @@
</div> </div>
<div class="mt-3 flex items-center justify-between"> <div class="mt-3 flex items-center justify-between">
<button type="submit" <button type="submit"
class="inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md shadow-sm text-white bg-rose-600 hover:bg-rose-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-rose-500"> class="inline-flex items-center justify-center px-4 py-2 border border-transparent font-medium rounded-md shadow-sm text-white bg-rose-600 hover:bg-rose-700 focus:outline-none focus:ring-2 focus:ring-rose-500">
Comment Comment
</button> </button>
</div> </div>
@@ -47,7 +47,7 @@
@endauth @endauth
@guest @guest
<p>Log in to comment.</p> <p class="text-gray-900 dark:text-gray-200">Log in to comment.</p>
@endguest @endguest
</div> </div>
</div> </div>