Skip to content

Commit

Permalink
fix: add more button when synonyms are available and above certain count
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Jun 6, 2024
1 parent 2792020 commit 3e1197c
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions resources/views/livewire/molecule-details.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ class="text-sm font-medium text-gray-500 sm:flex sm:justify-between">
@endif
</div>
<div class="px-4 py-6 sm:px-6">
@if ($molecule->synonyms && count($molecule->synonyms) > 0)
@if ($molecule->synonyms && count($molecule->synonyms) > 0 )
<div class="not-prose flex gap-3">
<div <ul role="list" class="mt-2 leading-8">
@foreach ($molecule->synonyms as $index => $synonym)
Expand All @@ -273,20 +273,19 @@ class="text-sm font-medium text-gray-500 sm:flex sm:justify-between">
</ul>
</div>
</div>
<div class="justify-center mt-4 ">
<button @click="showAllSynonyms = true" x-show="!showAllSynonyms"
class="text-base font-semibold leading-7 text-secondary-dark text-sm">
View More ↓
</button>
<button @click="showAllSynonyms = false" x-show="showAllSynonyms"
class="text-base font-semibold leading-7 text-secondary-dark text-sm">
View Less ↑
</button>
</div>
@else
<span>No synonyms or alternative names were found for this compound</span>
@endif

<div class="justify-center mt-4 ">
<button @click="showAllSynonyms = true" x-show="!showAllSynonyms"
class="text-base font-semibold leading-7 text-secondary-dark text-sm">
View More ↓
</button>
<button @click="showAllSynonyms = false" x-show="showAllSynonyms"
class="text-base font-semibold leading-7 text-secondary-dark text-sm">
View Less ↑
</button>
</div>
<div class="gap-3 mt-4">
@if ($molecule->cas && count($molecule->cas) > 0)
<h2 id="notes-title" class="text-md font-medium text-gray-900">CAS</h2>
Expand Down

0 comments on commit 3e1197c

Please sign in to comment.