Skip to content

Commit

Permalink
Disabled transfer type when less than 2 accounts (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
MHamzaBham authored Dec 26, 2024
1 parent 8066a3c commit dc7a2b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion resources/views/transactions/create-widget.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
onclick="changeTransactionType('{{ TransactionType::Income->label() }}', this.parentElement.parentElement.parentElement.parentElement)">
Income
</label>
<label class="btn btn-outline-primary px-1 {{ session('transaction_type') === TransactionType::Transfer->label() ? 'active' : '' }}" id="transfer-btn">
<label class="btn btn-outline-primary px-1 {{ $accounts->count() < 2 ? 'disabled opacity-5' : '' }} {{ session('transaction_type') === TransactionType::Transfer->label() ? 'active' : '' }}" id="transfer-btn">
<input type="radio" class="d-none" name="type"
value="{{ TransactionType::Transfer->label() }}" {{ session('transaction_type') === TransactionType::Transfer->label() ? 'checked' : '' }}
onclick="changeTransactionType('{{ TransactionType::Transfer->label() }}', this.parentElement.parentElement.parentElement.parentElement)">
Expand Down

0 comments on commit dc7a2b5

Please sign in to comment.