Skip to content

Commit 00ca907

Browse files
add components
1 parent 152f910 commit 00ca907

File tree

6 files changed

+74
-2
lines changed

6 files changed

+74
-2
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
@props([
2+
'model' => null,
3+
'old' => null,
4+
])
5+
6+
7+
<div class="mb-3">
8+
@if($model instanceof \Livewire\Features\SupportFileUploads\TemporaryUploadedFile)
9+
<audio controls>
10+
<source src="{{ $model->temporaryUrl() }}" type="audio/mpeg">
11+
Your browser does not support the audio element.
12+
</audio>
13+
@elseif($old != null)
14+
<audio controls>
15+
<source src="{{ $old }}" type="audio/mpeg">
16+
Your browser does not support the audio element.
17+
</audio>
18+
@endif
19+
</div>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
@props([
2+
'model' => null,
3+
'old' => null,
4+
'icon' => 'fa-file-pdf',
5+
'label' => 'View PDF',
6+
])
7+
8+
<div class="mb-3">
9+
@if($model instanceof \Livewire\Features\SupportFileUploads\TemporaryUploadedFile)
10+
<a href="{{ $model->temporaryUrl() }}" target="_blank" class="btn btn-primary">
11+
<i class="fa-solid {{ $icon }}"></i> {{ $label }}
12+
</a>
13+
@elseif($old != null)
14+
<a href="{{ $old }}" target="_blank" class="btn btn-primary">
15+
<i class="fa-solid {{ $icon }}"></i> {{ $label }}
16+
</a>
17+
@endif
18+
</div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@props([
2+
'model' => null,
3+
'old' => null,
4+
])
5+
6+
<div class="mb-3">
7+
@if($model instanceof \Livewire\Features\SupportFileUploads\TemporaryUploadedFile)
8+
<img src="{{ $model->temporaryUrl() }}" alt="logo" class="img-fluid">
9+
@elseif($old != null)
10+
<img src="{{ $old }}" alt="logo" class="img-fluid">
11+
@endif
12+
</div>

resources/views/components/cms/livewire/input-file.blade.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
'class' => 'form-control',
44
'imageIttr' => 1,
55
])
6-
<x-acc-upload-progress>
6+
<x-cms.livewire.upload-progress>
77
<input type="file" wire:model="{{ $model }}" class="{{ $class }}" id="{{ $imageIttr }}" {{ $attributes ?? '' }}>
8-
</x-acc-upload-progress>
8+
</x-cms.livewire.upload-progress>
99
<x-acc-input-error for="{{ $model }}" />
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<div x-data="{ uploading: false, progress: 0 }"
2+
x-on:livewire-upload-start="uploading = true"
3+
x-on:livewire-upload-finish="uploading = false"
4+
x-on:livewire-upload-cancel="uploading = false"
5+
x-on:livewire-upload-error="uploading = false"
6+
x-on:livewire-upload-progress="progress = $event.detail.progress">
7+
{{ $slot ?? '' }}
8+
<div x-show="uploading">
9+
<progress max="100" x-bind:value="progress"></progress>
10+
</div>
11+
</div>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
@props([
2+
'model' => null,
3+
'old' => null,
4+
])
5+
6+
<div class="mb-3">
7+
@if($model instanceof \Livewire\Features\SupportFileUploads\TemporaryUploadedFile)
8+
<video src="{{ $model->temporaryUrl() }}" alt="logo" class="img-fluid" controls></video>
9+
@elseif($old !== null)
10+
<video src="{{ $old }}" alt="logo" class="img-fluid" controls></video>
11+
@endif
12+
</div>

0 commit comments

Comments
 (0)