Skip to content

Commit

Permalink
feat: Hide preloaders for third party auth providers if they are disa…
Browse files Browse the repository at this point in the history
…bled
  • Loading branch information
Lunyachek authored and syedsajjadkazmii committed Apr 19, 2024
1 parent 2eab85e commit ab35770
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/login/LoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ class LoginPage extends React.Component {
const isInstitutionAuthActive = !!secondaryProviders.length && !currentProvider;
const isSocialAuthActive = !!providers.length && !currentProvider;
const isEnterpriseLoginDisabled = getConfig().DISABLE_ENTERPRISE_LOGIN;
const isThirdPartyAuthActive = isSocialAuthActive || (isEnterpriseLoginDisabled && isInstitutionAuthActive);

return (
<>
Expand All @@ -183,7 +184,7 @@ class LoginPage extends React.Component {
</Hyperlink>
)}

{thirdPartyAuthApiStatus === PENDING_STATE ? (
{thirdPartyAuthApiStatus === PENDING_STATE && isThirdPartyAuthActive ? (
<Skeleton className="tpa-skeleton mb-3" height={30} count={2} />
) : (
<>
Expand Down
3 changes: 2 additions & 1 deletion src/register/components/ThirdPartyAuth.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const ThirdPartyAuth = (props) => {
const isInstitutionAuthActive = !!secondaryProviders.length && !currentProvider;
const isSocialAuthActive = !!providers.length && !currentProvider;
const isEnterpriseLoginDisabled = getConfig().DISABLE_ENTERPRISE_LOGIN;
const isThirdPartyAuthActive = isSocialAuthActive || (isEnterpriseLoginDisabled && isInstitutionAuthActive);

return (
<>
Expand All @@ -34,7 +35,7 @@ const ThirdPartyAuth = (props) => {
</div>
)}

{thirdPartyAuthApiStatus === PENDING_STATE ? (
{thirdPartyAuthApiStatus === PENDING_STATE && isThirdPartyAuthActive ? (
<Skeleton className="tpa-skeleton" height={36} count={2} />
) : (
<>
Expand Down

0 comments on commit ab35770

Please sign in to comment.