🔀 Merge branch 'PCP-3834’

# Conflicts:
#	modules/ppcp-settings/resources/js/Components/Screens/Onboarding/StepWelcome.js
This commit is contained in:
Philipp Stracker 2024-11-05 18:42:32 +01:00
commit fd07038a76
No known key found for this signature in database
25 changed files with 499 additions and 72 deletions

View file

@ -1,7 +1,55 @@
@font-face {
font-family: 'PayPalPro';
src: url('../../fonts/PayPalPro-Black.otf') format('opentype');
font-weight: 900;
font-style: normal;
}
@font-face {
font-family: 'PayPalPro';
src: url('../../fonts/PayPalPro-BlackItalic.otf') format('opentype');
font-weight: 900;
font-style: italic;
}
@font-face {
font-family: 'PayPalPro';
src: url('../../fonts/PayPalPro-Bold.otf') format('opentype');
font-weight: bold;
font-style: normal;
}
@font-face {
font-family: 'PayPalPro';
src: url('../../fonts/PayPalPro-BoldItalic.otf') format('opentype');
font-weight: bold;
font-style: italic;
}
@font-face {
font-family: 'PayPalPro';
src: url('../../fonts/PayPalPro-Book.otf') format('opentype');
font-weight: 400;
font-style: normal;
}
@font-face {
font-family: 'PayPalPro';
src: url('../../fonts/PayPalPro-BookItalic.otf') format('opentype');
font-weight: 400;
font-style: italic;
}
* {
font-family: "Inter", sans-serif;
font-family: "PayPalPro", sans-serif;
-webkit-font-smoothing: antialiased;
box-sizing: border-box;
color: $color-gray-700;
}
h1, h2, h3, h4 {
color: $color-black;
}
a:not(.button) {

View file

@ -6,8 +6,9 @@ $color-gray-900: #1E1E1E;
$color-gray-800: #2F2F2F;
$color-gray-700: #757575;
$color-gray-600: #949494;
$color-gray-500: #BBBBBB;
$color-gray-500: #2c2c2c;
$color-gray-400: #CCCCCC;
$color-gray-300: #EBEBEB;
$color-gray-200: #E0E0E0;
$color-gray: #646970;

View file

@ -0,0 +1,37 @@
.ppcp-r-badge-box {
margin: 0 0 8px 0;
&__title {
@include font(14, 20, 700);
display: block;
margin: 0 0 8px 0;
.ppcp-r-badge-box__title-text {
color: #000;
&--big {
@include font(16, 28, 700);
}
&--small {
vertical-align: text-bottom;
}
}
&-image-badge {
margin-left: 7px;
img {
margin-left: 5px;
vertical-align: bottom;
height: 24px;
}
}
&--has-image-badge .ppcp-r-title-badge--info {
display: block;
margin: 6px 0px 0px 0px;
width: fit-content;
}
}
}

View file

@ -1,11 +1,7 @@
button.components-button, a.components-button {
&.is-primary, &.is-secondary {
&:not(:disabled) {
background-color: $color-blueberry;
&:hover {
background: $gradient-header;
}
background-color: $color-black;
}
&:disabled {

View file

@ -1,34 +1,19 @@
.ppcp-r-onboarding-header{
margin: 0 0 32px 0;
&__gradient {
background: $gradient-header;
width: 100%;
height: 112px;
position: relative;
margin-bottom: 55px;
&__logo {
text-align: center;
margin-bottom: 20px;
}
&__logo-wrapper {
width: 110px;
height: 110px;
background-color: $color-white;
border-radius: 110px;
position: absolute;
left: calc(50% - 55px);
bottom: -55px;
img {
width: 56px;
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 110px;
height: 38px;
}
}
&__content {
max-width: 458px;
margin: 0 auto;
display: flex;
flex-direction: column;
@ -37,15 +22,13 @@
}
&__title {
@include font(20, 28, 700);
color: $color-blue;
@include font(24, 32, 400);
margin: 0 0 4px 0;
text-align: center;
}
&__description {
color: $color-gray-800;
@include font(14, 20, 400);
@include font(14, 22, 400);
margin: 0;
text-align: center;
}

View file

@ -8,7 +8,7 @@
&-inner-container {
margin-left: auto;
margin-right: auto;
padding: 0 16px 72px;
padding: 0 16px 48px;
box-sizing: border-box;
@media screen and (max-width: 480px) {
@ -16,15 +16,6 @@
}
}
&-container {
box-shadow: $shadow-card;
}
&-card {
box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.15);
background-color: $color-white;
}
&-settings-card {
background-color: $color-white;
padding: 48px;

View file

@ -12,4 +12,8 @@
color:#5c0000;
background-color: #faeded;
}
&--info{
color: #2F2F2F;
background-color: #F5F5F5;
}
}

View file

@ -4,23 +4,27 @@
}
.ppcp-r-payment-method-icons {
margin: 0 0 12px 0;
margin: 0 0 32px 0;
}
.ppcp-r-button-activate-paypal {
display: block;
margin: 0 auto 32px auto;
margin: 0 auto;
}
.ppcp-r-button__description {
text-align: center;
}
.ppcp-r-page-welcome-or-separator {
margin: 0 0 32px 0;
margin: 0 0 16px 0;
}
.ppcp-r-page-welcome-mode-separator {
margin: 32px 0;
margin: 0 0 48px 0;
.ppcp-r-separator__line {
background-color: $color-gray-500;
background-color: $color-gray-300;
}
}
@ -46,14 +50,14 @@
gap: 4px;
> span {
@include font(11, 16, 600);
@include font(12, 16, 500);
text-transform: uppercase;
color: $color-gray-800;
}
> p {
margin: 0;
@include font(13, 16, 400);
@include font(11, 16, 450);
color: $color-gray-700;
}
@ -81,3 +85,69 @@
}
}
.ppcp-r-welcome-docs {
margin: 0 0 48px 0;
&__title {
text-align: center;
@include font(20, 28, 700);
margin: 0 0 32px 0;
}
&__description {
text-align: center;
@include font(14, 22, 400);
font-style: italic;
a {
color: $color-gray-700;
}
}
&__wrapper {
display: flex;
justify-content: center;
padding: 8px;
margin: 0 0 48px 0;
}
&__col {
display: flex;
flex-direction: column;
gap: 4px;
flex: 1;
> p {
margin: 0;
@include font(13, 16, 400);
color: $color-gray-700;
}
&:not(:last-child) {
padding-right: 48px;
border-right: 1px solid $color-gray-200;
margin-right: 48px;
}
}
.ppcp-r-page-welcome-mode-separator {
margin: 8px 0 16px 0;
}
@media screen and (max-width: 480px) {
flex-wrap: wrap;
row-gap: 8px;
&__col {
width: 100%;
text-align: center;
&:not(:last-child) {
border-bottom: 1px solid $color-gray-200;
border-right: 0;
padding-right: 0;
padding-bottom: 8px;
}
}
}
}

View file

@ -15,6 +15,7 @@
@import './components/reusable-components/navigation';
@import './components/reusable-components/fields';
@import './components/reusable-components/title-badge';
@import './components/reusable-components/_badge-box.scss';
@import './components/screens/onboarding';
@import './components/screens/dashboard/tab-dashboard';
}

