Skip to content

Commit ce0b457

Browse files
Merge pull request #59 from dissto/fix-issues-51
fix: Undefinded variable `$getColor`
2 parents 69af8bf + 36eea2a commit ce0b457

File tree

1 file changed

+44
-24
lines changed

1 file changed

+44
-24
lines changed
Lines changed: 44 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,87 @@
1+
@props([
2+
'color' => 'gray',
3+
'border' => false,
4+
'icon' => null,
5+
'iconAnimation' => null,
6+
'iconVerticalAlignment' => 'center',
7+
'title' => null,
8+
'description' => null,
9+
'actions' => null,
10+
'actionsVerticalAlignment' => 'center',
11+
])
12+
113
@php
214
use function Filament\Support\get_color_css_variables;
315
16+
$color = value($getColor ?? $color);
17+
$border = value($getBorder ?? $border);
18+
$icon = value($getIcon ?? $icon);
19+
$iconAnimation = value($getIconAnimation ?? $iconAnimation);
20+
$iconVerticalAlignment = value($getIconVerticalAlignment ?? $iconVerticalAlignment);
21+
$title = value($getTitle ?? $title);
22+
$description = value($getDescription ?? $description);
23+
$actions = value($getActions ?? $actions);
24+
$actionsVerticalAlignment = value($getActionsVerticalAlignment ?? $actionsVerticalAlignment);
25+
426
$colors = \Illuminate\Support\Arr::toCssStyles([
5-
get_color_css_variables($getColor(), shades: [50, 100, 400, 500, 700, 800]),
27+
get_color_css_variables($color, shades: [50, 100, 400, 500, 700, 800]),
628
]);
729
830
$iconClasses = \Illuminate\Support\Arr::toCssClasses([
931
'h-5 w-5 text-custom-400',
10-
$getIconAnimation(),
32+
$iconAnimation,
1133
]);
1234
@endphp
1335

1436
<div x-data="{}"
1537
{{ $attributes->class([
1638
'filament-simple-alert rounded-md bg-custom-50 p-4 dark:bg-custom-400/10',
17-
'ring-1 ring-custom-100 dark:ring-custom-500/70' => $getBorder(),
39+
'ring-1 ring-custom-100 dark:ring-custom-500/70' => $border,
1840
]) }}
1941
style="{{ $colors }}">
2042
<div class="flex gap-3">
21-
@if($getIcon())
43+
@if($icon)
2244
<div @class([
2345
'flex-shrink-0',
24-
$getIconVerticalAlignment() === 'start' ? 'self-start' : 'self-center',
46+
$iconVerticalAlignment === 'start' ? 'self-start' : 'self-center',
2547
])>
2648
<x-filament::icon
27-
:icon="$getIcon()"
28-
:class="$iconClasses"
49+
:icon="$icon"
50+
:class="$iconClasses"
2951
/>
3052
</div>
3153
@endif
3254
<div class="items-center flex-1 md:flex md:justify-between space-y-3 md:space-y-0 md:gap-3">
33-
@if($getTitle() || $getDescription())
55+
@if($title || $description)
3456
<div class="space-y-0.5">
35-
@if($getTitle())
57+
@if($title)
3658
<p class="text-sm font-medium text-custom-800 dark:text-white">
37-
{{ $getTitle() }}
59+
{{ $title }}
3860
</p>
3961
@endif
40-
@if($getDescription())
62+
@if($description)
4163
<div class="block text-sm text-custom-700 dark:text-white">
42-
{{ $getDescription() }}
64+
{{ $description }}
4365
</div>
4466
@endif
4567
</div>
4668
@endif
47-
@if($getActions())
69+
@if($actions)
4870
<div @class([
4971
'flex items-center gap-3',
50-
$getActionsVerticalAlignment() === 'start' ? 'self-start' : 'self-center',
72+
$actionsVerticalAlignment === 'start' ? 'self-start' : 'self-center',
5173
])>
5274
<div class="flex items-center whitespace-nowrap gap-3">
53-
@if($getActions())
54-
<div class="gap-3 flex items-center justify-start">
55-
@foreach ($getActions() as $action)
56-
@if ($action->isVisible())
57-
{{ $action }}
58-
@endif
59-
@endforeach
60-
</div>
61-
@endif
75+
<div class="gap-3 flex items-center justify-start">
76+
@foreach ($actions as $action)
77+
@if ($action->isVisible())
78+
{{ $action }}
79+
@endif
80+
@endforeach
81+
</div>
6282
</div>
6383
</div>
6484
@endif
6585
</div>
6686
</div>
67-
</div>
87+
</div>

0 commit comments

Comments
 (0)