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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* External dependencies
*/
import { __ } from '@wordpress/i18n';
import { QRCodeSVG } from 'qrcode.react';

export const MobileAppInstallationInfo = () => {
return (
<div>
<QRCodeSVG
value={
'https://woocommerce.com/mobile/?utm_source=wc_onboarding_mobile_task'
}
size={ 140 }
/>
<p>
{ __(
'Scan the code above to download the WooCommerce mobile app, or visit woocommerce.com/mobile from your mobile device.',
'woocommerce'
) }
</p>
</div>
);
};
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 @@ -13,7 +13,8 @@
.components-guide.woocommerce__mobile-app-welcome-modal {
max-width: 964px;
min-width: 534px;
height: 600px;
// Overrides the default modal max-height.
max-height: 663px;

.components-modal__header {
height: 0;
Expand Down Expand Up @@ -51,17 +52,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 +163,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
1 change: 1 addition & 0 deletions plugins/woocommerce-admin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@
"history": "^5.3.0",
"lodash": "^4.17.21",
"memize": "^1.1.0",
"qrcode.react": "^3.1.0",
"qs": "^6.10.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
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.
11 changes: 11 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.