fix: oops forgot to disable buttons with empty input

This commit is contained in:
Aarnav Tale 2024-03-28 19:45:00 -04:00
parent 5df9be1b8e
commit a340b3d263
No known key found for this signature in database
2 changed files with 10 additions and 2 deletions

View File

@ -120,7 +120,11 @@ export default function Domains({ baseDomain, searchDomains }: Properties) {
/>
<button
type='button'
className='text-sm text-blue-700'
className={clsx(
'text-sm text-blue-700',
newDomain.length === 0 ? 'opacity-50 cursor-not-allowed' : ''
)}
disabled={newDomain.length === 0}
onClick={() => {
fetcher.submit({
// eslint-disable-next-line @typescript-eslint/naming-convention

View File

@ -144,7 +144,11 @@ export default function Page() {
/>
<button
type='button'
className='text-sm text-blue-700'
className={clsx(
'text-sm text-blue-700',
ns.length === 0 ? 'opacity-50 cursor-not-allowed' : ''
)}
disabled={ns.length === 0}
onClick={() => {
fetcher.submit({
// eslint-disable-next-line @typescript-eslint/naming-convention