Ver Fonte

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

added a new class btn-disabled for pointer-events

GitOrigin-RevId: 334d81f15a7c8446a7ffa16dfbc6f3852b4533a9
Davinder Singh há 3 anos atrás
pai
commit
ac8edba968

+ 18 - 9
services/web/frontend/js/features/settings/components/linking/integration-widget.tsx

@@ -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>
+        )}
+      </>
     )
   }
 }