Skip to content
4 changes: 3 additions & 1 deletion e2e/page-objects/onboarding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ export default class Onboarding {
}

get heading() {
return this.locator.getByRole( 'heading', { name: 'Connect to your WordPress.com account' } );
return this.locator.getByRole( 'heading', {
name: /Connect to your WordPress.com account|Connect your WordPress.com account/,
} );
}

async completeOnboarding( options?: { customSiteName?: string; customFolderName?: string } ) {
Expand Down
6 changes: 3 additions & 3 deletions src/components/tests/onboarding.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ describe( 'Onboarding Component', () => {

it( 'renders onboarding screen correctly', () => {
const { getByText } = renderWithProvider( <Onboarding /> );
expect( getByText( 'Connect to your WordPress.com account' ) ).toBeVisible();
expect( getByText( 'Connect your WordPress.com account' ) ).toBeVisible();
expect( getByText( 'Skip →' ) ).toBeVisible();
} );

Expand All @@ -80,7 +80,7 @@ describe( 'Onboarding Component', () => {
renderWithProvider( <Onboarding /> );
const user = userEvent.setup();

const logIn = screen.getByRole( 'button', { name: 'Log in ↗' } );
const logIn = screen.getByRole( 'button', { name: 'Log in to WordPress.com ↗' } );
await user.hover( logIn );

expect( screen.getByText( "You're currently offline." ) ).toBeInTheDocument();
Expand All @@ -92,7 +92,7 @@ describe( 'Onboarding Component', () => {
renderWithProvider( <Onboarding /> );
const user = userEvent.setup();

const logIn = screen.getByRole( 'button', { name: 'Log in ↗' } );
const logIn = screen.getByRole( 'button', { name: 'Log in to WordPress.com ↗' } );
await user.hover( logIn );

expect( screen.queryByText( "You're currently offline." ) ).not.toBeInTheDocument();
Expand Down
34 changes: 27 additions & 7 deletions src/modules/onboarding/components/connect-to-wpcom.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { __experimentalHeading as Heading } from '@wordpress/components';
import { __experimentalHeading as Heading, Icon } from '@wordpress/components';
import { check } from '@wordpress/icons';
import { useI18n } from '@wordpress/react-i18n';
import { ArrowIcon } from 'src/components/arrow-icon';
import Button from 'src/components/button';
Expand All @@ -16,11 +17,30 @@ export function OnboardingConnectToWpcom( { onSkip }: { onSkip: () => void } ) {

return (
<div className="h-full flex flex-col">
<div className="flex flex-col items-center gap-6 my-auto">
<Heading className="text-[32px] text-gray-900 text-center px-10" weight={ 500 }>
{ __( 'Connect to your WordPress.com account' ) }
<div className="flex flex-col gap-4 my-auto text-pretty">
<Heading className="a8c-subtitle text-xl">
{ __( 'Connect your WordPress.com account' ) }
</Heading>

<div className="text-a8c-gray-70 a8c-body">
{ __(
'Log in with WordPress.com to unlock the full power of WordPress Studio. By signing in, you get access to features that help you build faster, test safely, and work seamlessly across environments:'
) }
</div>

<div>
{ [
__( 'Share preview sites with clients and team members.' ),
__( 'Seamlessly sync with WordPress.com and Pressable sites.' ),
__( 'Get help from Studio Assistant.' ),
].map( ( text ) => (
<div key={ text } className="text-a8c-gray-70 a8c-body flex items-center">
<Icon className="fill-a8c-blue-50 me-2 shrink-0" icon={ check } />
{ text }
</div>
) ) }
</div>

<Tooltip disabled={ ! isOffline } icon={ offlineIcon } text={ offlineMessage }>
<Button
aria-description={ isOffline ? offlineMessage : '' }
Expand All @@ -33,7 +53,7 @@ export function OnboardingConnectToWpcom( { onSkip }: { onSkip: () => void } ) {
authenticate();
} }
>
{ __( 'Log in' ) }
{ __( 'Log in to WordPress.com' ) }
<ArrowIcon />
</Button>
</Tooltip>
Expand All @@ -44,7 +64,7 @@ export function OnboardingConnectToWpcom( { onSkip }: { onSkip: () => void } ) {
text={ offlineMessage }
placement="bottom-start"
>
<span>
<div className="text-a8c-gray-70 a8c-body">
{ __( 'New to WordPress.com?' ) }{ ' ' }
<Button
aria-description={ isOffline ? offlineMessage : '' }
Expand All @@ -60,7 +80,7 @@ export function OnboardingConnectToWpcom( { onSkip }: { onSkip: () => void } ) {
{ __( 'Create a free account' ) }
<ArrowIcon />
</Button>
</span>
</div>
</Tooltip>
</div>

Expand Down