View file

@ -0,0 +1,43 @@
import data from '../../utils/data';
import TitleBadge, {TITLE_BADGE_INFO} from "./TitleBadge";
import {__} from "@wordpress/i18n";
const BadgeBox = ( props ) => {
const titleSize = props.titleType && props.titleType === BADGE_BOX_TITLE_BIG ? BADGE_BOX_TITLE_BIG : BADGE_BOX_TITLE_SMALL
const titleTextClassName = 'ppcp-r-badge-box__title-text ' + `ppcp-r-badge-box__title-text--${titleSize}`;
const titleBaseClassName = 'ppcp-r-badge-box__title';
const titleClassName = props.imageBadge ? `${titleBaseClassName} ppcp-r-badge-box__title--has-image-badge` : titleBaseClassName;
return (
<div className="ppcp-r-badge-box">
<span className={titleClassName}>
<span className={titleTextClassName}>{props.title}</span>
{props.imageBadge && (
<span className="ppcp-r-badge-box__title-image-badge">
{props.imageBadge.map((badge) => data().getImage(badge))}
</span>
)}
{props.textBadge && (
<TitleBadge type={TITLE_BADGE_INFO} text={props.textBadge}/>
)}
</span>
<div className="ppcp-r-badge-box__description">
{props?.description && (
<p
className="ppcp-r-badge-box__description"
dangerouslySetInnerHTML={{
__html: props.description,
}}
></p>
)}
</div>
</div>
);
};
export const BADGE_BOX_TITLE_BIG = 'big';
export const BADGE_BOX_TITLE_SMALL = 'small';
export default BadgeBox;

View file

