From 29837ec8381ed07a0c24f4e26c41fff6ddf3fcbe Mon Sep 17 00:00:00 2001
From: Tim Down <158919+timdown@users.noreply.github.com>
Date: Thu, 6 Jun 2024 16:37:47 +0100
Subject: [PATCH] Merge pull request #18733 from overleaf/td-bs5-button-props
Simplify handling of BS3 props in button wrapper component
GitOrigin-RevId: 12a6b1374da5084e075775f3cef23f0b24d098fc
---
.../make-primary/confirmation-modal.tsx | 10 +----
.../actions/make-primary/primary-button.tsx | 4 --
.../add-email/add-another-email-btn.tsx | 1 -
.../email-affiliated-with-institution.tsx | 1 -
.../emails/add-email/university-name.tsx | 7 +---
.../components/emails/reconfirmation-info.tsx | 6 ---
.../resend-confirmation-email-button.tsx | 1 -
.../components/leave/modal-content.tsx | 7 +---
.../components/linking/enable-widget.tsx | 6 ---
.../components/linking/integration-widget.tsx | 28 ++------------
.../components/linking/sso-widget.tsx | 38 +++----------------
.../settings/components/security-section.tsx | 1 -
.../features/ui/components/ol/ol-button.tsx | 31 +++++++--------
.../ui/components/ol/ol-icon-button.tsx | 16 ++------
.../shared/components/copy-to-clipboard.tsx | 7 +---
15 files changed, 32 insertions(+), 132 deletions(-)
diff --git a/services/web/frontend/js/features/settings/components/emails/actions/make-primary/confirmation-modal.tsx b/services/web/frontend/js/features/settings/components/emails/actions/make-primary/confirmation-modal.tsx
index b06a622c66..dd19daf317 100644
--- a/services/web/frontend/js/features/settings/components/emails/actions/make-primary/confirmation-modal.tsx
+++ b/services/web/frontend/js/features/settings/components/emails/actions/make-primary/confirmation-modal.tsx
@@ -46,21 +46,13 @@ function ConfirmationModal({
{t('log_in_with_primary_email_address')}
-
+
{t('cancel')}
{t('confirm')}
diff --git a/services/web/frontend/js/features/settings/components/emails/actions/make-primary/primary-button.tsx b/services/web/frontend/js/features/settings/components/emails/actions/make-primary/primary-button.tsx
index 9a0f69998b..f68dfb633e 100644
--- a/services/web/frontend/js/features/settings/components/emails/actions/make-primary/primary-button.tsx
+++ b/services/web/frontend/js/features/settings/components/emails/actions/make-primary/primary-button.tsx
@@ -13,10 +13,6 @@ function PrimaryButton({
isLoading={isLoading}
onClick={onClick}
variant="secondary"
- bs3Props={{
- bsStyle: null,
- className: 'btn-secondary btn-secondary-info',
- }}
>
{children}
diff --git a/services/web/frontend/js/features/settings/components/emails/add-email/add-another-email-btn.tsx b/services/web/frontend/js/features/settings/components/emails/add-email/add-another-email-btn.tsx
index 8be3693b81..cb0573c2c3 100644
--- a/services/web/frontend/js/features/settings/components/emails/add-email/add-another-email-btn.tsx
+++ b/services/web/frontend/js/features/settings/components/emails/add-email/add-another-email-btn.tsx
@@ -9,7 +9,6 @@ function AddAnotherEmailBtn({ onClick, ...props }: OLButtonProps) {
variant="link"
onClick={onClick}
className="btn-inline-link"
- bs3Props={{ bsStyle: null }}
{...props}
>
{t('add_another_email')}
diff --git a/services/web/frontend/js/features/settings/components/emails/add-email/email-affiliated-with-institution.tsx b/services/web/frontend/js/features/settings/components/emails/add-email/email-affiliated-with-institution.tsx
index 1ad1950b2d..113201a911 100644
--- a/services/web/frontend/js/features/settings/components/emails/add-email/email-affiliated-with-institution.tsx
+++ b/services/web/frontend/js/features/settings/components/emails/add-email/email-affiliated-with-institution.tsx
@@ -11,7 +11,6 @@ function EmailAffiliatedWithInstitution({ onClick, ...props }: OLButtonProps) {
variant="link"
onClick={onClick}
className="btn-inline-link"
- bs3Props={{ bsStyle: null }}
{...props}
>
{t('let_us_know')}
diff --git a/services/web/frontend/js/features/settings/components/emails/add-email/university-name.tsx b/services/web/frontend/js/features/settings/components/emails/add-email/university-name.tsx
index 1032666856..32fc0166d2 100644
--- a/services/web/frontend/js/features/settings/components/emails/add-email/university-name.tsx
+++ b/services/web/frontend/js/features/settings/components/emails/add-email/university-name.tsx
@@ -14,12 +14,7 @@ function UniversityName({ name, onClick }: UniversityNameProps) {
{name}
{' '}
-
+
{t('change')}
diff --git a/services/web/frontend/js/features/settings/components/emails/reconfirmation-info.tsx b/services/web/frontend/js/features/settings/components/emails/reconfirmation-info.tsx
index b99c8f14a7..4970602559 100644
--- a/services/web/frontend/js/features/settings/components/emails/reconfirmation-info.tsx
+++ b/services/web/frontend/js/features/settings/components/emails/reconfirmation-info.tsx
@@ -150,9 +150,6 @@ function ReconfirmationInfo({ userEmailData }: ReconfirmationInfoProps) {
disabled={state.isLoading}
onClick={handleRequestReconfirmation}
className="btn-inline-link"
- bs3Props={{
- bsStyle: null,
- }}
>
{t('resend_confirmation_email')}
@@ -164,7 +161,6 @@ function ReconfirmationInfo({ userEmailData }: ReconfirmationInfoProps) {
disabled={isPending}
isLoading={isLoading}
onClick={handleRequestReconfirmation}
- bs3Props={{ bsStyle: 'info' }}
>
{isLoading ? (
<>
@@ -209,7 +205,6 @@ function ReconfirmationInfo({ userEmailData }: ReconfirmationInfoProps) {
disabled={state.isLoading}
onClick={handleRequestReconfirmation}
className="btn-inline-link"
- bs3Props={{ bsStyle: null }}
>
{t('resend_confirmation_email')}
@@ -241,7 +236,6 @@ function ReconfirmationInfo({ userEmailData }: ReconfirmationInfoProps) {
variant="secondary"
disabled={state.isLoading || isPending}
onClick={handleRequestReconfirmation}
- bs3Props={{ bsStyle: 'info' }}
>
{isLoading ? (
<>
diff --git a/services/web/frontend/js/features/settings/components/emails/resend-confirmation-email-button.tsx b/services/web/frontend/js/features/settings/components/emails/resend-confirmation-email-button.tsx
index a42c45d330..e4696cfd72 100644
--- a/services/web/frontend/js/features/settings/components/emails/resend-confirmation-email-button.tsx
+++ b/services/web/frontend/js/features/settings/components/emails/resend-confirmation-email-button.tsx
@@ -52,7 +52,6 @@ function ResendConfirmationEmailButton({
disabled={state.isLoading || isLoading}
onClick={handleResendConfirmationEmail}
className="btn-inline-link"
- bs3Props={{ bsStyle: null }}
>
{t('resend_confirmation_email')}
diff --git a/services/web/frontend/js/features/settings/components/leave/modal-content.tsx b/services/web/frontend/js/features/settings/components/leave/modal-content.tsx
index bb6dcdd6b6..97177430ef 100644
--- a/services/web/frontend/js/features/settings/components/leave/modal-content.tsx
+++ b/services/web/frontend/js/features/settings/components/leave/modal-content.tsx
@@ -74,12 +74,7 @@ function LeaveModalContent({
-
+
{t('cancel')}
diff --git a/services/web/frontend/js/features/settings/components/linking/enable-widget.tsx b/services/web/frontend/js/features/settings/components/linking/enable-widget.tsx
index ddd230d854..23ad1f0ad6 100644
--- a/services/web/frontend/js/features/settings/components/linking/enable-widget.tsx
+++ b/services/web/frontend/js/features/settings/components/linking/enable-widget.tsx
@@ -96,7 +96,6 @@ function ActionButton({
variant="primary"
href="/user/subscription/plans"
onClick={trackUpgradeClick}
- bs3Props={{ bsStyle: null, className: 'btn-primary' }}
>
{t('upgrade')}
@@ -107,7 +106,6 @@ function ActionButton({
variant="danger-ghost"
onClick={handleUnlinkClick}
disabled={disabled}
- bs3Props={{ bsStyle: null, className: 'btn-danger-ghost' }}
>
{t('turn_off')}
@@ -118,10 +116,6 @@ function ActionButton({
variant="secondary"
disabled={disabled}
onClick={handleLinkClick}
- bs3Props={{
- bsStyle: null,
- className: 'btn btn-secondary-info btn-secondary',
- }}
>
{t('turn_on')}
diff --git a/services/web/frontend/js/features/settings/components/linking/integration-widget.tsx b/services/web/frontend/js/features/settings/components/linking/integration-widget.tsx
index 8c0990a248..def60625a2 100644
--- a/services/web/frontend/js/features/settings/components/linking/integration-widget.tsx
+++ b/services/web/frontend/js/features/settings/components/linking/integration-widget.tsx
@@ -4,7 +4,6 @@ import OLBadge from '@/features/ui/components/ol/ol-badge'
import getMeta from '../../../../utils/meta'
import { sendMB } from '../../../../infrastructure/event-tracking'
import OLButton from '@/features/ui/components/ol/ol-button'
-import { bsVersion } from '@/features/utils/bootstrap-5'
import OLModal, {
OLModalBody,
OLModalFooter,
@@ -123,7 +122,6 @@ function ActionButton({
variant="primary"
href="/user/subscription/plans"
onClick={() => trackUpgradeClick(integration)}
- bs3Props={{ bsStyle: null, className: 'btn-primary' }}
>
{t('upgrade')}
@@ -134,7 +132,6 @@ function ActionButton({
variant="danger-ghost"
onClick={handleUnlinkClick}
disabled={disabled}
- bs3Props={{ bsStyle: null, className: 'btn-danger-ghost' }}
>
{t('unlink')}
@@ -143,25 +140,14 @@ function ActionButton({
return (
<>
{disabled ? (
-
+
{t('link')}
) : (
trackLinkingClick(integration)}
>
{t('link')}
@@ -215,20 +201,12 @@ function UnlinkConfirmationModal({