Skip to content

Commit

Permalink
fix: extract authMethodTypes to an object
Browse files Browse the repository at this point in the history
  • Loading branch information
masterprog-cmd committed Sep 17, 2024
1 parent aa687b2 commit 6eb73d4
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ interface CheckoutViewProps {
checkoutViewManager: CheckoutViewManager;
}

const AUTH_METHOD_VALUES = {
IS_SIGNED_IN: 'userIsSignedIn',
};

const CheckoutView = ({
userInfo,
isUserAuthenticated,
Expand All @@ -62,7 +66,7 @@ const CheckoutView = ({
mode: 'onChange',
});

const isButtonDisabled = authMethod === 'userIsSignedIn' ? isPaying : isPaying && isValid;
const isButtonDisabled = authMethod === AUTH_METHOD_VALUES.IS_SIGNED_IN ? isPaying : isPaying && isValid;

function onAuthMethodToggled(authMethod: AuthMethodTypes) {
reset({
Expand Down

0 comments on commit 6eb73d4

Please sign in to comment.