Skip to content
This repository was archived by the owner on Jun 27, 2024. It is now read-only.

Commit cea54ab

Browse files
committed
UI
1 parent 9b9fed0 commit cea54ab

File tree

1 file changed

+23
-96
lines changed

1 file changed

+23
-96
lines changed

js/Pagination.vue

+23-96
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,7 @@
11
<template>
22
<nav
33
v-if="hasPagination"
4-
class="
5-
bg-white
6-
px-4
7-
py-3
8-
flex
9-
items-center
10-
justify-between
11-
border-t border-gray-200
12-
sm:px-6
13-
"
4+
class="bg-white px-4 py-3 flex items-center justify-between border-t border-gray-200 sm:px-6"
145
>
156
<p v-if="!hasData || pagination.total < 1">
167
{{ translations.no_results_found }}
@@ -24,49 +15,26 @@
2415
>
2516
<component
2617
:is="previousPageUrl ? 'a' : 'div'"
27-
:class="{'cursor-not-allowed': !previousPageUrl}"
18+
:class="{
19+
'cursor-not-allowed text-gray-400': !previousPageUrl,
20+
'text-gray-700 hover:text-gray-500': previousPageUrl
21+
}"
2822
:href="previousPageUrl"
2923
:dusk="previousPageUrl ? 'pagination-simple-previous' : null"
30-
class="
31-
relative
32-
inline-flex
33-
items-center
34-
px-4
35-
py-2
36-
border border-gray-300
37-
text-sm
38-
font-medium
39-
rounded-md
40-
text-gray-700
41-
bg-white
42-
hover:text-gray-500
43-
"
44-
24+
class="relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md bg-white"
4525
@click.prevent="onClick(previousPageUrl)"
4626
>
4727
{{ translations.previous }}
4828
</component>
4929
<component
5030
:is="nextPageUrl ? 'a' : 'div'"
51-
:class="{'cursor-not-allowed': !nextPageUrl}"
31+
:class="{
32+
'cursor-not-allowed text-gray-400': !nextPageUrl,
33+
'text-gray-700 hover:text-gray-500': nextPageUrl
34+
}"
5235
:href="nextPageUrl"
5336
:dusk="nextPageUrl ? 'pagination-simple-next' : null"
54-
class="
55-
ml-3
56-
relative
57-
inline-flex
58-
items-center
59-
px-4
60-
py-2
61-
border border-gray-300
62-
text-sm
63-
font-medium
64-
rounded-md
65-
text-gray-700
66-
bg-white
67-
hover:text-gray-500
68-
"
69-
37+
class="ml-3 relative inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md bg-white"
7038
@click.prevent="onClick(nextPageUrl)"
7139
>
7240
{{ translations.next }}
@@ -90,37 +58,18 @@
9058
</div>
9159
<div>
9260
<nav
93-
class="
94-
relative
95-
z-0
96-
inline-flex
97-
rounded-md
98-
shadow-sm
99-
-space-x-px
100-
"
61+
class="relative z-0 inline-flex rounded-md shadow-sm -space-x-px"
10162
aria-label="Pagination"
10263
>
10364
<component
10465
:is="previousPageUrl ? 'a' : 'div'"
105-
:class="{'cursor-not-allowed': !previousPageUrl}"
66+
:class="{
67+
'cursor-not-allowed text-gray-400': !previousPageUrl,
68+
'text-gray-500 hover:bg-gray-50': previousPageUrl
69+
}"
10670
:href="previousPageUrl"
10771
:dusk="previousPageUrl ? 'pagination-previous' : null"
108-
109-
class="
110-
relative
111-
inline-flex
112-
items-center
113-
px-2
114-
py-2
115-
rounded-l-md
116-
border border-gray-300
117-
bg-white
118-
text-sm
119-
font-medium
120-
text-gray-500
121-
hover:bg-gray-50
122-
"
123-
72+
class="relative inline-flex items-center px-2 py-2 rounded-l-md border border-gray-300 bg-white text-sm font-medium"
12473
@click.prevent="onClick(previousPageUrl)"
12574
>
12675
<span class="sr-only">{{ translations.previous }}</span>
@@ -150,19 +99,7 @@
15099
"
151100
:href="link.url"
152101
:dusk="link.url ? `pagination-${link.label}` : null"
153-
class="
154-
relative
155-
inline-flex
156-
items-center
157-
px-4
158-
py-2
159-
border border-gray-300
160-
bg-white
161-
text-sm
162-
font-medium
163-
text-gray-700
164-
"
165-
102+
class="relative inline-flex items-center px-4 py-2 border border-gray-300 bg-white text-sm font-medium text-gray-700"
166103
:class="{
167104
'cursor-not-allowed': !link.url,
168105
'hover:bg-gray-50': link.url,
@@ -177,23 +114,13 @@
177114

178115
<component
179116
:is="nextPageUrl ? 'a' : 'div'"
180-
:class="{'cursor-not-allowed': !nextPageUrl}"
117+
:class="{
118+
'cursor-not-allowed text-gray-400': !nextPageUrl,
119+
'text-gray-500 hover:bg-gray-50': nextPageUrl
120+
}"
181121
:href="nextPageUrl"
182122
:dusk="nextPageUrl ? 'pagination-next' : null"
183-
class="
184-
relative
185-
inline-flex
186-
items-center
187-
px-2
188-
py-2
189-
rounded-r-md
190-
border border-gray-300
191-
bg-white
192-
text-sm
193-
font-medium
194-
text-gray-500
195-
hover:bg-gray-50
196-
"
123+
class="relative inline-flex items-center px-2 py-2 rounded-r-md border border-gray-300 bg-white text-sm font-medium"
197124
@click.prevent="onClick(nextPageUrl)"
198125
>
199126
<span class="sr-only">{{ translations.next }}</span>

0 commit comments

Comments
 (0)