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

Design updates for Embedded Components #9381

Merged
merged 71 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 59 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
6fb21bd
WIP: Adding connect.js library for Stripe.
dmallory42 Aug 13, 2024
b3f2856
WIP: Adding JS resolvers for component.
dmallory42 Aug 13, 2024
e64e239
Merge remote-tracking branch 'origin/develop' into dev/include-connec…
dmallory42 Aug 13, 2024
e7c4719
Updates to the onboarding logic for embedded onboarding.
dmallory42 Aug 13, 2024
04f1cad
updates to the onboarding.
dmallory42 Aug 14, 2024
cce3a56
Removing the test publishable key which was originally from Stripe do…
dmallory42 Aug 14, 2024
a772281
WIP
Aug 16, 2024
c1e2a03
Change hooks call to useApiFetch call
Aug 16, 2024
5f92d50
Changes to make the functionality working
Aug 20, 2024
48aced0
label TODOs better
Aug 20, 2024
0395760
Remove not needed hooks
Aug 20, 2024
b76d623
Support publishableKey in `GET /onboarding/session`
Aug 21, 2024
9e409db
Merge branch 'develop' into dev/include-connect-js
dmallory42 Aug 21, 2024
313f187
Implemented PO and passing onboarding params to the server
Aug 21, 2024
a121e35
Merge with Dan
Aug 21, 2024
ef3b067
REmove not needed test
Aug 21, 2024
a4ee48d
Small refactoring
Aug 21, 2024
5870661
Fix unit tests
Aug 21, 2024
64c2d84
Merge branch 'develop' into dev/include-connect-js
oaratovskyi Aug 21, 2024
bf2b3eb
Add changelog
Aug 21, 2024
3c263ae
Remove not needed function
Aug 21, 2024
17807d0
Add loader
Aug 21, 2024
762b889
Add on load error handler
Aug 21, 2024
986c459
Add styling
Aug 21, 2024
186ad8a
Merge branch 'develop' into dev/include-connect-js
dmallory42 Aug 21, 2024
16ec5a3
Adding finalization logic and updating terminology to use american en…
dmallory42 Aug 22, 2024
3aab1da
Extract styles to separate component
Aug 22, 2024
0b488f9
Add localization
Aug 22, 2024
61dc892
Fix psalm errors
Aug 22, 2024
30a1fcc
Merge branch 'develop' into dev/include-connect-js
oaratovskyi Aug 23, 2024
af90385
Logic updates.
dmallory42 Aug 23, 2024
cdd8f48
Remove heading/subheading on embedded form.
dmallory42 Aug 24, 2024
1c02d75
Some fixes.
dmallory42 Aug 24, 2024
b3eefba
Updates to the logic.
dmallory42 Aug 25, 2024
1f695eb
Merge branch 'develop' into dev/include-connect-js
dmallory42 Aug 25, 2024
8c123d8
Updating to hide the back button once the embedded onboarding is reac…
dmallory42 Aug 29, 2024
7949a2a
Merge branch 'develop' into dev/include-connect-js
dmallory42 Aug 29, 2024
dcd0c21
Update to use american english
dmallory42 Aug 30, 2024
69f9d08
Update to use american english
dmallory42 Aug 30, 2024
1511ae9
Small fixes (order the dependencies and add locale only if account se…
Aug 30, 2024
290c6cf
Update to use american eng
Aug 30, 2024
6ea2e0d
Updates relating to passing promos to/from server.
dmallory42 Aug 30, 2024
11cec94
Add source/from args.
dmallory42 Aug 30, 2024
d4b750d
Update variable names.
dmallory42 Aug 30, 2024
fc76970
Add handling for error responses.
dmallory42 Aug 30, 2024
4dc7b46
Add handling for error responses.
dmallory42 Aug 30, 2024
eb2420a
Merge branch 'develop' into dev/include-connect-js
dmallory42 Aug 30, 2024
62c2dbb
Simple embedded onboarding test
Sep 4, 2024
6120c1c
Add success case of embedded onboarding
Sep 4, 2024
712bd82
Small tweak
Sep 4, 2024
8616837
Merge branch 'develop' into dev/include-connect-js
dmallory42 Sep 4, 2024
1db54a1
Design updates to match the i4 designs.
dmallory42 Sep 4, 2024
a4552ce
Design updates.
dmallory42 Sep 4, 2024
5f2bf01
Updates to the nav button colors.
dmallory42 Sep 6, 2024
698eb66
Updating to use theme colors.
dmallory42 Sep 6, 2024
831680a
Remove unneeded import.
dmallory42 Sep 6, 2024
2336b30
Update continue onboarding to use embedded component (#9380)
oaratovskyi Sep 6, 2024
a6156b9
Merge branch 'develop' into dev/include-connect-js
dmallory42 Sep 6, 2024
ab934b6
Update to the styling file to use the Woo Purple.
dmallory42 Sep 6, 2024
7f16908
Merge branch 'dev/include-connect-js' into dev/i4-design-updates
oaratovskyi Sep 6, 2024
380f50a
Make changes in continue kyc page
Sep 6, 2024
f06c824
Merge branch 'dev/i4-design-updates' of github.com:Automattic/woocomm…
dmallory42 Sep 16, 2024
1853145
Merge remote-tracking branch 'origin/develop' into dev/i4-design-updates
dmallory42 Sep 16, 2024
c99572f
Remove uneeded changelog entries.
dmallory42 Sep 16, 2024
da7716f
Update changelog.
dmallory42 Sep 16, 2024
4a27b66
remove unneeded change in merge commit.
dmallory42 Sep 16, 2024
3e52c22
Readd file lost in merge.
dmallory42 Sep 16, 2024
16c2fa7
Update to use Woo purple.
dmallory42 Sep 16, 2024
54936c4
Merge branch 'develop' into dev/i4-design-updates
oaratovskyi Sep 17, 2024
cfd8217
Use Guternberg Blueberry on MOX
Sep 19, 2024
2a7be62
Merge branch 'develop' into dev/i4-design-updates
oaratovskyi Sep 19, 2024
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: 13 additions & 0 deletions assets/images/woo-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions changelog/dev-include-connect-js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Change redirect to Stripe KYC to the embedded Stripe component
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: minor
Type: update

Update onboarding links to use embedded onboarding component
15 changes: 15 additions & 0 deletions client/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ import CapitalPage from 'capital';
import OverviewPage from 'overview';
import DocumentsPage from 'documents';
import OnboardingPage from 'onboarding';
import OnboardingKycPage from 'onboarding/kyc';
import FraudProtectionAdvancedSettingsPage from './settings/fraud-protection/advanced-settings';
import { getTasks } from 'overview/task-list/tasks';

Expand Down Expand Up @@ -69,6 +70,20 @@ addFilter(
capability: 'manage_woocommerce',
} );

pages.push( {
container: OnboardingKycPage,
path: '/payments/onboarding/kyc',
wpOpenMenu: menuID,
breadcrumbs: [
rootLink,
__( 'Continue onboarding', 'woocommerce-payments' ),
],
navArgs: {
id: 'wc-payments-continue-onboarding',
},
capability: 'manage_woocommerce',
} );

pages.push( {
container: OverviewPage,
path: '/payments/overview',
Expand Down
6 changes: 4 additions & 2 deletions client/onboarding/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { getMccFromIndustry } from 'onboarding/utils';
import { OnboardingForm } from './form';
import Step from './step';
import BusinessDetails from './steps/business-details';
import EmbeddedKyc from './steps/embedded-kyc';
import StoreDetails from './steps/store-details';
import LoadingStep from './steps/loading';
import { trackStarted } from './tracking';
import { getAdminUrl } from 'wcpay/utils';
import './style.scss';
Expand Down Expand Up @@ -47,7 +47,9 @@ const OnboardingStepper = () => {
<StoreDetails />
</OnboardingForm>
</Step>
<LoadingStep name="loading" />
<Step name="embedded" showHeading={ false }>
<EmbeddedKyc />
</Step>
</Stepper>
);
};
Expand Down
61 changes: 61 additions & 0 deletions client/onboarding/kyc/appearance.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/* eslint-disable max-len */

/**
* Customised appearance variables for the external KYC flow.
*/
export default {
variables: {
colorPrimary: '#3C2861',
colorBackground: '#FFFFFF',
buttonPrimaryColorBackground: '#3858E9',
buttonPrimaryColorBorder: '#3858E9',
buttonPrimaryColorText: '#FFFFFF',
buttonSecondaryColorBackground: '#FFFFFF',
buttonSecondaryColorBorder: '#3858E9',
buttonSecondaryColorText: '#3858E9',
colorText: '#101517',
colorSecondaryText: '#50575E',
actionPrimaryColorText: '#3858E9',
actionSecondaryColorText: '#101517',
colorBorder: '#DDDDDD',
formHighlightColorBorder: '#3858E9',
formAccentColor: '#3858E9',
colorDanger: '#CC1818',
offsetBackgroundColor: '#F0F0F0',
formBackgroundColor: '#FFFFFF',
badgeNeutralColorText: '#2C3338',
badgeNeutralColorBackground: '#F6F7F7',
badgeNeutralColorBorder: '#F6F7F7',
badgeSuccessColorText: '#005C12',
badgeSuccessColorBackground: '#EDFAEF',
badgeSuccessColorBorder: '#EDFAEF',
badgeWarningColorText: '#614200',
badgeWarningColorBackground: '#FCF9E8',
badgeWarningColorBorder: '#FCF9E8',
badgeDangerColorText: '#8A2424',
badgeDangerColorBackground: '#FCF0F1',
badgeDangerColorBorder: '#FCF0F1',
borderRadius: '2px',
buttonBorderRadius: '2px',
formBorderRadius: '2px',
badgeBorderRadius: '2px',
overlayBorderRadius: '8px',
spacingUnit: '10px',
fontFamily: 'SF Pro Text, Helvetica, Arial, sans-serif',
fontSizeBase: '16px',
headingXlFontSize: '32px',
headingXlFontWeight: '400',
headingLgFontSize: '24px',
headingLgFontWeight: '400',
headingMdFontSize: '20px',
headingMdFontWeight: '400',
headingSmFontSize: '16px',
headingSmFontWeight: '600',
headingXsFontSize: '12px',
headingXsFontWeight: '600',
bodyMdFontWeight: '400',
bodyMdFontSize: '16px',
bodySmFontSize: '14px',
bodySmFontWeight: '400',
},
};
77 changes: 77 additions & 0 deletions client/onboarding/kyc/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
/**
* External dependencies
*/
import React, { useEffect } from 'react';
import { closeSmall, Icon } from '@wordpress/icons';

/**
* Internal dependencies
*/
import Logo from 'assets/images/woopayments.svg';
import Page from 'components/page';
import { OnboardingContextProvider } from 'onboarding/context';
import EmbeddedKyc from 'onboarding/steps/embedded-kyc';
import strings from 'onboarding/strings';
import { getConnectUrl } from 'utils';

const OnboardingKycPage: React.FC = () => {
const handleExit = () => {
const urlParams = new URLSearchParams( window.location.search );

window.location.href = getConnectUrl(
{
source:
urlParams.get( 'source' )?.replace( /[^\w-]+/g, '' ) ||
'unknown',
},
'WCPAY_ONBOARDING_KYC'
);
};

useEffect( () => {
// Remove loading class and add those required for full screen.
document.body.classList.remove( 'woocommerce-admin-is-loading' );
document.body.classList.add( 'woocommerce-admin-full-screen' );
document.body.classList.add( 'is-wp-toolbar-disabled' );
document.body.classList.add( 'wcpay-onboarding__body' );

// Remove full screen classes on unmount.
return () => {
document.body.classList.remove( 'woocommerce-admin-full-screen' );
document.body.classList.remove( 'is-wp-toolbar-disabled' );
document.body.classList.remove( 'wcpay-onboarding__body' );
};
}, [] );
return (
<Page className="wcpay-onboarding-prototype">
<OnboardingContextProvider>
<div className="stepper__nav">
<button
type="button"
className={ `stepper__nav-button hide` }
>
{ strings.back }
</button>
<img
src={ Logo }
alt="WooPayments"
className="stepper__nav-logo"
/>
<button
type="button"
className="stepper__nav-button"
onClick={ handleExit }
>
<Icon icon={ closeSmall } />
</button>
</div>
<div className="stepper__wrapper">
<div className="stepper__content">
<EmbeddedKyc continueKyc={ true } />
</div>
</div>
</OnboardingContextProvider>
</Page>
);
};
export default OnboardingKycPage;
35 changes: 19 additions & 16 deletions client/onboarding/step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* External dependencies
*/
import React from 'react';
import { Icon, closeSmall } from '@wordpress/icons';
import ChevronLeft from 'gridicons/dist/chevron-left';

/**
Expand All @@ -12,14 +11,16 @@
import { OnboardingSteps } from './types';
import { useTrackAbandoned } from './tracking';
import strings from './strings';
import Logo from 'assets/images/woopayments.svg';
import WooLogo from 'assets/images/woo-logo.svg';
import './style.scss';
import { Button } from '@wordpress/components';

Check warning on line 16 in client/onboarding/step.tsx

View workflow job for this annotation

GitHub Actions / JS linting

'Button' is defined but never used

interface Props {
name: OnboardingSteps;
showHeading?: boolean;
}

const Step: React.FC< Props > = ( { name, children } ) => {
const Step: React.FC< Props > = ( { name, children, showHeading = true } ) => {
const { trackAbandoned } = useTrackAbandoned();
const { prevStep, exit } = useStepperContext();
const handleExit = () => {
Expand All @@ -36,32 +37,34 @@
<div className="stepper__nav">
<button
type="button"
className="stepper__nav-button"
className={ `stepper__nav-button ${
name === 'embedded' ? 'hide' : ''
}` }
onClick={ prevStep }
>
<ChevronLeft />
{ strings.back }
</button>
<img
src={ Logo }
alt="WooPayments"
className="stepper__nav-logo"
/>
<img src={ WooLogo } alt="Woo" className="stepper__nav-logo" />
<button
type="button"
className="stepper__nav-button"
onClick={ handleExit }
>
<Icon icon={ closeSmall } />
{ strings.cancel }
</button>
</div>
<div className="stepper__wrapper">
<h1 className="stepper__heading">
{ strings.steps[ name ].heading }
</h1>
<h2 className="stepper__subheading">
{ strings.steps[ name ].subheading }
</h2>
{ showHeading && (
<>
<h1 className="stepper__heading">
{ strings.steps[ name ].heading }
</h1>
<h2 className="stepper__subheading">
{ strings.steps[ name ].subheading }
</h2>
</>
) }
<div className="stepper__content">{ children }</div>
</div>
</>
Expand Down
Loading