Skip to content

Commit

Permalink
Transaction styling and suggestion description set dynamic..
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jun 14, 2022
1 parent 8381af7 commit febf73c
Show file tree
Hide file tree
Showing 5 changed files with 227 additions and 197 deletions.
6 changes: 5 additions & 1 deletion app/Abstracts/View/Components/Transactions/Show.php
Expand Up @@ -299,6 +299,9 @@ abstract class Show extends Component
/** @var bool */
public $hideRecurringMessage;

/** @var bool */
public $hideCreated;

/**
* Create a new component instance.
*
Expand Down Expand Up @@ -327,7 +330,7 @@ public function __construct(
string $routeDocumentShow = '', string $routeTransactionShow = '', string $textButtonAddNew = '',

bool $hideSchedule = false, bool $hideChildren = false, bool $hideAttachment = false, $attachment = [],
array $connectTranslations = [], string $textRecurringType = '', bool $hideRecurringMessage = false
array $connectTranslations = [], string $textRecurringType = '', bool $hideRecurringMessage = false, bool $hideCreated = false
) {
$this->type = $type;
$this->transaction = $transaction;
Expand Down Expand Up @@ -461,6 +464,7 @@ public function __construct(

$this->textRecurringType = $this->getTextRecurringType($type, $textRecurringType);
$this->hideRecurringMessage = $hideRecurringMessage;
$this->hideCreated = $hideCreated;
}

protected function getTransactionTemplate($type, $transactionTemplate)
Expand Down
8 changes: 6 additions & 2 deletions resources/views/components/empty-page.blade.php
Expand Up @@ -46,9 +46,13 @@
<li class="border-b p-2 hover:bg-gray-100">
<a href="{{ url($suggestion->action_url) . '?' . http_build_query((array) $suggestion->action_parameters) }}" class="flex items-center justify-between text-xs">
<div class="truncate">
<h2 class="">{{ $suggestion->name }}</h2>
<h2>
{{ $suggestion->name }}
</h2>

<div class="h-4 overflow-hidden text-black-400 truncate">Enter details and create your first expense easily</div>
<div class="h-4 overflow-hidden text-black-400 truncate">
{{ $suggestion->description ?? '' }}
</div>
</div>

<span class="material-icons text-gray-500">chevron_right</span>
Expand Down
Expand Up @@ -2,7 +2,7 @@

@if (! $hideButtonAddNew)
@can($permissionCreate)
<x-link href="{{ route($routeButtonAddNew, ['type' => $type]) }}" kind="primary">
<x-link href="{{ route($routeButtonAddNew, ['type' => $type]) }}" kind="primary">
{{ trans($textButtonAddNew) }}
</x-link>
@endcan
Expand Down
Expand Up @@ -29,10 +29,12 @@
@stack('recurring_message_end')

@stack('row_create_start')
@if (! $hideCreated)
<x-transactions.show.create
type="{{ $type }}"
:transaction="$transaction"
/>
@endif
@stack('row_create_end')

@stack('schedule_start')
Expand Down

0 comments on commit febf73c

Please sign in to comment.