Merge pull request #10730 from overleaf/ds-settings-page-disabled-btn-fix

added a new class btn-disabled for pointer-events

GitOrigin-RevId: 334d81f15a7c8446a7ffa16dfbc6f3852b4533a9
This commit is contained in:
Davinder Singh 2022-12-07 10:51:53 +00:00 committed by Copybot
parent 4adfca52bf
commit ac8edba968

View file

@ -104,7 +104,13 @@ function ActionButton({
disabled,
}: ActionButtonProps) {
const { t } = useTranslation()
const classNames = require('classnames')
const classes = classNames(
'btn',
'btn-secondary-info',
'btn-secondary',
'text-capitalize'
)
if (!hasFeature) {
return (
<Button
@ -124,14 +130,17 @@ function ActionButton({
)
} else {
return (
<Button
bsStyle={null}
className="btn-secondary-info btn-secondary"
href={linkPath}
disabled={disabled}
>
<span className="text-capitalize">{t('link')}</span>
</Button>
<>
{disabled ? (
<button disabled className={classes}>
{t('link')}
</button>
) : (
<a className={classes} href={linkPath}>
{t('link')}
</a>
)}
</>
)
}
}