Skip to content

Commit dfde89c

Browse files
committed
feat: better slot handling
feat: material-26 modal
1 parent 9f35cd6 commit dfde89c

File tree

2 files changed

+37
-7
lines changed

2 files changed

+37
-7
lines changed
Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1-
<div class="modal" tabindex="-1" id="{{ $attributes->get('id') ?: $id() }}">
1+
<div
2+
{{ $attributes->merge(['class' => 'modal fade', 'tabindex' => -1]) }}
3+
id="{{ $attributes->get('id') ?: $id() }}"
4+
>
25
<div class="modal-dialog {{ $modalSizeClass ?? 'modal-lg' }}">
36
<div class="modal-content">
47
<div class="modal-header">
5-
<h5 class="modal-title">
6-
{{ $title ?? '' }}
7-
</h5>
8+
@if($title)
9+
<h5 class="modal-title">
10+
{{ $title }}
11+
</h5>
12+
@endif
813

914
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
1015
</div>
@@ -13,9 +18,11 @@
1318
{{ $slot }}
1419
</div>
1520

16-
<div class="modal-footer">
17-
{{ $footer ?? '' }}
18-
</div>
21+
@if($footer)
22+
<div class="modal-footer">
23+
{{ $footer }}
24+
</div>
25+
@endif
1926
</div>
2027
</div>
2128
</div>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@props(['title' => ''])
2+
3+
<div {{ $attributes->merge(['class' => 'modal fade', 'tabindex' => -1]) }}>
4+
<div class="modal-dialog {{ $modalSizeClass ?? 'modal-lg' }}">
5+
<div class="modal-content modal-headed">
6+
@if($title)
7+
<div class="modal-header">
8+
<h5 class="modal-title">{{ $title }}</h5>
9+
</div>
10+
@endif
11+
12+
<div class="modal-body">
13+
{{ $slot }}
14+
</div>
15+
16+
@isset($footer)
17+
<div class="modal-footer px-4 pb-4">
18+
{{ $footer }}
19+
</div>
20+
@endisset
21+
</div>
22+
</div>
23+
</div>

0 commit comments

Comments
 (0)