Skip to content

Commit

Permalink
Accept slot in dynamic component
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardogobbosouza committed Nov 1, 2022
1 parent fde03ac commit a67ae71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions resources/views/components/states/display.blade.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<div {{ $attributes->mergeThemeProvider($themeProvider, 'container') }}>
@if (is_array($value) && $component = target_get($value, 'component'))
<x-dynamic-component
{{ $attributes->merge(Arr::except($value, 'component')) }}
{{ $attributes->merge(Arr::except($value, ['component', 'slot'])) }}
:component="$component"
/>
>
{!! target_get($value, 'slot', $slot) !!}
</x-dynamic-component>
@elseif (Str::endsWith($value, ['.jpg', '.jpeg', '.gif', '.png']))
<img {{ $attributes->mergeOnlyThemeProvider($themeProvider, 'img') }} src="{{ $value }}" />
@elseif (Str::endsWith($value, '.mp3'))
Expand Down

0 comments on commit a67ae71

Please sign in to comment.