Skip to content

Commit

Permalink
fix: 2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Jan 8, 2024
1 parent 90fecf8 commit 61906b2
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
7 changes: 4 additions & 3 deletions resources/views/components/icon.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
'icon' => '',
'size' => 5,
'color',
'class' => ''
'class' => $attributes->get('class')
])

@includeWhen($icon, "moonshine::ui.icons.$icon", array_merge([
'size' => $size,
'class' => $class
], isset($color) ? ['color' => $color] : []))
'class' => $class,
'color' => $color
]))
20 changes: 20 additions & 0 deletions src/Components/Alert.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

declare(strict_types=1);

namespace MoonShine\Components;


/** @method static static make(string $icon = 'heroicons.bell-alert', string $type = 'default', bool $removable = false) */
final class Alert extends MoonShineComponent
{
protected string $view = 'moonshine::components.alert';

public function __construct(
public string $icon = 'heroicons.bell-alert',
public string $type = 'default',
public bool $removable = false,
)
{
}
}
3 changes: 1 addition & 2 deletions src/Components/Icon.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace MoonShine\Components;

/** @method static static make(string $icon, int $size = 5, string $color = '', string $class = '') */
/** @method static static make(string $icon, int $size = 5, string $color = '') */
final class Icon extends MoonShineComponent
{
protected string $view = 'moonshine::components.icon';
Expand All @@ -13,7 +13,6 @@ public function __construct(
public string $icon,
public int $size = 5,
public string $color = '',
public string $class = '',
) {
}
}
2 changes: 1 addition & 1 deletion src/Providers/MoonShineServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ protected function registerBindings(): self
{
$this->app->singleton(MoonShine::class);

$this->app->singleton(
$this->app->{app()->runningUnitTests() ? 'bind' : 'singleton'}(
MoonShineRequest::class,
fn ($app): MoonShineRequest => MoonShineRequest::createFrom($app['request'])
);
Expand Down

0 comments on commit 61906b2

Please sign in to comment.