fix: Resolves "Add Domain" UI confusion.

This commit is contained in:
towfiqi 2024-11-12 16:27:32 +06:00
parent faa3519a29
commit 17fb2c40cc

View File

@ -36,7 +36,7 @@ const AddDomain = ({ closeModal, domains = [] }: AddDomainProps) => {
} }
}); });
if (invalidDomains.length > 0) { if (invalidDomains.length > 0) {
setNewDomainError(`Please Insert Valid Domain URL. Invalid URLs: ${invalidDomains.join(', ')}`); setNewDomainError(`Please Insert Valid Website URL. ${invalidDomains.length > 1 ? `Invalid URLs: ${invalidDomains.join(', ')}` : ''}`);
} else if (domainsTobeAdded.length > 0) { } else if (domainsTobeAdded.length > 0) {
console.log('domainsTobeAdded :', domainsTobeAdded); console.log('domainsTobeAdded :', domainsTobeAdded);
addMutate(domainsTobeAdded); addMutate(domainsTobeAdded);
@ -51,11 +51,11 @@ const AddDomain = ({ closeModal, domains = [] }: AddDomainProps) => {
return ( return (
<Modal closeModal={() => { closeModal(false); }} title={'Add New Domain'}> <Modal closeModal={() => { closeModal(false); }} title={'Add New Domain'}>
<div data-testid="adddomain_modal"> <div data-testid="adddomain_modal">
<h4 className='text-sm mt-4'>Domain URL</h4> <h4 className='text-sm mt-4 pb-2'>Website URL(s)</h4>
<textarea <textarea
className={`w-full h-40 border rounded border-gray-200 p-4 outline-none className={`w-full h-40 border rounded border-gray-200 p-4 outline-none
focus:border-indigo-300 ${newDomainError ? ' border-red-400 focus:border-red-400' : ''}`} focus:border-indigo-300 ${newDomainError ? ' border-red-400 focus:border-red-400' : ''}`}
placeholder="Type or Paste URLs here. Insert Each URL in a New line." placeholder={'Type or Paste URLs here. Insert Each URL in a New line. eg: \nhttps://mysite.com/ \nhttps://anothersite.com/ '}
value={newDomain} value={newDomain}
autoFocus={true} autoFocus={true}
onChange={handleDomainInput}> onChange={handleDomainInput}>