Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
static accordions convert to view component
- Loading branch information
Showing
9 changed files
with
92 additions
and
179 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
34 changes: 10 additions & 24 deletions
34
resources/views/components/transactions/show/attachment.blade.php
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,30 +1,16 @@ | ||
@if ($attachment) | ||
<div class="border-b border-gray-200 pb-4" | ||
x-data="{ attachment : null }" | ||
> | ||
<div class="relative w-full ltr:text-left rtl:text-right cursor-pointer group" | ||
x-on:click="attachment !== 1 ? attachment = 1 : attachment = null" | ||
> | ||
<span class="font-medium"> | ||
<x-button.hover group-hover> | ||
{{ trans_choice('general.attachments', 2) }} | ||
</x-button.hover> | ||
</span> | ||
<x-show.accordion type="attachment"> | ||
<x-slot name="head"> | ||
<x-show.accordion.head | ||
title="{{ trans_choice('general.attachments', 2) }}" | ||
description="{{ trans('transactions.slider.attachments') }}" | ||
/> | ||
</x-slot> | ||
|
||
<div class="text-black-400 text-sm flex gap-x-1 mt-1"> | ||
{{ trans('transactions.slider.attachments') }} | ||
</div> | ||
|
||
<span class="material-icons absolute ltr:right-0 rtl:left-0 top-0 transition-all transform" x-bind:class="attachment === 1 ? 'rotate-180' : ''">expand_more</span> | ||
</div> | ||
|
||
<div class="overflow-hidden transition-transform origin-top-left ease-linear duration-100" | ||
x-ref="container1" | ||
x-bind:class="attachment == 1 ? 'h-auto ' : 'scale-y-0 h-0'" | ||
> | ||
<x-slot name="body"> | ||
@foreach ($attachment as $file) | ||
<x-media.file :file="$file" /> | ||
@endforeach | ||
</div> | ||
</div> | ||
</x-slot> | ||
</x-show.accordion> | ||
@endif |
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
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
30 changes: 10 additions & 20 deletions
30
resources/views/components/transfers/show/attachment.blade.php
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,26 +1,16 @@ | ||
@if ($transfer->attachment) | ||
<div class="border-b border-gray-200 pb-4" x-data="{ attachment : null }"> | ||
<div class="relative w-full text-left cursor-pointer group" x-on:click="attachment !== 1 ? attachment = 1 : attachment = null"> | ||
<span class="font-medium"> | ||
<x-button.hover group-hover> | ||
{{ trans_choice('general.attachments', 2) }} | ||
</x-button.hover> | ||
</span> | ||
<x-show.accordion type="attachment"> | ||
<x-slot name="head"> | ||
<x-show.accordion.head | ||
title="{{ trans_choice('general.attachments', 2) }}" | ||
description="{{ trans('transfers.slider.attachments') }}" | ||
/> | ||
</x-slot> | ||
|
||
<div class="text-black-400 text-sm"> | ||
{{ trans('transers.slider.attachments') }} | ||
</div> | ||
|
||
<span class="material-icons absolute ltr:right-0 rtl:left-0 top-0 transition-all transform" x-bind:class="attachment === 1 ? 'rotate-180' : ''">expand_more</span> | ||
</div> | ||
|
||
<div class="overflow-hidden transition-transform origin-top-left ease-linear duration-100" | ||
x-ref="container1" | ||
x-bind:class="attachment == 1 ? 'h-auto ' : 'scale-y-0 h-0'" | ||
> | ||
<x-slot name="body"> | ||
@foreach ($transfer->attachment as $file) | ||
<x-media.file :file="$file" /> | ||
@endforeach | ||
</div> | ||
</div> | ||
</x-slot> | ||
</x-show.accordion> | ||
@endif |
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
33 changes: 12 additions & 21 deletions
33
resources/views/components/transfers/show/transactions.blade.php
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,33 +1,24 @@ | ||
@php | ||
$link_class = 'to-black-400 hover:bg-full-2 bg-no-repeat bg-0-2 bg-0-full bg-gradient-to-b from-transparent transition-backgroundSize'; | ||
$expense_number = '<x-link href="' . route('transactions.show', $transfer->expense_transaction->id) . '" class="' . $link_class . '" override="class">' . $transfer->expense_transaction->number . '</x-link>'; | ||
$income_number = '<x-link href="' . route('transactions.show', $transfer->income_transaction->id) . '" class="' . $link_class . '" override="class">' . $transfer->income_transaction->number . '</x-link>'; | ||
$expense_number = '<a href="' . route('transactions.show', $transfer->expense_transaction->id) . '" class="' . $link_class . '" override="class">' . $transfer->expense_transaction->number . '</a>'; | ||
$income_number = '<a href="' . route('transactions.show', $transfer->income_transaction->id) . '" class="' . $link_class . '" override="class">' . $transfer->income_transaction->number . '</a>'; | ||
@endphp | ||
|
||
<div class="border-b pb-4" x-data="{ transactions : null }"> | ||
<button class="relative w-full text-left group" x-on:click="transactions !== 1 ? transactions = 1 : transactions = null"> | ||
<span class="font-medium border-b border-transparent transition-all group-hover:border-black"> | ||
{{ trans_choice('general.transactions', 2) }} | ||
</span> | ||
<x-show.accordion type="transactions"> | ||
<x-slot name="head"> | ||
<x-show.accordion.head | ||
title="{{ trans_choice('general.transactions', 2) }}" | ||
description="{!! trans('transfers.slider.transactions', ['user' => $transfer->owner->name]) !!}" | ||
/> | ||
</x-slot> | ||
|
||
<div class="text-black-400 text-sm"> | ||
{!! trans('transfers.slider.transactions', ['user' => $transfer->owner->name]) !!} | ||
</div> | ||
|
||
<span class="material-icons absolute ltr:right-0 rtl:left-0 top-0 transition-all transform" x-bind:class="transactions === 1 ? 'rotate-180' : ''">expand_more</span> | ||
</button> | ||
|
||
<div | ||
class="overflow-hidden transition-transform origin-top-left ease-linear duration-100" | ||
x-ref="container1" | ||
x-bind:class="transactions === 1 ? 'h-auto' : 'scale-y-0 h-0'" | ||
> | ||
<x-slot name="body"> | ||
<div class="my-2"> | ||
{!! trans('transfers.slider.transactions_desc', ['number' => $expense_number, 'account' => $transfer->expense_account->title]) !!} | ||
</div> | ||
|
||
<div class="my-2"> | ||
{!! trans('transfers.slider.transactions_desc', ['number' => $income_number, 'account' => $transfer->income_account->title]) !!} | ||
</div> | ||
</div> | ||
</div> | ||
</x-slot> | ||
</x-show.accordion> |