@ -3,7 +3,7 @@ import data from '../../utils/data';
const OnboardingHeader = ( props ) => {
return (
<section className="ppcp-r-onboarding-header">
<div className="ppcp-r-onboarding-header__gradient">
<div className="ppcp-r-onboarding-header__logo">
<div className="ppcp-r-onboarding-header__logo-wrapper">
{ data().getImage( 'logo-paypal.svg' ) }
</div>
@ -13,9 +13,10 @@ const OnboardingHeader = ( props ) => {
{ props.title }
</h1>
{ props.description && (
<p className="ppcp-r-onboarding-header__description">
{ props.description }
</p>
<p
className="ppcp-r-onboarding-header__description"
dangerouslySetInnerHTML={ { __html: props.description, } }
></p>
) }
</div>
</section>

View file

@ -1,8 +1,14 @@
const TitleBadge = ( { text, type } ) => {
const className = 'ppcp-r-title-badge ' + `ppcp-r-title-badge--${ type }`;
return <span className={ className }>{ text }</span>;
return <span
className={ className }
dangerouslySetInnerHTML={{
__html: text,
}}
></span>;
};
export const TITLE_BADGE_POSITIVE = 'positive';
export const TITLE_BADGE_NEGATIVE = 'negative';
export const TITLE_BADGE_INFO = 'info';
export default TitleBadge;

View file

@ -1,9 +1,12 @@
import { __ } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import { Button } from '@wordpress/components';
import OnboardingHeader from '../../ReusableComponents/OnboardingHeader';
import PaymentMethodIcons from '../../ReusableComponents/PaymentMethodIcons';
import Separator from '../../ReusableComponents/Separator';
import BadgeBox, {
BADGE_BOX_TITLE_BIG,
} from '../../ReusableComponents/BadgeBox';
import AdvancedOptionsForm from './Components/AdvancedOptionsForm';
const StepWelcome = ( { setStep, currentStep, setCompleted } ) => {
@ -15,13 +18,19 @@ const StepWelcome = ( { setStep, currentStep, setCompleted } ) => {
'woocommerce-paypal-payments'
) }
description={ __(
'Your all-in-one checkout solution with PayPal, Venmo, Pay Later, all major credit/debit cards, Apple Pay, Google Pay, and more.',
'Your all-in-one integration for PayPal checkout solutions that enable buyers<br/> to pay via PayPal, Pay Later, all major credit/debit cards, Apple Pay, Google Pay, and more.',
'woocommerce-paypal-payments'
) }
/>
<div className="ppcp-r-inner-container">
<PaymentMethodIcons icons="all" />
<WelcomeFeatures />
<PaymentMethodIcons icons="all" />
<p className="ppcp-r-button__description">
{ __(
`Click the button below to be guided through connecting your existing PayPal account or creating a new one.You will be able to choose the payment options that are right for your store.`,
'woocommerce-paypal-payments'
) }
</p>
<Button
className="ppcp-r-button-activate-paypal"
variant="primary"
@ -32,12 +41,10 @@ const StepWelcome = ( { setStep, currentStep, setCompleted } ) => {
'woocommerce-paypal-payments'
) }
</Button>
<Separator
className="ppcp-r-page-welcome-or-separator"
text={ __( 'or', 'woocommerce-paypal-payments' ) }
/>
<AdvancedOptionsForm setCompleted={ setCompleted } />
</div>
<Separator className="ppcp-r-page-welcome-mode-separator" />
<WelcomeDocs />
<AdvancedOptionsForm setCompleted={ setCompleted } />
</div>
);
};
@ -72,5 +79,219 @@ const WelcomeFeatures = () => {
</div>
);
};
const WelcomeDocs = () => {
const pricesBasedDescription = sprintf(
// translators: %s: Link to PayPal REST application guide
__(
'<sup>1</sup>Prices based on domestic transactions as of October 25th, 2024. <a target="_blank" href="%s">Click here</a> for full pricing details.',
'woocommerce-paypal-payments'
),
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
);
return (
<div className="ppcp-r-welcome-docs">
<h2 className="ppcp-r-welcome-docs__title">
{ __(
`Want to know more about PayPal Payments?`,
'woocommerce-paypal-payments'
) }
</h2>
<div className="ppcp-r-welcome-docs__wrapper">
<div className="ppcp-r-welcome-docs__col">
<BadgeBox
title={ __(
'PayPal Checkout',
'woocommerce-paypal-payments'
) }
titleType={ BADGE_BOX_TITLE_BIG }
textBadge={ __(
'from 3.49% + $0.49 USD<sup>1</sup>',
'woocommerce-paypal-payments'
) }
description={ __(
'Our all-in-one checkout solution lets you offer PayPal, Venmo, Pay Later options, and more to help maximise conversion',
'woocommerce-paypal-payments'
) }
/>
<BadgeBox
title={ __(
'Included in PayPal Checkout',
'woocommerce-paypal-payments'
) }
titleType={ BADGE_BOX_TITLE_BIG }
/>
<BadgeBox
title={ __(
'Pay with PayPal',
'woocommerce-paypal-payments'
) }
imageBadge={ [ 'icon-button-paypal.svg' ] }
description={ sprintf(
// translators: %s: Link to PayPal REST application guide
__(
'Our brand recognition helps give customers the confidence to buy. <a target="_blank" href="%s">Learn more</a>',
'woocommerce-paypal-payments'
),
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
) }
/>
<Separator className="ppcp-r-page-welcome-mode-separator" />
<BadgeBox
title={ __(
'Pay Later',
'woocommerce-paypal-payments'
) }
imageBadge={ [
'icon-payment-method-paypal-small.svg',
] }
description={ sprintf(
// translators: %s: Link to PayPal REST application guide
__(
'Offer installment payment options and get paid upfront - at no extra cost to you. <a target="_blank" href="%s">Learn more</a>',
'woocommerce-paypal-payments'
),
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
) }
/>
<Separator className="ppcp-r-page-welcome-mode-separator" />
<BadgeBox
title={ __( 'Venmo', 'woocommerce-paypal-payments' ) }
imageBadge={ [ 'icon-button-venmo.svg' ] }
description={ sprintf(
// translators: %s: Link to PayPal REST application guide
__(
'Automatically offer Venmo checkout to millions of active users. <a target="_blank" href="%s">Learn more</a>',
'woocommerce-paypal-payments'
),
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
) }
/>
<Separator className="ppcp-r-page-welcome-mode-separator" />
<BadgeBox
title={ __( 'Crypto', 'woocommerce-paypal-payments' ) }
imageBadge={ [ 'icon-payment-method-crypto.svg' ] }
description={ sprintf(
// translators: %s: Link to PayPal REST application guide
__(
'Let customers checkout with Crypto while you get paid in cash. <a target="_blank" href="%s">Learn more</a>',
'woocommerce-paypal-payments'
),
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
) }
/>
</div>
<div className="ppcp-r-welcome-docs__col">
<BadgeBox
title={ __(
'Optional payment methods',
'woocommerce-paypal-payments'
) }
titleType={ BADGE_BOX_TITLE_BIG }
description={ __(
'with additional application',
'woocommerce-paypal-payments'
) }
/>
<BadgeBox
title={ __(
'Custom Card Fields',
'woocommerce-paypal-payments'
) }
imageBadge={ [
'icon-button-visa.svg',
'icon-button-mastercard.svg',
'icon-button-amex.svg',
'icon-button-discover.svg',
] }
textBadge={ __(
'from 2.59% + $0.49 USD<sup>1</sup>',
'woocommerce-paypal-payments'
) }
description={ sprintf(
// translators: %s: Link to PayPal REST application guide
__(
'Style the credit card fields to match your own style. Includes advanced processing with risk management, 3D Secure, fraud protection options, and chargeback protection. <a target="_blank" href="%s">Learn more</a>',
'woocommerce-paypal-payments'
),
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
) }
/>
<Separator className="ppcp-r-page-welcome-mode-separator" />
<BadgeBox
title={ __(
'Digital Wallets',
'woocommerce-paypal-payments'
) }
imageBadge={ [
'icon-button-apple-pay.svg',
'icon-button-google-pay.svg',
] }
textBadge={ __(
'from 2.59% + $0.49 USD<sup>1</sup>',
'woocommerce-paypal-payments'
) }
description={ sprintf(
// translators: %s: Link to PayPal REST application guide
__(
'Accept Apple Pay on eligible devices and Google Pay through mobile and web. <a target="_blank" href="%s">Learn more</a>',
'woocommerce-paypal-payments'
),
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
) }
/>
<Separator className="ppcp-r-page-welcome-mode-separator" />
<BadgeBox
title={ __(
'Alternative Payment Methods',
'woocommerce-paypal-payments'
) }
imageBadge={ [
'icon-button-sepa.svg',
'icon-button-ideal.svg',
'icon-button-blik.svg',
'icon-button-bancontact.svg',
] }
textBadge={ __(
'from 3.49% + $0.49 USD<sup>1</sup>',
'woocommerce-paypal-payments'
) }
description={ sprintf(
// translators: %s: Link to PayPal REST application guide
__(
'Seamless payments for customers across the globe using their preferred payment methods. <a target="_blank" href="%s">Learn more</a>',
'woocommerce-paypal-payments'
),
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
) }
/>
<Separator className="ppcp-r-page-welcome-mode-separator" />
<BadgeBox
title={ __( '', 'woocommerce-paypal-payments' ) }
imageBadge={ [
'icon-payment-method-fastlane-small.svg',
] }
textBadge={ __(
'from 2.59% + $0.49 USD<sup>1</sup>',
'woocommerce-paypal-payments'
) }
description={ sprintf(
// translators: %s: Link to PayPal REST application guide
__(
'Speed up guest checkout with Fatslane. Link a customer\'s email address to their payment details. <a target="_blank" href="%s">Learn more</a>',
'woocommerce-paypal-payments'
),
'https://woocommerce.com/document/woocommerce-paypal-payments/#manual-credential-input '
) }
/>
</div>
</div>
<p
className="ppcp-r-welcome-docs__description"
dangerouslySetInnerHTML={ { __html: pricesBasedDescription } }
></p>
</div>
);
};
export default StepWelcome;