feat: improve champion role display logic

Added checks for lane and role data to prevent errors when displaying champion roles.
(Mel being the first ever champ to launch without this data)
This commit is contained in:
Rico van Zelst
2025-01-25 00:41:44 +01:00
parent 3ac5540508
commit 01c3b669c9
2 changed files with 26 additions and 17 deletions

View File

@@ -35,13 +35,17 @@
</li>
<li class="text-base font-medium leading-loose text-neutral-100 hyphens-auto" lang="en">
<span class="font-bold">Popular Positions:</span>
@foreach ($champion->lanes->roles as $lane)
<span class="inline-block lowercase capitalize-first">{{ $lane }} @svg(getRoleIconSvg($lane), 'w-5 h-5 inline-block')
@if (!$loop->last)
-
@endif
</span>
@endforeach
@if(isset($champion->lanes) && isset($champion->lanes->roles))
@foreach ($champion->lanes->roles as $lane)
<span class="inline-block lowercase capitalize-first">{{ $lane }} @svg(getRoleIconSvg($lane), 'w-5 h-5 inline-block')
@if (!$loop->last)
-
@endif
</span>
@endforeach
@else
<span class="inline-block lowercase capitalize-first">Not Enough Data</span>
@endif
</li>
<li class="items-center text-base font-medium leading-loose text-neutral-100 hyphens-auto"
lang="en">