Skip to content

Commit

Permalink
[Update] Season Pagination
Browse files Browse the repository at this point in the history
- Added `whitespace-nowrap` to types and years so the buttons don't grow in size on smaller screens
  • Loading branch information
kiritokatklian committed Nov 22, 2024
1 parent 47359cb commit b150a96
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions resources/views/components/season-pagination.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
};
@endphp

<div class="flex flex-wrap gap-4 justify-between">
<div class="flex flex-wrap gap-4 justify-between items-baseline">
<div class="flex gap-2 overflow-x-scroll no-scrollbar">
{{-- Previous page --}}
@php
Expand All @@ -41,11 +41,11 @@
@endphp

@if ($nextYear < 1917 && $nextSeasonOfYear->value === \App\Enums\SeasonOfYear::Fall)
<a class="pl-4 pr-4 pb-2 border-b-2 hover:border-orange-500" href="{{ route($seasonIndexRouteName) }}">
<a class="pl-4 pr-4 pb-2 whitespace-nowrap border-b-2 hover:border-orange-500" href="{{ route($seasonIndexRouteName) }}">
{{ __('Current') }}
</a>
@else
<a class="pl-4 pr-4 pb-2 border-b-2 hover:border-orange-500" href="{{ route($seasonYearRouteName, [$nextYear, $nextSeasonOfYear->key]) }}">
<a class="pl-4 pr-4 pb-2 whitespace-nowrap border-b-2 hover:border-orange-500" href="{{ route($seasonYearRouteName, [$nextYear, $nextSeasonOfYear->key]) }}">
{{ $nextSeasonOfYear->key . ' ' . $nextYear }}
</a>
@endif
Expand All @@ -54,7 +54,7 @@
@php
$active = request()->routeIs($seasonYearRouteName, [$year, $seasonOfYear->key]);
@endphp
<a class="pl-4 pr-4 pb-2 border-b-2 {{ $active ? 'border-orange-500' : 'hover:border-orange-500' }}" href="{{ route($seasonYearRouteName, [$year, $seasonOfYear->key]) }}">
<a class="pl-4 pr-4 pb-2 whitespace-nowrap border-b-2 {{ $active ? 'border-orange-500' : 'hover:border-orange-500' }}" href="{{ route($seasonYearRouteName, [$year, $seasonOfYear->key]) }}">
{{ $seasonOfYear->key . ' ' . $year }}
</a>

Expand All @@ -75,7 +75,7 @@
$previousYear = $nextYear;
$previousSeasonOfYear = $nextSeasonOfYear;
@endphp
<a class="pl-4 pr-4 pb-2 border-b-2 hover:border-orange-500" href="{{ route($seasonYearRouteName, [$nextYear, $nextSeasonOfYear->key]) }}">
<a class="pl-4 pr-4 pb-2 whitespace-nowrap border-b-2 hover:border-orange-500" href="{{ route($seasonYearRouteName, [$nextYear, $nextSeasonOfYear->key]) }}">
{{ $nextSeasonOfYear->key . ' ' . $nextYear }}
</a>
@endforeach
Expand All @@ -84,15 +84,15 @@
@php
$active = request()->routeIs($seasonScheduleRouteName, [$year, $seasonOfYear->key]);
@endphp
<a class="pl-4 pr-4 pb-2 border-b-2 {{ $active ? 'border-orange-500' : 'hover:border-orange-500' }}" href="{{ route($seasonScheduleRouteName) }}">
<a class="pl-4 pr-4 pb-2 whitespace-nowrap border-b-2 {{ $active ? 'border-orange-500' : 'hover:border-orange-500' }}" href="{{ route($seasonScheduleRouteName) }}">
{{ __('Schedule') }}
</a>

{{-- Archive --}}
@php
$active = request()->routeIs($seasonArchiveRouteName, [$year, $seasonOfYear->key]);
@endphp
<a class="pl-4 pr-4 pb-2 border-b-2 {{ $active ? 'border-orange-500' : 'hover:border-orange-500' }}" href="{{ route($seasonArchiveRouteName) }}">
<a class="pl-4 pr-4 pb-2 whitespace-nowrap border-b-2 {{ $active ? 'border-orange-500' : 'hover:border-orange-500' }}" href="{{ route($seasonArchiveRouteName) }}">
{{ __('Archive') }}
</a>
</div>
Expand Down
4 changes: 2 additions & 2 deletions resources/views/livewire/browse/anime/seasons/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@ class="max-w-7xl mx-auto pl-4 pr-4 py-6 sm:px-6"

@foreach ($this->mediaTypes as $mediaType)
<template x-if="selectedMediaType === '{{ $mediaType->name }}'">
<x-button>{{ $mediaType->name }}</x-button>
<x-button class="whitespace-nowrap">{{ $mediaType->name }}</x-button>
</template>

<template x-if="selectedMediaType !== '{{ $mediaType->name }}'">
<x-outlined-button x-on:click="selectedMediaType = '{{ $mediaType->name }}'">{{ $mediaType->name }}</x-outlined-button>
<x-outlined-button class="whitespace-nowrap" x-on:click="selectedMediaType = '{{ $mediaType->name }}'">{{ $mediaType->name }}</x-outlined-button>
</template>
@endforeach
</div>
Expand Down

0 comments on commit b150a96

Please sign in to comment.