diff --git a/.swcrc b/.swcrc index 298f73452a..120cb676a5 100644 --- a/.swcrc +++ b/.swcrc @@ -1,4 +1,5 @@ { + "$schema": "https://swc.rs/schema.json", "sourceMaps": true, "jsc": { "parser": { @@ -7,7 +8,7 @@ }, "transform": { "react": { - "runtime": "classic", + "runtime": "automatic", "refresh": true } } diff --git a/jsapp/js/account/organizations/requireOrgOwner.component.tsx b/jsapp/js/account/organizations/requireOrgOwner.component.tsx index dd77f49886..927bfe23df 100644 --- a/jsapp/js/account/organizations/requireOrgOwner.component.tsx +++ b/jsapp/js/account/organizations/requireOrgOwner.component.tsx @@ -1,11 +1,11 @@ -import React, {ReactElement, Suspense, useContext, useEffect} from 'react'; -import {RouteObject, useNavigate} from 'react-router-dom'; +import React, {Suspense, useContext, useEffect} from 'react'; +import {useNavigate} from 'react-router-dom'; import {OrganizationContext} from 'js/account/organizations/useOrganization.hook'; import LoadingSpinner from 'js/components/common/loadingSpinner'; import {ACCOUNT_ROUTES} from 'js/account/routes.constants'; interface Props { - children: RouteObject[] | undefined | ReactElement; + children: React.ReactNode; redirect?: boolean; } diff --git a/jsapp/js/account/plans/billingButton.component.tsx b/jsapp/js/account/plans/billingButton.component.tsx index 642063303a..7ae766e852 100644 --- a/jsapp/js/account/plans/billingButton.component.tsx +++ b/jsapp/js/account/plans/billingButton.component.tsx @@ -2,7 +2,7 @@ import cx from 'classnames'; import type {ButtonProps} from 'js/components/common/button'; import Button from 'js/components/common/button'; import React from 'react'; -import {button} from './billingButton.module.scss'; +import styles from './billingButton.module.scss'; /** * The base button component that's used on the Plans/Add-ons pages. @@ -16,7 +16,7 @@ export default function BillingButton(props: Partial) { color='blue' size='l' {...props} - className={cx([button, props.className])} + className={cx([styles.button, props.className])} isFullWidth /> ); diff --git a/jsapp/js/account/plans/plan.component.tsx b/jsapp/js/account/plans/plan.component.tsx index 66b52fd4db..3cc822d39e 100644 --- a/jsapp/js/account/plans/plan.component.tsx +++ b/jsapp/js/account/plans/plan.component.tsx @@ -341,7 +341,7 @@ export default function Plan(props: PlanProps) { const getSubscribedProduct = useCallback(getSubscriptionsForProductId, []); const isSubscribedProduct = useCallback( - (product: SinglePricedProduct, quantity = null) => { + (product: SinglePricedProduct, quantity: number | undefined) => { if (!product.price?.unit_amount && !hasActiveSubscription) { return true; } @@ -356,7 +356,7 @@ export default function Plan(props: PlanProps) { (subscription: SubscriptionInfo) => subscription.items[0].price.id === product.price.id && hasManageableStatus(subscription) && - quantity && + quantity !== undefined && quantity === subscription.quantity ); } diff --git a/jsapp/js/account/security/email/emailSection.component.tsx b/jsapp/js/account/security/email/emailSection.component.tsx index f7dc9bc1f2..23b5be21af 100644 --- a/jsapp/js/account/security/email/emailSection.component.tsx +++ b/jsapp/js/account/security/email/emailSection.component.tsx @@ -170,6 +170,7 @@ export default function EmailSection() { value={email.newEmail} placeholder={t('Type new email address')} onChange={onTextFieldChange.bind(onTextFieldChange)} + type='email' />