Skip to content

Commit

Permalink
fix: resolved molecule route issue
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed May 24, 2024
1 parent 428a201 commit 2c451b0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 30 deletions.
4 changes: 3 additions & 1 deletion resources/views/livewire/molecule-card.blade.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<div class="bg-white rounded-lg hover:shadow-xl shadow border">
<a href="{{ route('compound', $molecule->identifier) }}" wire:navigate>
@if($molecule->identifier)
<a href="{{ route('compound', $molecule->identifier) }}" wire:navigate>
<div class="group relative flex flex-col overflow-hidden">
<div class="aspect-h-3 aspect-w-3 sm:aspect-none group-hover:opacity-75 h-56">
<livewire:molecule-depict2d :smiles="$molecule->canonical_smiles">
Expand All @@ -15,4 +16,5 @@
</div>
</div>
</a>
@endif
</div>
33 changes: 9 additions & 24 deletions resources/views/livewire/molecule-details.blade.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<div class="mx-auto max-w-3xl lg:max-w-5xl">
<div class="py-10 bg-white mt-32 rounded-lg shadow-md">
<div class="mx-auto max-w-4xl lg:max-w-7xl px-10">
<div class="py-10 bg-white mt-32 rounded-lg border">
<div
class="mx-auto max-w-3xl px-4 sm:px-6 md:flex md:items-center md:justify-between md:space-x-5 lg:max-w-7xl lg:px-8">
<div class="flex items-center space-x-5">
<div>
<p class="text-secondary-dark text-lg my-0">{{ $molecule->identifier }}</p>
<h2
class="text-2xl break-all font-bold leading-7 break-words text-gray-900 sm:text-3xl sm:tracking-tight">
{{ $molecule->name }}
class="mb-2 text-2xl break-all font-bold leading-7 break-words text-gray-900 sm:text-3xl sm:tracking-tight">
{{ $molecule->name ? $molecule->name : $molecule->iupac_name}}
</h2>
<p class="text-sm font-medium text-gray-500">Created on <time
datetime="{{ $molecule->created_at }}">{{ $molecule->created_at }}</time> &middot; Last
Expand Down Expand Up @@ -42,7 +42,6 @@ class="flex items-baseline flex-wrap justify-between gap-y-2 gap-x-4 border-t bo
<span class="ml-1 text-sm font-bold">{{ $molecule->properties->np_likeness }}</span>
</span></div>
</div>

</div>
<div
class="flex items-baseline flex-wrap justify-between gap-y-2 gap-x-4 border-t border-gray-900/5 px-4 py-10 sm:px-6 lg:border-t-0 xl:px-8 sm:border-l">
Expand Down Expand Up @@ -567,25 +566,12 @@ class="ml-3 text-base text-gray-500"><b>Direct
<div class="border aspect-h-2 aspect-w-3 overflow-hidden rounded-lg mb-2">
<livewire:molecule-depict3d :height="300" :smiles="$molecule->canonical_smiles">
</div>
<div class="bg-white px-4 py-5 shadow sm:rounded-lg sm:px-6 border">
<h2 id="timeline-title" class="text-lg font-medium text-gray-900">Timeline</h2>

<div class="mt-6 flow-root">
<div class="bg-white px-4 py-1 shadow sm:rounded-lg sm:px-6 border">
<div class="mt-2 flow-root">
<ul role="list" class="-mb-8">
<li>
<div class="relative pb-8">
<div class="relative flex space-x-3">
<div>
<span
class="h-8 w-8 rounded-full bg-green-500 flex items-center justify-center ring-8 ring-white">
<svg class="h-5 w-5 text-white" viewBox="0 0 20 20"
fill="currentColor" aria-hidden="true">
<path fill-rule="evenodd"
d="M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z"
clip-rule="evenodd"></path>
</svg>
</span>
</div>
<div class="flex min-w-0 flex-1 justify-between space-x-4 pt-1.5">
<div>
<p class="text-sm text-gray-500">Created at <a href="#"
Expand All @@ -600,10 +586,9 @@ class="font-medium text-gray-900"></a></p>

</ul>
</div>
<div class="mt-6 flex flex-col justify-stretch">
<button type="button"
class="inline-flex items-center justify-center rounded-md bg-gray-600 px-3 py-2 text-sm font-semibold text-white shadow-sm hover:bg-gray-500 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-gray-600">View
complete history</button>
<div class="my-2 flex flex-col justify-stretch">
<a class="inline-flex right py-2 text-sm font-semibold">View
complete history</a>
</div>
</div>

Expand Down
4 changes: 2 additions & 2 deletions resources/views/livewire/recent-molecules.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div>
<div class="max-w-4xl lg:max-w-7xl mx-auto">
<div class="px-4 py-8">
<div class="mx-6 border-gray-200 py-5 sm:flex sm:items-center sm:justify-between">
<h2 class="text-2xl pb-0 font-bold tracking-tight text-white sm:text-2xl">
Expand All @@ -15,7 +15,7 @@ class="inline-flex items-center rounded-md bg-secondary-dark px-3 py-2 text-sm f
<div class="px-4">
<div class="mx-auto grid mt-6 gap-5 lg:max-w-none md:grid-cols-3 lg:grid-cols-5">
@foreach ($molecules as $molecule)
<livewire:molecule-card :molecule="json_encode($molecule)" />
<livewire:molecule-card :key="$molecule->id" :molecule="json_encode($molecule)" />
@endforeach
</div>
</div>
Expand Down
3 changes: 0 additions & 3 deletions resources/views/livewire/search.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,11 @@ class="h-full w-full border-transparent py-2 pl-8 pr-3 text-sm text-gray-900 pla
<div class="flex items-center md:ml-6">
<div><button type="button"
class="rounded-md text-gray-900 bg-white mr-3 py-3 px-2 text-gray-400 hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-secondary-dark focus:ring-offset-2">

<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="mr-3 ml-2 h-6 w-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75" />
</svg>

jjj
</button></div>
<div><button type="button"
class="rounded-md bg-white text-gray-900 mr-3 py-3 px-2 text-gray-400 hover:bg-gray-100 hover:text-gray-700 focus:outline-none focus:ring-2 focus:ring-secondary-dark focus:ring-offset-2"><svg
Expand Down

0 comments on commit 2c451b0

Please sign in to comment.