Skip to content

Connect Refresh: one-login-footer #104883

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions client/layout/masterbar/blaze-pro.scss
Original file line number Diff line number Diff line change
Expand Up @@ -503,19 +503,6 @@ body.is-section-signup {
.wp-login__main.main:has(.login form.is-blaze-pro) {
max-width: unset;
}

.wp-login__container {
.wp-login__login-block-footer {
text-align: center;
}

.login__lost-password-link {
font-family: $sfProText;
font-size: rem(18px);
font-weight: 500;
line-height: 24px;
}
}
}

// Hacks for Continue-as-a-user for Sign Up (but user is already logged in)
Expand Down
15 changes: 0 additions & 15 deletions client/layout/masterbar/woo.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1102,21 +1102,6 @@ $breakpoint-mobile: 660px;
flex-direction: column;
}

.wp-login__login-block-footer {
@media (max-width: $break-mobile) {
max-width: $max-width;
margin-bottom: 40px;
}

.auth-form__social-buttons-tos {
margin: 24px 0 0 0;

@media (max-width: $break-medium) {
max-width: $max-width;
}
}
}

.signup-form {
input[type="email"].form-text-input {
margin-bottom: 0;
Expand Down
21 changes: 12 additions & 9 deletions client/login/magic-login/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import {
import { login } from 'calypso/lib/paths';
import getToSAcceptancePayload from 'calypso/lib/tos-acceptance-tracking';
import wpcom from 'calypso/lib/wp';
import OneLoginFooter from 'calypso/login/wp-login/components/one-login-footer';
import OneLoginLayout from 'calypso/login/wp-login/components/one-login-layout';
import {
recordTracksEventWithClientId as recordTracksEvent,
Expand Down Expand Up @@ -327,15 +328,17 @@ class MagicLogin extends Component {

return (
<>
<div className="wp-login__login-block-footer">
<a
className="magic-login__footer-link"
href={ login( loginParameters ) }
onClick={ this.onClickEnterPasswordInstead }
>
{ linkBack }
</a>
</div>
<OneLoginFooter
Copy link
Preview

Copilot AI Jul 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OneLoginFooter component expects both lostPasswordLink and loginLink props based on the interface, but only loginLink is being passed here. This could cause runtime issues if the component tries to access the missing lostPasswordLink prop.

Copilot uses AI. Check for mistakes.

loginLink={
<a
className="one-login__footer-link"
href={ login( loginParameters ) }
onClick={ this.onClickEnterPasswordInstead }
>
{ linkBack }
</a>
}
/>
{ ! oauth2Client && (
<AppPromo
title={ translate( 'Stay logged in with the Jetpack Mobile App' ) }
Expand Down
20 changes: 20 additions & 0 deletions client/login/wp-login/components/one-login-footer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
.one-login__footer {
display: flex;
flex-direction: column;
align-self: center;
gap: 1em;

.one-login__footer-link {
font-size: $font-body-small;
display: inline-flex;
align-items: center;
align-self: center;
gap: 0.1em;
}

.one-login__footer-link a,
a.one-login__footer-link {
color: var(--studio-gray-90, #1d2327);
font-weight: 500;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,41 @@ import { useSelector } from 'react-redux';
import LoggedOutFormBackLink from 'calypso/components/logged-out-form/back-link';
import { isVIPOAuth2Client } from 'calypso/lib/oauth2-clients';
import { getCurrentOAuth2Client } from 'calypso/state/oauth2-clients/ui/selectors';
import './one-login-footer.scss';

interface LoginFooterProps {
lostPasswordLink: JSX.Element;
loginLink: string;
interface OneLoginFooterProps {
/**
* when `isLoginView` is true, this is the "lost password" link
*/
lostPasswordLink?: JSX.Element;
/**
* when `isLoginView` is false, this is the "back to login" link
*/
loginLink?: string;
/**
* when true, this is the footer for the main login screen
*/
isLoginView?: boolean;
}

const recordBackToWpcomLinkClick = () => {
recordTracksEvent( 'calypso_login_back_to_wpcom_link_click' );
};

const LoginBlockFooter = ( { lostPasswordLink, isLoginView, loginLink }: LoginFooterProps ) => {
const OneLoginFooter = ( { lostPasswordLink, loginLink, isLoginView }: OneLoginFooterProps ) => {
const oauth2Client = useSelector( getCurrentOAuth2Client );
const isVIPClient = isVIPOAuth2Client( oauth2Client );

if ( ! lostPasswordLink ) {
return null;
}

if ( isLoginView ) {
return (
<div className="wp-login__login-block-footer">
<div className="one-login__footer">
{ lostPasswordLink }
{ isVIPClient && (
<LoggedOutFormBackLink
classes={ {
'logged-out-form__link-item': false,
'logged-out-form__back-link': false,
'wp-login__login-block-footer-back-link': true,
'one-login__footer-link': true,
} }
oauth2Client={ oauth2Client }
recordClick={ recordBackToWpcomLinkClick }
Expand All @@ -41,7 +47,7 @@ const LoginBlockFooter = ( { lostPasswordLink, isLoginView, loginLink }: LoginFo
);
}

return <div className="wp-login__login-block-footer">{ loginLink }</div>;
return <div className="one-login__footer">{ loginLink }</div>;
};

export default LoginBlockFooter;
export default OneLoginFooter;
8 changes: 4 additions & 4 deletions client/login/wp-login/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ import getIsWoo from 'calypso/state/selectors/get-is-woo';
import isWooJPCFlow from 'calypso/state/selectors/is-woo-jpc-flow';
import { withEnhancers } from 'calypso/state/utils';
import { LoginContext } from '../login-context';
import OneLoginFooter from './components/one-login-footer';
import OneLoginLayout from './components/one-login-layout';
import GravPoweredLoginBlockFooter from './gravatar/grav-powered-login-block-footer';
import getHeadingSubText from './hooks/get-heading-subtext';
import LoginBlockFooter from './login-block-footer';

import './style.scss';

Expand Down Expand Up @@ -160,7 +160,7 @@ export class Login extends Component {

return (
<a
className="login__lost-password-link"
className="one-login__footer-link"
href="/"
onClick={ ( event ) => {
event.preventDefault();
Expand All @@ -187,7 +187,7 @@ export class Login extends Component {
getLoginLink() {
return (
<a
className="wp-login__login-block-footer-back-link"
className="one-login__footer-link"
href="/"
onClick={ ( event ) => {
event.preventDefault();
Expand Down Expand Up @@ -254,7 +254,7 @@ export class Login extends Component {
isGravPoweredLoginPage ? (
<GravPoweredLoginBlockFooter />
) : (
<LoginBlockFooter
<OneLoginFooter
isLoginView={ isLoginView }
lostPasswordLink={ this.getLostPasswordLink() }
loginLink={ this.getLoginLink() }
Expand Down
25 changes: 0 additions & 25 deletions client/login/wp-login/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -375,31 +375,6 @@ $image-height: 47px;
}
}

.wp-login__login-block-footer {
display: flex;
flex-direction: column;
align-self: center;
gap: 1em;

.magic-login__footer-link,
.login__lost-password-link,
.wp-login__login-block-footer-back-link {
font-size: $font-body-small;
display: inline-flex;
align-items: center;
align-self: center;
gap: 0.1em;
}

.login__lost-password-link,
.magic-login__footer-link,
.wp-login__login-block-footer-back-link a,
a.wp-login__login-block-footer-back-link {
color: var(--studio-gray-90, #1d2327);
font-weight: 500;
}
}

&:not(.is-mobile) .layout__primary {
margin-top: 0;

Expand Down