Hide copy link feature when there's no offer code (#19335)

fixes PROD-253
This commit is contained in:
Sodbileg Gansukh 2023-12-12 22:57:55 +07:00 committed by GitHub
parent 0a5c61acb2
commit 03fd494e84
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View File

@ -298,14 +298,14 @@ const Sidebar: React.FC<SidebarProps> = ({tierOptions,
}}
onChange={(e) => {
handleTrialAmountInput(e);
}}
}}
onKeyDown={() => clearError('amount')}/>
}
<TextField
error={Boolean(errors.code)}
hint={errors.code || <div className='flex items-center justify-between'><div>{homepageUrl}<span className='font-bold'>{overrides.code.value}</span></div><span></span><Button className='text-xs' color='green' label={`${isCopied ? 'Copied' : 'Copy'}`} size='sm' link onClick={handleCopyClick} /></div>}
hint={errors.code || (overrides.code.value !== '' ? <div className='flex items-center justify-between'><div>{homepageUrl}<span className='font-bold'>{overrides.code.value}</span></div><span></span><Button className='text-xs' color='green' label={`${isCopied ? 'Copied' : 'Copy'}`} size='sm' link onClick={handleCopyClick} /></div> : null)}
placeholder='black-friday'
title='Offer code'
value={overrides.code.value}

View File

@ -152,7 +152,7 @@ const Sidebar: React.FC<{
/>
<TextField
error={Boolean(errors.code)}
hint={errors.code || <div className='flex items-center justify-between'><div>{homepageUrl}<span className='font-bold'>{offer?.code}</span></div><span></span><Button className='text-xs' color='green' label={`${isCopied ? 'Copied' : 'Copy'}`} size='sm' link onClick={handleCopyClick} /></div>}
hint={errors.code || (offer?.code !== '' ? <div className='flex items-center justify-between'><div>{homepageUrl}<span className='font-bold'>{offer?.code}</span></div><span></span><Button className='text-xs' color='green' label={`${isCopied ? 'Copied' : 'Copy'}`} size='sm' link onClick={handleCopyClick} /></div> : null)}
placeholder='black-friday'
title='Offer code'
value={offer?.code}