Skip to content

Commit

Permalink
fix: more optimisation
Browse files Browse the repository at this point in the history
  • Loading branch information
CS76 committed Aug 7, 2024
1 parent 8743bab commit 6a19b77
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
4 changes: 1 addition & 3 deletions app/Livewire/MoleculeDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ public function placeholder()
#[Layout('layouts.guest')]
public function render()
{
return view('livewire.molecule-details', [
'molecule' => $this->molecule,
])
return view('livewire.molecule-details')
->layoutData([
'title' => $this->molecule->name ? $this->molecule->name : $this->molecule->iupac_name,
'description' => $this->molecule->description ?? 'Molecule details for '.($this->molecule->name ? $this->molecule->name : $this->molecule->iupac_name),
Expand Down
10 changes: 5 additions & 5 deletions resources/views/livewire/molecule-details.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ class="text-base font-semibold leading-7 text-secondary-dark text-sm">
<div class="px-4 pb-5 sm:px-6">
<div class="mx-auto grid mt-6 gap-5 lg:max-w-none md:grid-cols-3 lg:grid-cols-2">
@foreach ($molecule->related as $tautomer)
<livewire:molecule-card :molecule="json_encode($tautomer)" />
<livewire:molecule-card :molecule="$tautomer" lazy/>
@endforeach
</div>
</div>
Expand All @@ -609,7 +609,7 @@ class="text-base font-semibold leading-7 text-secondary-dark text-sm">
<div class="px-4 pb-5 sm:px-6">
<div class="mx-auto grid mt-6 gap-5 lg:max-w-none md:grid-cols-3 lg:grid-cols-2">
@foreach ($molecule->variants as $variant)
<livewire:molecule-card :molecule="json_encode($variant)" />
<livewire:molecule-card :molecule="$variant" lazy/>
@endforeach
</div>
</div>
Expand All @@ -629,7 +629,7 @@ class="text-base font-semibold leading-7 text-secondary-dark text-sm">
<div class="px-4 pb-5 sm:px-6">
<div class="mx-auto grid mt-6 gap-5 lg:max-w-none md:grid-cols-3 lg:grid-cols-2">
<div class="rounded-lg hover:shadow-lg shadow border">
<livewire:molecule-card :molecule="json_encode($molecule->parent)" />
<livewire:molecule-card :molecule="$molecule->parent" lazy/>
</div>
</div>
</div>
Expand Down Expand Up @@ -748,10 +748,10 @@ class="ml-3 text-base text-gray-500">Lipinski
</div>
<section aria-labelledby="timeline-title" class="lg:col-span-1 lg:col-start-3">
<div class="border aspect-h-2 aspect-w-3 overflow-hidden rounded-lg bg-white mb-2">
<livewire:molecule-depict2d :height="300" :smiles="$molecule->canonical_smiles">
<livewire:molecule-depict2d :height="300" :smiles="$molecule->canonical_smiles" lazy="on-load">
</div>
<div class="border aspect-h-2 aspect-w-3 overflow-hidden rounded-lg mb-2">
<livewire:molecule-depict3d :height="300" :smiles="$molecule->canonical_smiles">
<livewire:molecule-depict3d :height="300" :smiles="$molecule->canonical_smiles" lazy="on-load">
</div>
<div class="bg-white px-4 py-1 shadow sm:rounded-lg sm:px-6 border">
<div class="mt-2 flow-root">
Expand Down

0 comments on commit 6a19b77

Please sign in to comment.