From ca6edb507fd9efcc9e446a90135849ed908c01ab Mon Sep 17 00:00:00 2001 From: raccoon254 Date: Sun, 19 May 2024 17:02:33 +0300 Subject: [PATCH] Fixed send message and attachments creation input --- app/Models/User.php | 3 -- resources/css/app.css | 2 +- .../livewire/send-message-input.blade.php | 52 ++++++++++--------- resources/views/messages.blade.php | 32 ++++++++---- 4 files changed, 51 insertions(+), 38 deletions(-) diff --git a/app/Models/User.php b/app/Models/User.php index 94c4cd3..c9a3ae8 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -44,9 +44,6 @@ public function referrals(): HasMany return $this->hasMany(Referral::class, 'referrer_id'); } - //https://api.dicebear.com/8.x/pixel-art/svg?seed={{md5($this->email)}} - // https://mighty.tools/mockmind-api/content/cartoon/' . $this->id. '.jpg - public function getAvatarAttribute(): string { return 'https://api.dicebear.com/8.x/avataaars/svg?seed=' . $this->name; diff --git a/resources/css/app.css b/resources/css/app.css index 2937141..ff6b1a2 100644 --- a/resources/css/app.css +++ b/resources/css/app.css @@ -57,5 +57,5 @@ input:-webkit-autofill { } .message-input{ - @apply w-full rounded-md px-12 border-2 border-gray-300 p-3 ring-1 ring-gray-300 ring-offset-1 transition-all duration-300 ease-in-out focus:border-blue-300 focus:outline-none bg-gray-200 text-gray-800; + @apply w-full rounded-md px-4 border border-gray-300 p-3 transition-all duration-300 ease-in-out text-gray-800; } diff --git a/resources/views/livewire/send-message-input.blade.php b/resources/views/livewire/send-message-input.blade.php index e9bdfea..8f476c9 100644 --- a/resources/views/livewire/send-message-input.blade.php +++ b/resources/views/livewire/send-message-input.blade.php @@ -1,26 +1,29 @@ -
+
@if (count($attachments) > 0) -
+
@foreach($attachments as $attachment) -
- @if (in_array($attachment->getMimeType(), ['image/jpeg', 'image/png'])) - Attachment - @elseif ($attachment->getMimeType() == 'image/svg+xml') - - @elseif ($attachment->getMimeType() == 'application/zip') - - @else - - @endif - - - {{ substr($attachment->getClientOriginalName(), 0, 5) }}{{ strlen($attachment->getClientOriginalName()) > 5 ? '...' : '' }} - +
+
+ @if (in_array($attachment->getMimeType(), ['image/jpeg', 'image/png'])) + Attachment + @elseif ($attachment->getMimeType() == 'image/svg+xml') + + @elseif ($attachment->getMimeType() == 'application/zip') + + @else + + @endif +
+ + + {{ substr($attachment->getClientOriginalName(), 0, 6) }}{{ strlen($attachment->getClientOriginalName()) > 5 ? '...' : '' }} + +
@endforeach @@ -31,25 +34,26 @@ class="absolute btn-warning btn btn-xs btn-circle top-0 right-1 text-red-500 hov @error('attachments.*') {{ $message }} @enderror @error('newMessage') {{ $message }} @enderror
-
+
- + +