From 4f739e464cd0e2ba29866783b733f28654879dfd Mon Sep 17 00:00:00 2001 From: arduinomaster22 <91618246+arduinomaster22@users.noreply.github.com> Date: Sat, 11 Jan 2025 13:20:22 +0000 Subject: [PATCH] Fix styling --- config/filament-mails.php | 2 +- src/Resources/EventResource.php | 10 +++++----- src/Resources/SuppressionResource.php | 10 ++++------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/config/filament-mails.php b/config/filament-mails.php index 3ef9663..3f21b86 100644 --- a/config/filament-mails.php +++ b/config/filament-mails.php @@ -8,6 +8,6 @@ 'resources' => [ 'mail' => MailResource::class, 'event' => EventResource::class, - 'suppressions' => SuppressionResource::class + 'suppressions' => SuppressionResource::class, ], ]; diff --git a/src/Resources/EventResource.php b/src/Resources/EventResource.php index ebe055d..b640b5c 100644 --- a/src/Resources/EventResource.php +++ b/src/Resources/EventResource.php @@ -73,7 +73,7 @@ public static function infolist(Infolist $infolist): Infolist TextEntry::make('type') ->label(__('Type')) ->badge() - ->color(fn(EventType $state): string => match ($state) { + ->color(fn (EventType $state): string => match ($state) { EventType::DELIVERED => 'success', EventType::CLICKED => 'clicked', EventType::OPENED => 'info', @@ -121,7 +121,7 @@ public static function infolist(Infolist $infolist): Infolist ->default(__('Unknown')) ->label(__('User Agent')) ->limit(50) - ->tooltip(fn($state) => $state), + ->tooltip(fn ($state) => $state), ]), ]), Section::make(__('Location')) @@ -150,7 +150,7 @@ public static function infolist(Infolist $infolist): Infolist ->default(__('Unknown')) ->label(__('Link')) ->limit(50) - ->url(fn($state) => $state) + ->url(fn ($state) => $state) ->openUrlInNewTab(), TextEntry::make('tag') ->default(__('Unknown')) @@ -199,7 +199,7 @@ public static function table(Table $table): Table ->label(__('Type')) ->sortable() ->badge() - ->color(fn(EventType $state): string => match ($state) { + ->color(fn (EventType $state): string => match ($state) { EventType::DELIVERED => 'success', EventType::CLICKED => 'clicked', EventType::OPENED => 'info', @@ -220,7 +220,7 @@ public static function table(Table $table): Table ->label(__('Occurred At')) ->dateTime('d-m-Y H:i') ->since() - ->tooltip(fn(MailEvent $record) => $record->occurred_at->format('d-m-Y H:i')) + ->tooltip(fn (MailEvent $record) => $record->occurred_at->format('d-m-Y H:i')) ->sortable() ->searchable(), ]) diff --git a/src/Resources/SuppressionResource.php b/src/Resources/SuppressionResource.php index 63e7a20..d5ef538 100644 --- a/src/Resources/SuppressionResource.php +++ b/src/Resources/SuppressionResource.php @@ -5,10 +5,8 @@ use Filament\Infolists\Infolist; use Filament\Resources\Resource; use Filament\Tables; -use Filament\Tables\Actions\Action; use Filament\Tables\Table; use Illuminate\Database\Eloquent\Builder; -use Illuminate\Support\Facades\Artisan; use Vormkracht10\FilamentMails\Resources\SuppressionResource\Pages\ListSuppressions; use Vormkracht10\Mails\Enums\EventType; use Vormkracht10\Mails\Models\MailEvent; @@ -79,7 +77,7 @@ public static function table(Table $table): Table ->columns([ Tables\Columns\TextColumn::make('mail.to') ->label(__('Email address')) - ->formatStateUsing(fn(MailEvent $record) => key($record->mail->to)) + ->formatStateUsing(fn (MailEvent $record) => key($record->mail->to)) ->searchable(['to']), Tables\Columns\TextColumn::make('occurred_at') @@ -87,13 +85,13 @@ public static function table(Table $table): Table ->label(__('Suppressed At')) ->dateTime('d-m-Y H:i') ->since() - ->tooltip(fn(MailEvent $record) => $record->occurred_at->format('d-m-Y H:i')) + ->tooltip(fn (MailEvent $record) => $record->occurred_at->format('d-m-Y H:i')) ->sortable() ->searchable(), ]) ->actions([ Tables\Actions\Action::make('unsupress') - ->action(fn(MailEvent $record) => $record->unSuppress()), + ->action(fn (MailEvent $record) => $record->unSuppress()), Tables\Actions\ViewAction::make() ->url(null) @@ -102,7 +100,7 @@ public static function table(Table $table): Table ->label(__('View')) ->hiddenLabel() ->tooltip(__('View')) - ->infolist(fn(Infolist $infolist) => EventResource::infolist($infolist)), + ->infolist(fn (Infolist $infolist) => EventResource::infolist($infolist)), ]); }