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

feat: BNPL April announcement #8605

Merged
merged 42 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
2cfb816
feat: BNPL April announcement
frosso Apr 9, 2024
6af769f
centre aligns header and body text
FangedParakeet Apr 9, 2024
43e60ad
fixes text alignment, adds padding
FangedParakeet Apr 9, 2024
07d4a8e
actually fixes the alignment this time
FangedParakeet Apr 9, 2024
cb4c80e
places header below icons, centre aligns text
FangedParakeet Apr 10, 2024
f3e2ce5
uses pill icons for brands
FangedParakeet Apr 10, 2024
ff5d328
uses cropped affirm logo for lightbox
FangedParakeet Apr 10, 2024
7ca9f14
balances lightbox text content
FangedParakeet Apr 10, 2024
cb72178
WIP
frosso Apr 10, 2024
54efee9
WIP
frosso Apr 10, 2024
c163d50
Merge branch 'develop' into feat/bnpl-announcement-apr
frosso Apr 10, 2024
614d512
WIP
frosso Apr 10, 2024
e38e5a8
tests init
frosso Apr 10, 2024
d579b83
tests init
frosso Apr 10, 2024
c1094c2
tests init
frosso Apr 10, 2024
3781e23
tests init
frosso Apr 10, 2024
c555d9a
tests init
frosso Apr 10, 2024
41bedf2
tests init
frosso Apr 10, 2024
cf0da04
tests init
frosso Apr 10, 2024
85fe1ae
uses wc store country instead of stripe account country, fixes order …
FangedParakeet Apr 11, 2024
e1160d7
uses clearpay pill icon, fixes sizing, and alignment
FangedParakeet Apr 11, 2024
078b37c
reduces modal top margin, fixes modla element sizing for various mobi…
FangedParakeet Apr 11, 2024
1839dca
uses superior clearpay asset from issue description
FangedParakeet Apr 11, 2024
695c129
Merge branch 'develop' into feat/bnpl-announcement-apr
FangedParakeet Apr 11, 2024
5e2a621
no woo colors
frosso Apr 11, 2024
cf7707e
mobile adjustments
frosso Apr 11, 2024
1811005
country check uses cached data
frosso Apr 11, 2024
08aed69
country check uses cached data
frosso Apr 11, 2024
ead2702
wip
frosso Apr 11, 2024
34a7329
WIP
frosso Apr 11, 2024
08ffaa5
WIP
frosso Apr 11, 2024
c546988
Merge branch 'develop' into feat/bnpl-announcement-apr
frosso Apr 11, 2024
764e014
WIP
frosso Apr 11, 2024
7245620
WIP
frosso Apr 11, 2024
b53f337
WIP
frosso Apr 11, 2024
67ad12c
apply new designs, replaces payment method icons with new asset
FangedParakeet Apr 12, 2024
3338b45
changes display conditional order, checks all orders instead of just …
FangedParakeet Apr 12, 2024
a195d88
removes redundant icons and unused assets
FangedParakeet Apr 12, 2024
2d6238f
uses wp_add_inline_script instead of wp_localize_script
FangedParakeet Apr 12, 2024
0ae3901
fixes php linter issues
FangedParakeet Apr 12, 2024
a6beb65
Merge branch 'develop' into feat/bnpl-announcement-apr
FangedParakeet Apr 12, 2024
2cef5b6
moves asterisk placement to more grammatically correct position
FangedParakeet Apr 12, 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
Binary file added assets/images/bnpl_announcement_afterpay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/bnpl_announcement_clearpay.png
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/feat-bnpl-announcement-apr
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: add

feat: BNPL April announcement.
99 changes: 99 additions & 0 deletions client/bnpl-announcement/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
/**
* External dependencies
*/
import React, { useEffect, useState } from 'react';
import ReactDOM from 'react-dom';
import { __ } from '@wordpress/i18n';
import { Button, ExternalLink } from '@wordpress/components';
import { recordEvent } from 'tracks';

/**
* Internal dependencies
*/
import './style.scss';
import ConfirmationModal from 'wcpay/components/confirmation-modal';
import AfterpayBanner from 'assets/images/bnpl_announcement_afterpay.png?asset';
import ClearpayBanner from 'assets/images/bnpl_announcement_clearpay.png?asset';

