Skip to content

Commit

Permalink
Merge pull request #9 from pemudakoding/main
Browse files Browse the repository at this point in the history
fix: alert box classes isn't match with filament classes
  • Loading branch information
pemudakoding authored Mar 10, 2023
2 parents 86c186c + f413d94 commit ae2404a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 16 deletions.
16 changes: 8 additions & 8 deletions resources/views/components/base-alert-box.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
@php
$backgroundClass = match($type) {
'primary' => 'bg-primary-300',
'success' => 'bg-success-300',
'warning' => 'bg-warning-300',
'danger' => 'bg-danger-400',
'secondary' => 'bg-slate-300',
'primary' => 'bg-primary-500',
'success' => 'bg-success-500',
'warning' => 'bg-warning-500',
'danger' => 'bg-danger-500',
'secondary' => 'bg-gray-500',
};
$textColor = match($type) {
'primary',
'success',
'warning' => 'text-slate-700',
default => 'text-slate-50'
'warning' => 'text-gray-900',
default => 'text-gray-50'
};
@endphp
Expand All @@ -30,7 +30,7 @@
}}
>
@if ($icon = $icon)
<div class="icon mr-5">
<div class="icon px-3 mr-2">
<x-dynamic-component :component="$icon" class="w-10 h-10" />
</div>
@endif
Expand Down
8 changes: 4 additions & 4 deletions tests/Livewire/Forms/AlertBoxBackgroundColorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
];

livewire(name: CreatePost::class)
->assertSee(values: baseClassWith(backgroundColor: 'bg-success-300', textColor: 'text-slate-700'));
->assertSee(values: baseClassWith(backgroundColor: 'bg-success-500', textColor: 'text-gray-900'));
});

it(description: 'can show success background color when type is warning')
Expand All @@ -27,7 +27,7 @@
];

livewire(name: CreatePost::class)
->assertSee(values: baseClassWith(backgroundColor: 'bg-warning-300', textColor: 'text-slate-700'));
->assertSee(values: baseClassWith(backgroundColor: 'bg-warning-500', textColor: 'text-gray-900'));
});

it(description: 'can show success background color when type is primary')
Expand All @@ -39,7 +39,7 @@
];

livewire(name: CreatePost::class)
->assertSee(values: baseClassWith(backgroundColor: 'bg-primary-300', textColor: 'text-slate-700'));
->assertSee(values: baseClassWith(backgroundColor: 'bg-primary-500', textColor: 'text-gray-900'));
});

it(description: 'can show success background color when type is danger')
Expand All @@ -51,5 +51,5 @@
];

livewire(name: CreatePost::class)
->assertSee(values: baseClassWith(backgroundColor: 'bg-danger-400', textColor: 'text-slate-50'));
->assertSee(values: baseClassWith(backgroundColor: 'bg-danger-500', textColor: 'text-gray-50'));
});
4 changes: 2 additions & 2 deletions tests/Livewire/Forms/AlertBoxIconTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
];

livewire(name: CreatePost::class)
->assertSee(values: 'icon mr-5');
->assertSee(values: 'icon px-3 mr-2');
});

it(description: 'can show the icon if resolve the icon manually')
Expand All @@ -24,5 +24,5 @@
];

livewire(name: CreatePost::class)
->assertSee(values: 'icon mr-5');
->assertSee(values: 'icon px-3 mr-2');
});
4 changes: 2 additions & 2 deletions tests/Livewire/Widget/WidgetOkTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
it(description: 'can render element')
->tap(callable: function () {
livewire(name: WidgetTestComponent::class)->assertOk()
->assertSee(values: ['Test', 'please shut u freakin mouth', 'icon mr-5'])
->assertSee(values: baseClassWith(backgroundColor: 'bg-success-300', textColor: 'text-slate-700'));
->assertSee(values: ['Test', 'please shut u freakin mouth', 'icon px-3 mr-2'])
->assertSee(values: baseClassWith(backgroundColor: 'bg-success-500', textColor: 'text-gray-900'));
})
->group('widget');

0 comments on commit ae2404a

Please sign in to comment.