Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

Commit

Permalink
fix: Remove Manage my subscriptions CTA
Browse files Browse the repository at this point in the history
  • Loading branch information
julianajlk committed Jul 30, 2024
1 parent 442da17 commit bcc36c0
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions src/subscriptions/Subscriptions.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { BasicAlert } from '../components';
import SubscriptionCardsView from './SubscriptionCardsView';
import SubscriptionUpsell from './SubscriptionUpsell';

import { clearStripeError, fetchStripeCustomerPortalURL } from './actions';
import { clearStripeError } from './actions';
import { subscriptionsSelector } from './selectors';

import messages from './Subscriptions.messages';
Expand All @@ -20,7 +20,6 @@ const Subscriptions = () => {
const dispatch = useDispatch();
const {
subscriptions,
stripeCustomerPortalURL,
stripeError,
stripeLoading,

Check failure on line 24 in src/subscriptions/Subscriptions.jsx

View workflow job for this annotation

GitHub Actions / tests

'stripeLoading' is assigned a value but never used
} = useSelector(subscriptionsSelector);
Expand All @@ -39,21 +38,10 @@ const Subscriptions = () => {
messages['ecommerce.order.history.subscriptions.manage.button'],
);

const handleManageSubscriptionsClick = () => {
sendTrackEvent('edx.bi.user.subscription.order-page.manage.clicked');
dispatch(fetchStripeCustomerPortalURL());
};

const handeAlertClose = () => {
dispatch(clearStripeError());
};

useEffect(() => {
if (stripeCustomerPortalURL) {
window.open(stripeCustomerPortalURL, '_blank', 'noopener,noreferrer');
}
}, [stripeCustomerPortalURL]);

const renderSpinner = () => (

Check failure on line 45 in src/subscriptions/Subscriptions.jsx

View workflow job for this annotation

GitHub Actions / tests

'renderSpinner' is assigned a value but never used
<div className="icon-spin">{SpinnerSimple()}</div>
);
Expand All @@ -80,15 +68,6 @@ const Subscriptions = () => {
buttonLabel: <i>{buttonLabel}</i>,
})}
</span>
<StatefulButton
size="sm"
className="text-nowrap"
labels={{ default: buttonLabel }}
icons={{ default: undefined }}
iconAfter={stripeLoading ? renderSpinner : Launch}
state={stripeLoading ? 'pending' : 'default'}
onClick={handleManageSubscriptionsClick}
/>
</div>
<SubscriptionCardsView subscriptions={subscriptions} />
<BasicAlert isModal isVisible={stripeError} onClose={handeAlertClose} />
Expand Down

0 comments on commit bcc36c0

Please sign in to comment.