Skip to content

Commit

Permalink
Issue #81. Add dark-mode to pagination
Browse files Browse the repository at this point in the history
  • Loading branch information
kalashnikovisme committed Nov 20, 2024
1 parent f79654d commit d9bbd0a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 19 deletions.
9 changes: 1 addition & 8 deletions app/views/kaminari/_first_page.html.haml
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
-# Link to the "First" page
-# available local variables
-# url: url to the first page
-# current_page: a page object for the currently displayed page
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
%span.first{ class: 'px-3 py-2 text-sm font-medium text-purple-700 bg-white rounded-md hover:bg-purple-100' }
%span.first.px-3.py-2.text-sm.font-medium.text-purple-700.bg-white.rounded-md.hover:bg-purple-100.dark:text-white
= link_to_unless current_page.first?, t('views.pagination.first').html_safe, url, remote: remote
14 changes: 3 additions & 11 deletions app/views/kaminari/_page.html.haml
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
-# Link showing page number
-# available local variables
-# page: a page object for "this" page
-# url: url to this page
-# current_page: a page object for the currently displayed page
-# total_pages: total number of pages
-# per_page: number of items to fetch per page
-# remote: data-remote
- if page.current?
%span{class: "px-3 py-2 font-medium rounded-md bg-purple-500 text-white" }
%span.px-3.py-2.font-medium.rounded-md.bg-purple-500.text-white.dark:text-gray-800.dark:bg-white
= page
- else
%span{class: "cursor px-3 py-2 font-medium text-purple-700 bg-white rounded-md hover:bg-purple-100"}
= link_to_unless page.current?, page, url, {remote: remote, rel: page.rel}
= link_to url, remote:, rel: page.rel, class: 'cursor-pointer px-3 py-2 font-medium text-purple-700 bg-white rounded-md hover:bg-purple-100 dark:text-white dark:bg-gray-800 dark:hover:bg-gray-700' do
= page

0 comments on commit d9bbd0a

Please sign in to comment.