generated from filamentphp/plugin-skeleton
-
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from mansoorkhan96/add-setting-to-enable/disabl…
…e-square-display Add setting to enable/disable square display
- Loading branch information
Showing
11 changed files
with
147 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
<div> | ||
<div | ||
class="mb-4" | ||
x-load-css="[@js(\Filament\Support\Facades\FilamentAsset::getStyleHref('unsplash-picker', 'mansoor/unsplash-picker'))]" | ||
> | ||
{{ $this->form }} | ||
</div> | ||
|
||
<div> | ||
@if (blank($search)) | ||
<p class="text-center">{{ __('unsplash-picker::unsplash-picker.empty_search') }}</p> | ||
@else | ||
<div @class([ | ||
'grid grid-cols-3 lg:grid-cols-4 gap-4' => | ||
filled($this->getImages) && $this->shouldUseSquareDisplay, | ||
'columns-3 space-y-4 lg:columns-4' => | ||
filled($this->getImages) && !$this->shouldUseSquareDisplay, | ||
])> | ||
@forelse ($this->getImages as $item) | ||
<div | ||
x-data="{ picked: false }" | ||
class="group relative w-full cursor-pointer overflow-hidden rounded-lg ring-gray-950/10 hover:ring-2 hover:ring-primary-600 hover:ring-offset-2 dark:ring-white/20 dark:hover:ring-primary-500 dark:hover:ring-offset-black" | ||
> | ||
<span @click="picked = true; $wire.$parent.callMountedFormComponentAction(@js($item))"> | ||
<img | ||
@class([ | ||
'aspect-square' => $this->shouldUseSquareDisplay, | ||
'pointer-events-none w-full object-cover', | ||
]) | ||
src="{{ $item['urls']['thumb'] }}" | ||
> | ||
</span> | ||
|
||
<div | ||
x-show="picked" | ||
x-cloak | ||
class="absolute inset-0 flex h-full w-full flex-col items-center justify-center bg-gray-900 bg-opacity-60" | ||
> | ||
<x-icons.spinner class="h-8 w-8 animate-spin text-white" /> | ||
</div> | ||
|
||
<div | ||
class="absolute bottom-0 hidden w-full items-center justify-center bg-black opacity-80 group-hover:flex"> | ||
<a | ||
href="{{ $item['user']['links']['html'] }}?utm_source=goldencarers&utm_medium=referral&utm_campaign=api-credit" | ||
target="_blank" | ||
class="text-xs text-white underline" | ||
> | ||
{{ str($item['user']['name'])->limit(20) }} | ||
</a> | ||
</div> | ||
</div> | ||
@empty | ||
<div class="col-span-full text-center"> | ||
<p>{{ __('unsplash-picker::unsplash-picker.no_results') }}</p> | ||
<p>{{ __('unsplash-picker::unsplash-picker.try_again') }}</p> | ||
</div> | ||
@endforelse | ||
</div> | ||
@endif | ||
|
||
@if (filled($search) && count($this->getImages) > 0) | ||
<div class="mt-6 flex justify-between"> | ||
{{ $this->previousPageAction }} | ||
{{ $this->nextPageAction }} | ||
</div> | ||
@endif | ||
</div> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1 @@ | ||
<div> | ||
<div | ||
class="mb-4" | ||
x-load-css="[@js(\Filament\Support\Facades\FilamentAsset::getStyleHref('unsplash-picker', 'mansoor/unsplash-picker'))]" | ||
> | ||
{{ $this->form }} | ||
</div> | ||
|
||
<div> | ||
@if (blank($search)) | ||
<p class="text-center">{{ __('unsplash-picker::unsplash-picker.empty_search') }}</p> | ||
@else | ||
<div @class([ | ||
'columns-3 space-y-4 lg:columns-4' => filled($this->getImages), | ||
])> | ||
@forelse ($this->getImages as $item) | ||
<div | ||
x-data="{ picked: false }" | ||
class="group relative w-full cursor-pointer overflow-hidden rounded-lg ring-gray-950/10 hover:ring-2 hover:ring-primary-600 hover:ring-offset-2 dark:ring-white/20 dark:hover:ring-primary-500 dark:hover:ring-offset-black" | ||
> | ||
<span @click="picked = true; $wire.$parent.callMountedFormComponentAction(@js($item))"> | ||
<img | ||
class="pointer-events-none w-full object-cover" | ||
src="{{ $item['urls']['thumb'] }}" | ||
> | ||
</span> | ||
|
||
<div | ||
x-show="picked" | ||
x-cloak | ||
class="absolute inset-0 flex h-full w-full flex-col items-center justify-center bg-gray-900 bg-opacity-60" | ||
> | ||
<x-icons.spinner class="h-8 w-8 animate-spin text-white" /> | ||
</div> | ||
|
||
<div | ||
class="absolute bottom-0 hidden w-full items-center justify-center bg-black opacity-80 group-hover:flex"> | ||
<a | ||
href="{{ $item['user']['links']['html'] }}?utm_source=goldencarers&utm_medium=referral&utm_campaign=api-credit" | ||
target="_blank" | ||
class="text-xs text-white underline" | ||
> | ||
{{ str($item['user']['name'])->limit(20) }} | ||
</a> | ||
</div> | ||
</div> | ||
@empty | ||
<div class="col-span-full text-center"> | ||
<p>{{ __('unsplash-picker::unsplash-picker.no_results') }}</p> | ||
<p>{{ __('unsplash-picker::unsplash-picker.try_again') }}</p> | ||
</div> | ||
@endforelse | ||
</div> | ||
@endif | ||
|
||
@if (filled($search) && count($this->getImages) > 0) | ||
<div class="mt-6 flex justify-between"> | ||
{{ $this->previousPageAction }} | ||
{{ $this->nextPageAction }} | ||
</div> | ||
@endif | ||
</div> | ||
</div> | ||
@livewire('unsplash-picker-component', $options) |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters