Skip to content

Commit 41fb347

Browse files
adekbadekdkoothomasguillot
authored
fix(reader-revenue-wizard): separate billing fields section (#3140)
Co-authored-by: Derrick Koo <[email protected]> Co-authored-by: Thomas Guillot <[email protected]>
1 parent fbdef39 commit 41fb347

File tree

6 files changed

+152
-130
lines changed

6 files changed

+152
-130
lines changed

assets/components/src/section-header/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import classnames from 'classnames';
2121
const SectionHeader = ( {
2222
centered = false,
2323
className = null,
24-
description,
24+
description = '',
2525
heading = 2,
2626
isWhite = false,
2727
noMargin = false,
@@ -56,7 +56,7 @@ const SectionHeader = ( {
5656
<Grid columns={ 1 } gutter={ 8 } className={ classes }>
5757
{ typeof title === 'string' && <HeadingTag>{ title }</HeadingTag> }
5858
{ typeof title === 'function' && <HeadingTag>{ title() }</HeadingTag> }
59-
{ typeof description === 'string' && <p>{ description }</p> }
59+
{ description && typeof description === 'string' && <p>{ description }</p> }
6060
{ typeof description === 'function' && <p>{ description() }</p> }
6161
</Grid>
6262
</div>

assets/components/src/wizard/store/index.js

+9-2
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,24 @@ const actions = {
5959
setError: createAction( 'SET_ERROR' ),
6060

6161
// Async actions. These will not show up in Redux devtools.
62-
*saveWizardSettings( { slug, section = '', payloadPath = false, updatePayload = null } ) {
62+
*saveWizardSettings( {
63+
slug,
64+
section = '',
65+
payloadPath = false,
66+
auxData = {},
67+
updatePayload = null,
68+
} ) {
6369
// Optionally data can be updated before saving - an immediate update case
6470
// (without an explicit "save" action).
6571
if ( updatePayload ) {
6672
yield actions.updateWizardSettings( { slug, ...updatePayload } );
6773
}
6874
const wizardState = select( WIZARD_STORE_NAMESPACE ).getWizardAPIData( slug );
75+
const data = payloadPath ? get( wizardState, payloadPath ) : wizardState;
6976
const updatedData = yield actions.fetchFromAPI( {
7077
path: `/newspack/v1/wizard/${ slug }/${ section }`,
7178
method: 'POST',
72-
data: payloadPath ? get( wizardState, payloadPath ) : wizardState,
79+
data: { ...data, ...auxData },
7380
isQuietFetch: true,
7481
} );
7582
if ( ! isEmpty( updatedData ) && ! updatedData.error ) {

assets/wizards/readerRevenue/components/money-input/style.scss

+5-2
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@
4444
}
4545

4646
&-container {
47-
p {
48-
margin: 0 0 8px;
47+
.input-label {
48+
font-size: 11px;
49+
font-weight: 500;
50+
line-height: 1.4;
51+
text-transform: uppercase;
4952
}
5053
}
5154

0 commit comments

Comments
 (0)