Skip to content

Commit

Permalink
Fix styling
Browse files Browse the repository at this point in the history
  • Loading branch information
199ocero authored and github-actions[bot] committed Jan 2, 2024
1 parent 44b01b3 commit 20d7afb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 25 deletions.
1 change: 0 additions & 1 deletion src/ActivityTimelineServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
use Filament\Support\Assets\Js;
use Filament\Support\Facades\FilamentAsset;
use Filament\Support\Facades\FilamentIcon;
use Livewire\Features\SupportTesting\Testable;
use Spatie\LaravelPackageTools\Commands\InstallCommand;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
Expand Down
10 changes: 5 additions & 5 deletions src/Components/ActivityBadge.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace JaOcero\ActivityTimeline\Components;

use Closure;
use Filament\Infolists\Components\Concerns\HasColor;
use Filament\Infolists\Components\Concerns\HasIcon;
use Filament\Infolists\Components\Entry;
use JaOcero\ActivityTimeline\Enums\BadgeSize;
use Filament\Infolists\Components\Concerns\HasIcon;
use Filament\Infolists\Components\Concerns\HasColor;

class ActivityBadge extends Entry
{
Expand All @@ -17,16 +17,16 @@ class ActivityBadge extends Entry

protected string $view = 'activity-timeline::infolists.components.activity-badge';

protected BadgeSize | string | Closure | null $size = null;
protected BadgeSize|string|Closure|null $size = null;

public function size(BadgeSize | string | Closure | null $size): static
public function size(BadgeSize|string|Closure|null $size): static
{
$this->size = $size;

return $this;
}

public function getSize(mixed $state): BadgeSize | string | null
public function getSize(mixed $state): BadgeSize|string|null
{
return $this->evaluate($this->size, [
'state' => $state,
Expand Down
10 changes: 6 additions & 4 deletions src/Components/ActivityDate.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace JaOcero\ActivityTimeline\Components;

use Illuminate\Support\Carbon;
use Filament\Infolists\Components\Entry;
use Illuminate\Support\Carbon;

class ActivityDate extends Entry
{
Expand All @@ -12,10 +12,12 @@ class ActivityDate extends Entry
protected string $view = 'activity-timeline::infolists.components.activity-date';

protected ?string $date = null;
protected string | null $dateFormat = null;
protected string | null $dateTimezone = null;

public function date(string | null $format = null, string | null $timezone = null): static
protected ?string $dateFormat = null;

protected ?string $dateTimezone = null;

public function date(?string $format = null, ?string $timezone = null): static
{

$this->dateFormat = $format;
Expand Down
33 changes: 18 additions & 15 deletions src/Components/ActivitySection.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,31 @@
namespace JaOcero\ActivityTimeline\Components;

use Closure;
use Illuminate\Database\Eloquent\Model;
use Filament\Infolists\Components\Entry;
use Filament\Infolists\ComponentContainer;
use Filament\Infolists\Components\Entry;
use Illuminate\Database\Eloquent\Model;
use JaOcero\ActivityTimeline\Enums\Direction;

class ActivitySection extends Entry
{
protected string $view = 'activity-timeline::infolists.components.activity-section';

protected string | Closure | null $description = null;
protected Direction | string $direction = Direction::Vertical;
protected bool | Closure | null $isAside = null;
protected array | int | null $horizontalItems = null;
protected string|Closure|null $description = null;

protected Direction|string $direction = Direction::Vertical;

protected bool|Closure|null $isAside = null;

protected array|int|null $horizontalItems = null;

public function description(string | Closure | null $description = null): static
public function description(string|Closure|null $description = null): static
{
$this->description = $description;

return $this;
}

public function direction(Direction | string $direction = Direction::Vertical): static
public function direction(Direction|string $direction = Direction::Vertical): static
{
if (in_array($direction, [Direction::Horizontal, Direction::Vertical])) {
$this->direction = $direction;
Expand All @@ -35,18 +38,18 @@ public function direction(Direction | string $direction = Direction::Vertical):
return $this;
}

public function aside(bool | Closure | null $condition = true): static
public function aside(bool|Closure|null $condition = true): static
{
$this->isAside = $condition;

return $this;
}

public function horizontalItems(array | int | null $items = 3): static
public function horizontalItems(array|int|null $items = 3): static
{
if (!is_array($items)) {
if (! is_array($items)) {
if ($items === 0 || $items === 1) {
throw new \InvalidArgumentException("Invalid value provided for horizontal items. Please use a value other than 0 or 1.");
throw new \InvalidArgumentException('Invalid value provided for horizontal items. Please use a value other than 0 or 1.');
}
$this->horizontalItems = ['lg' => $items];
} else {
Expand All @@ -66,12 +69,12 @@ public function getDescription(): string
return $this->evaluate($this->description);
}

public function getDirection(): Direction | string
public function getDirection(): Direction|string
{
return $this->evaluate($this->direction);
}

public function getHorizontalItems(?string $breakpoint = null): int | null
public function getHorizontalItems(?string $breakpoint = null): ?int
{
return $this->evaluate($this->horizontalItems[$breakpoint] ?? null);
}
Expand All @@ -81,7 +84,7 @@ public function getHorizontalItems(?string $breakpoint = null): int | null
*/
public function getChildComponentContainers(bool $withHidden = false): array
{
if ((!$withHidden) && $this->isHidden()) {
if ((! $withHidden) && $this->isHidden()) {
return [];
}

Expand Down

0 comments on commit 20d7afb

Please sign in to comment.