Skip to content
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

Update mobile app onboarding modal to focus on app installation #40559

Merged
merged 11 commits into from
Oct 9, 2023
Merged
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';

/**
* Internal dependencies
*/
import MobileQRCode from '../illustrations/woo-mobile-download-qrcode.svg';

export const MobileAppInstallationInfo = () => {
return (
<div>
<img
src={ MobileQRCode }
alt={ __( 'Download WooCommerce mobile app', 'woocommerce' ) }
width="150"
/>
<p>
{ __(
'Scan the code above to download the WooCommerce mobile app, or visit woocommerce.com/mobile from your mobile device.',
'woocommerce'
) }
</p>
</div>
);
};
Copy link
Contributor

Choose a reason for hiding this comment

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

The SVG is somewhat sizeable but most of it should compress away over the wire. I think it would be good to also switch this over to the qrcode library when you work on the next iteration with dynamically generated QRs for the application password 😃

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Originally I added the qrcode.react library in the next draft PR #40613, but I agree it's better to just start using the library also to minimize the diffs. Added in 1e454cf and 9a30b9a

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,10 @@ import {
} from './components';
import {
EmailSentPage,
JetpackInstallStepperPage,
MobileAppInstallPage,
JetpackAlreadyInstalledPage,
} from './pages';
import './style.scss';
import { WrongUserConnectedPage } from './pages/WrongUserConnectedPage';
import { SETUP_TASK_HELP_ITEMS_FILTER } from '../../activity-panel/panels/help';

export const MobileAppModal = () => {
Expand Down Expand Up @@ -84,25 +83,6 @@ export const MobileAppModal = () => {
} }
/>
);
} else if ( state === JetpackPluginStates.NOT_OWNER_OF_CONNECTION ) {
setPageContent( <WrongUserConnectedPage /> );
} else if (
state === JetpackPluginStates.NOT_INSTALLED ||
state === JetpackPluginStates.NOT_ACTIVATED ||
state === JetpackPluginStates.USERLESS_CONNECTION ||
( state === JetpackPluginStates.FULL_CONNECTION &&
isReturningFromWordpressConnection )
) {
setPageContent(
<JetpackInstallStepperPage
isReturningFromWordpressConnection={
isReturningFromWordpressConnection
}
isRetryingMagicLinkSend={ isRetryingMagicLinkSend }
sendMagicLinkHandler={ sendMagicLink }
sendMagicLinkStatus={ magicLinkRequestStatus }
/>
);
} else if (
state === JetpackPluginStates.FULL_CONNECTION &&
jetpackConnectionData?.currentUser?.wpcomUser?.email &&
Expand All @@ -120,6 +100,9 @@ export const MobileAppModal = () => {
sendMagicLinkHandler={ sendMagicLink }
/>
);
} else {
// Shows the installation page by default.
setPageContent( <MobileAppInstallPage /> );
}
}, [
sendMagicLink,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { OPTIONS_STORE_NAME } from '@woocommerce/data';
import { ModalContentLayoutWithTitle } from '../layouts/ModalContentLayoutWithTitle';
import { SendMagicLinkButton } from '../components';
import { SendMagicLinkStates } from '../components/useSendMagicLink';
import { MobileAppInstallationInfo } from '../components/MobileAppInstallationInfo';

interface JetpackAlreadyInstalledPageProps {
wordpressAccountEmailAddress: string | undefined;
Expand Down Expand Up @@ -58,12 +59,13 @@ export const JetpackAlreadyInstalledPage: React.FC<
return (
<ModalContentLayoutWithTitle>
<>
<MobileAppInstallationInfo />
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you'll have to adjust the layout to fit the extra height

Uploading image.png…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm the screenshot seems to not have been uploaded, could you try uploading this again? 🤔

Copy link
Contributor

Choose a reason for hiding this comment

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

That's so weird that it linked to this PR.. 😵

There's a scrollbar, indicating that the content has overflowed

image

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point! I updated the styles in 6a3a94e so that this specific modal height fits to its content with a max height of 663px from my testing. Any other suggestions/improvements are welcome!

magic link available magic link unavailable
Screenshot 2023-10-06 at 1 34 43 PM Screenshot 2023-10-06 at 1 35 22 PM

<div className="modal-subheader jetpack-already-installed">
<h3>
{ sprintf(
/* translators: %s: user's WordPress.com account email address */
__(
'We’ll send a magic link to %s. Open it on your smartphone or tablet to sign into your store instantly.',
'After the app is installed, click below to send a magic link to %s. Open it on your smartphone or tablet to sign into your store instantly.',
'woocommerce'
),
wordpressAccountEmailAddress
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* Internal dependencies
*/
import { ModalContentLayoutWithTitle } from '../layouts/ModalContentLayoutWithTitle';
import { MobileAppInstallationInfo } from '../components/MobileAppInstallationInfo';

export const MobileAppInstallPage = () => {
return (
<ModalContentLayoutWithTitle>
<MobileAppInstallationInfo />
</ModalContentLayoutWithTitle>
);
};
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
export { EmailSentPage } from './EmailSentPage';
export { JetpackAlreadyInstalledPage } from './JetpackAlreadyInstalledPage';
export { JetpackInstallStepperPage } from './JetpackInstallStepperPage';
export { MobileAppInstallPage } from './MobileAppInstallPage';
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,14 @@
.modal-layout-body {
flex-grow: 1;
.modal-subheader {
margin-top: -16px;
margin-top: 16px;
margin-bottom: 24px;
h3 {
font-weight: 400;
color: #757575;
line-height: 1.6rem;
}
}
.modal-subheader.jetpack-already-installed {
margin-bottom: 48px; // there's a bit of space so space it out
}
}

.modal-layout-footer {
Expand Down Expand Up @@ -165,6 +162,7 @@ button.components-button.send-magic-link-button {
background: #007cba;
color: #fff;
position: relative;
margin-bottom: 1em;
:hover {
// the hover state makes the text invisible so we need to override it
color: #fff;
Expand Down
4 changes: 4 additions & 0 deletions plugins/woocommerce/changelog/update-mobile-onboarding-task
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Updated the Woo mobile onboarding modal to focus on app installation.