Skip to content

Commit b767a58

Browse files
authored
fix(ui): use appropriate cursor type for disabled UI elements (seerr-team#1184)
1 parent d71b48a commit b767a58

File tree

3 files changed

+14
-12
lines changed

3 files changed

+14
-12
lines changed

src/components/Slider/index.tsx

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ const Slider: React.FC<SliderProps> = ({
163163
<div className="absolute right-0 flex -mt-10 text-gray-400">
164164
<button
165165
className={`${
166-
scrollPos.isStart
167-
? 'cursor-not-allowed text-gray-800'
168-
: 'hover:text-white'
166+
scrollPos.isStart ? 'text-gray-800' : 'hover:text-white'
169167
}`}
170168
onClick={() => slide(Direction.LEFT)}
171169
disabled={scrollPos.isStart}
@@ -187,9 +185,7 @@ const Slider: React.FC<SliderProps> = ({
187185
</button>
188186
<button
189187
className={`${
190-
scrollPos.isEnd
191-
? 'cursor-not-allowed text-gray-800'
192-
: 'hover:text-white'
188+
scrollPos.isEnd ? 'text-gray-800' : 'hover:text-white'
193189
}`}
194190
onClick={() => slide(Direction.RIGHT)}
195191
disabled={scrollPos.isEnd}

src/styles/globals.css

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,6 @@ img.avatar-sm {
178178
@apply flex max-w-lg rounded-md shadow-sm;
179179
}
180180

181-
textarea {
182-
@apply flex-1 block w-full min-w-0 text-white transition duration-150 ease-in-out bg-gray-700 border border-gray-500 rounded-md form-input sm:text-sm sm:leading-5;
183-
}
184-
185181
.label-required {
186182
@apply text-red-500;
187183
}
@@ -206,14 +202,22 @@ label.text-label {
206202
@apply sm:mt-2;
207203
}
208204

205+
button,
206+
input,
207+
select,
208+
textarea {
209+
@apply disabled:cursor-not-allowed;
210+
}
211+
209212
input[type='checkbox'] {
210213
@apply w-6 h-6 text-indigo-600 transition duration-150 ease-in-out rounded-md;
211214
}
212215

213216
input[type='text'],
214217
input[type='password'],
215-
select {
216-
@apply flex-1 block w-full min-w-0 text-white transition duration-150 ease-in-out bg-gray-700 border border-gray-500 rounded-md form-input sm:text-sm sm:leading-5;
218+
select,
219+
textarea {
220+
@apply flex-1 block w-full min-w-0 text-white transition duration-150 ease-in-out bg-gray-700 border border-gray-500 rounded-md sm:text-sm sm:leading-5;
217221
}
218222

219223
input.rounded-l-only,
@@ -234,6 +238,7 @@ select.short {
234238
.protocol {
235239
@apply inline-flex items-center px-3 text-gray-100 bg-gray-600 border border-r-0 border-gray-500 cursor-default rounded-l-md sm:text-sm;
236240
}
241+
237242
.error {
238243
@apply mt-2 text-sm text-red-500;
239244
}

tailwind.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ module.exports = {
5959
},
6060
},
6161
variants: {
62+
cursor: ['disabled'],
6263
padding: ['first', 'last', 'responsive'],
6364
borderWidth: ['first', 'last'],
6465
margin: ['first', 'last', 'responsive'],

0 commit comments

Comments
 (0)