Skip to content

Commit

Permalink
feat: Auth form visual enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
Lunyachek committed Mar 1, 2023
1 parent f291efc commit bccdba0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/login/LoginPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ class LoginPage extends React.Component {
const isInstitutionAuthActive = !!secondaryProviders.length && !currentProvider;
const isSocialAuthActive = !!providers.length && !currentProvider;
const isEnterpriseLoginDisabled = getConfig().DISABLE_ENTERPRISE_LOGIN;
const ThirdPartyAuthPreloader = isSocialAuthActive || (isEnterpriseLoginDisabled && isInstitutionAuthActive);

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

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

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

{thirdPartyAuthApiStatus === PENDING_STATE ? (
{thirdPartyAuthApiStatus === PENDING_STATE && ThirdPartyAuthPreloader ? (
<Skeleton className="tpa-skeleton" height={36} count={2} />
) : (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/register/registrationFields/UsernameField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const UsernameField = (props) => {
const {
intl, handleSuggestionClick, handleUsernameSuggestionClose, usernameSuggestions, errorMessage,
} = props;
let className = '';
let className = 'suggested-usernames-wrapper';
let suggestedUsernameDiv = <></>;
let iconButton = <></>;
const suggestedUsernames = () => (
Expand Down
16 changes: 15 additions & 1 deletion src/sass/_style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,10 @@ select.form-control {
}
}

.content {
width: 100%;
}

.alert {
p:last-child {
margin-bottom: 0;
Expand Down Expand Up @@ -587,11 +591,21 @@ select.form-control {
margin-bottom: 11%;
margin-left: 15px;
}

.suggested-usernames-wrapper {
display: flex;
align-items: center;
width: 100%;
}

.scroll-suggested-username {
width: 21rem;
white-space: nowrap;
overflow-x: auto;
display: inline-flex;

@include media-breakpoint-up(sm) {
margin-right: 0.5rem;
}
}

.pgn__form-control-decorator-trailing {
Expand Down

0 comments on commit bccdba0

Please sign in to comment.