feat: Hide preloaders for third party auth providers if they are disabled

This commit is contained in:
Stanislav Lunyachek
2024-04-12 11:07:07 +03:00
committed by Syed Sajjad Hussain Shah
parent 2eab85e960
commit ab357704f8
2 changed files with 4 additions and 2 deletions

View File

@@ -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 (
<>
@@ -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} />
) : (
<>

View File

@@ -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 (
<>
@@ -34,7 +35,7 @@ const ThirdPartyAuth = (props) => {
</div>
)}
{thirdPartyAuthApiStatus === PENDING_STATE ? (
{thirdPartyAuthApiStatus === PENDING_STATE && isThirdPartyAuthActive ? (
<Skeleton className="tpa-skeleton" height={36} count={2} />
) : (
<>