const BannerIcon =
window.wcpayBnplAnnouncement?.accountCountry === 'GB'
? ClearpayBanner
: AfterpayBanner;

const Dialog = () => {
useEffect( () => {
recordEvent( 'wcpay_bnpl_april15_feature_announcement_view' );
}, [] );

const [ isHidden, setIsHidden ] = useState( false );

if ( isHidden ) return null;

return (
<ConfirmationModal
aria={ { labelledby: 'wcpay-bnpl-announcement' } }
className="wcpay-bnpl-announcement"
onRequestClose={ () => setIsHidden( true ) }
actions={
<>
<ExternalLink
onClick={ () => {
recordEvent(
'wcpay_bnpl_april15_feature_announcement_learn_click'
);
setIsHidden( true );
} }
href="https://woo.com/document/woopayments/payment-methods/buy-now-pay-later/"
>
{ __( 'Learn more', 'woocommerce-payments' ) }
</ExternalLink>
<Button
variant="primary"
onClick={ () => {
recordEvent(
'wcpay_bnpl_april15_feature_announcement_enable_click'
);
setIsHidden( true );
} }
>
{ __( 'Get started', 'woocommerce-payments' ) }
</Button>
</>
}
>
<div className="wcpay-bnpl-announcement__payment-icons">
<img
src={ BannerIcon }
alt={ __(
'Buy now, pay later is here',
'woocommerce-payments'
) }
></img>
</div>
<h1 id="wcpay-bnpl-announcement">
{ __( 'Buy now, pay later is here', 'woocommerce-payments' ) }
</h1>
<p>
{ __(
// eslint-disable-next-line max-len
'Boost conversions and give your shoppers additional buying power, with buy now, pay later — now available in your WooPayments dashboard.*',
'woocommerce-payments'
) }
</p>
<p className="wcpay-bnpl-announcement__fine-print">
{ __(
'*Subject to country availability',
'woocommerce-payments'
) }
</p>
</ConfirmationModal>
);
};

const container = document.getElementById( 'wpwrap' );
if ( container ) {
const dialogWrapper = document.createElement( 'div' );
container.appendChild( dialogWrapper );

ReactDOM.createRoot( dialogWrapper ).render( <Dialog /> );
}
68 changes: 68 additions & 0 deletions client/bnpl-announcement/style.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
.wcpay-bnpl-announcement {
&.wcpay-confirmation-modal.wcpay-confirmation-modal {
margin-top: auto;
height: auto;

@media screen and ( min-width: 600px ) {
max-width: 400px;
}

.components-modal__header {
padding: 0;

.components-button.has-icon {
position: absolute;
top: 18px;
left: auto;
right: 18px;
}
}

.components-modal__content {
padding: 0 20px 100px;
margin-top: 60px;

@media screen and ( min-width: 600px ) {
padding: 0 35px 24px;
}
}

.wcpay-confirmation-modal__separator {
opacity: 0;
}
}

&__payment-icons {
display: flex;
justify-content: center;
align-items: flex-start;
flex-wrap: wrap;
gap: 17px;
margin-bottom: 20px;

.payment-method__icon {
margin-right: 0;
max-height: 35px;
outline: none;

&[alt='Affirm'] {
max-height: 30px;
}
}
}

h1 {
text-align: left;
width: 100%;
}

p {
text-align: left;
}

.components-external-link {
padding: 6px 12px;
align-items: center;
display: flex;
}
}
12 changes: 6 additions & 6 deletions client/connect-account-page/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ import strings from './strings';
import './style.scss';
import InlineNotice from 'components/inline-notice';

const SandboxModeNotice = () => (
<BannerNotice icon status="warning" isDismissible={ false }>
{ strings.sandboxModeNotice }
</BannerNotice>
);

const ConnectAccountPage: React.FC = () => {
const firstName = wcSettings.admin?.currentUserData?.first_name;
const incentive = wcpaySettings.connectIncentive;
Expand All @@ -50,12 +56,6 @@ const ConnectAccountPage: React.FC = () => {

const isCountrySupported = !! availableCountries[ country ];

const SandboxModeNotice = () => (
<BannerNotice icon status="warning" isDismissible={ false }>
{ strings.sandboxModeNotice }
</BannerNotice>
);

useEffect( () => {
recordEvent( 'page_view', {
path: 'payments_connect_v2',
Expand Down
Loading
Loading