Skip to content

Commit

Permalink
🎨 Make the Alert component anonymous (#3173)
Browse files Browse the repository at this point in the history
  • Loading branch information
Log1x authored Jan 5, 2024
2 parents 6f46605 + 5b07f46 commit f57d9aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 58 deletions.
57 changes: 0 additions & 57 deletions app/View/Components/Alert.php

This file was deleted.

14 changes: 13 additions & 1 deletion resources/views/components/alert.blade.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
<div {{ $attributes->merge(['class' => $type]) }}>
@props([
'type' => null,
'message' => null,
])

@php($class = match ($type) {
'success' => 'text-green-50 bg-green-400',
'caution' => 'text-yellow-50 bg-yellow-400',
'warning' => 'text-red-50 bg-red-400',
default => 'text-indigo-50 bg-indigo-400',
})

<div {{ $attributes->merge(['class' => "px-2 py-1 {$class}"]) }}>
{!! $message ?? $slot !!}
</div>

0 comments on commit f57d9aa

Please sign in to comment.