Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ludoguenet committed Mar 5, 2024
1 parent c02d43a commit 283b0d3
Show file tree
Hide file tree
Showing 6 changed files with 116 additions and 102 deletions.
99 changes: 53 additions & 46 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion resources/views/about.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<div class="mt-10">
<p>I believe that absorbing knowledge from a tip gives your skills or app a "nudge" to excel even further! 🥤</p>

<p>That's why I created <a href="laranudge.com" class="underline">laranudge.com</a>, to share our favourite tips on Laravel. It aims to be simple and minimalist.</p>
<p>That's why I created <a href="{{ config('app.url') }}" class="underline">laranudge.com</a>, to share our favourite tips on Laravel. It aims to be simple and minimalist.</p>
</div>
</div>

Expand Down
28 changes: 22 additions & 6 deletions resources/views/admin/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<table class="min-w-full divide-y divide-gray-300">
<thead>
<tr>
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900">Tip content</th>
<th scope="col" class="py-3.5 pl-4 pr-3 text-left text-sm font-semibold text-gray-900 sm:pl-0">Content</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Status</th>
<th scope="col" class="px-3 py-3.5 text-left text-sm font-semibold text-gray-900">Date</th>
<th scope="col" class="relative py-3.5 pl-3 pr-4 sm:pr-0">
Expand All @@ -34,8 +34,25 @@
<tr>
<td class="whitespace-nowrap py-5 pl-4 pr-3 text-sm sm:pl-0">
<div class="flex items-center">
<div x-data="" x-on:click.prevent="$dispatch('open-modal', 'nudge-preview-{{ $nudge->id }}')" class="flex-shrink-0 hover:cursor-pointer hover:text-green-500 transition ease-in-out duration-300">
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-4 h-4">
<path stroke-linecap="round" stroke-linejoin="round" d="M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5" />
</svg>
</div>
<x-modal name="nudge-preview-{{ $nudge->id }}" max-width="4xl" focusable>
<div class="divide-y divide-gray-200 overflow-hidden rounded-lg bg-white shadow">
<div class="px-4 py-5 sm:px-6 text-gray-500">
You're currently viewing the code for the tip.
</div>
<div class="px-4 py-5 sm:p-6">
<pre>
<x-torchlight-code language='php'>{!! $nudge->code !!}</x-torchlight-code>
</pre>
</div>
</div>
</x-modal>
<div class="ml-4">
<div class="font-medium text-gray-900">{{ Str::limit($nudge->content, 70) }}</div>
<div class="text-gray-500" title="{{ $nudge->content }}">{{ Str::limit($nudge->content, 70) }}</div>
</div>
</div>
</td>
Expand All @@ -44,14 +61,13 @@
</td>
<td class="whitespace-nowrap px-3 py-5 text-sm text-gray-500">{{ $nudge->created_at->format('m/d/Y') }}</td>
<td class="flex items-center space-x-5 relative whitespace-nowrap py-5 pl-3 pr-4 text-left text-sm font-medium sm:pr-0">
@include('nudges.partials.delete-nudge-form')
<!-- Enabled: "bg-green-600", Not Enabled: "bg-gray-200" -->
<button x-data="toggles({{ $nudge->validated }})" @click="toggle({{ $nudge->id }})" type="button" :class="isToggled ? 'bg-green-600' : 'bg-gray-200'" class="relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-green-600 focus:ring-offset-2" role="switch" aria-checked="false">
@include('nudges.partials.delete-nudge-form', ['nudgeId' => $nudge->id])
<!-- Enabled: "bg-green-500", Not Enabled: "bg-gray-200" -->
<button x-data="toggles({{ $nudge->validated }})" @click="toggle({{ $nudge->id }})" type="button" :class="isToggled ? 'bg-green-500' : 'bg-gray-200'" class="relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-green-500 focus:ring-offset-2" role="switch" aria-checked="false">
<span class="sr-only">Use setting</span>
<!-- Enabled: "translate-x-5", Not Enabled: "translate-x-0" -->
<span aria-hidden="true" :class="isToggled ? 'translate-x-5' : 'translate-x-0'" class="pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out"></span>
</button>

</td>
</tr>
@endforeach
Expand Down
Loading

0 comments on commit 283b0d3

Please sign in to comment.