Skip to content

Commit

Permalink
Merge pull request #520 from awcodes/svg-column
Browse files Browse the repository at this point in the history
support svg preview in curator column
  • Loading branch information
awcodes authored Aug 7, 2024
2 parents 8d25044 + 5aceef2 commit 2154887
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions resources/views/components/tables/curator-column.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,22 @@
{!! $width !== null ? "width: {$width};" : null !!}
"
@class([
'h-full w-auto' => str($item->type)->contains('svg'),
'max-w-none' => $height && ! $width,
'object-cover object-center' => ! str($item->type)->contains('svg') && ($isRounded() || $width || $height)
'object-cover object-center' => ($isRounded() || $width || $height)
])
{{ $getExtraImgAttributeBag() }}
/>
@elseif (str($item->type)->contains('svg'))
<img
src="{{ Storage::url($item->path) }}"
alt="{{ $item->alt }}"
style="
{!! $height !== null ? "height: {$height};" : "height: 2rem;" !!}
{!! $width !== null ? "width: {$width};" : null !!}
"
class="h-full w-auto"
{{ $getExtraImgAttributeBag() }}
/>
@else
<x-curator::document-image
:label="$item->name"
Expand Down

0 comments on commit 2154887

Please sign in to comment.