-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2763 from woocommerce/PCP-3816-Create-payment-pla…
…ceholder-page-in-new-settings-module Create payment placeholder page in new settings module (3816)
- Loading branch information
Showing
25 changed files
with
727 additions
and
1 deletion.
There are no files selected for viewing
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
modules/ppcp-settings/images/icon-checkout-alternative-methods.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions
9
modules/ppcp-settings/images/icon-checkout-online-methods.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions
48
modules/ppcp-settings/resources/css/components/reusable-components/_payment-method-item.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
.ppcp-r-payment-method-item { | ||
display: flex; | ||
align-items: center; | ||
|
||
&:not(:last-child) { | ||
padding-bottom: 32px; | ||
} | ||
|
||
&:not(:first-child) { | ||
border-top: 1px solid $color-gray-400; | ||
padding-top: 32px; | ||
} | ||
|
||
&__checkbox-wrap { | ||
position: relative; | ||
display: flex; | ||
align-items: center; | ||
|
||
.ppcp-r__checkbox { | ||
margin-right: 24px; | ||
} | ||
} | ||
|
||
&__icon-wrap { | ||
margin-right: 18px; | ||
} | ||
|
||
&__content { | ||
padding-right: 24px; | ||
|
||
p { | ||
margin: 0; | ||
} | ||
} | ||
|
||
&__title { | ||
@include font(16, 20, 600); | ||
color: $color-black; | ||
margin: 0 0 8px 0; | ||
display: block; | ||
} | ||
|
||
button { | ||
margin-left: auto; | ||
@include font(13, 20, 400); | ||
padding: 6px 12px !important; | ||
} | ||
} |
123 changes: 123 additions & 0 deletions
123
...les/ppcp-settings/resources/css/components/reusable-components/_payment-method-modal.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
.ppcp-r-modal { | ||
@import "../../global"; | ||
@import './button'; | ||
@import './fields'; | ||
|
||
&__container { | ||
max-width: 100%; | ||
width: 400px; | ||
|
||
&--small { | ||
padding: 0 50px; | ||
@media screen and (max-width: 480px){ | ||
padding:0; | ||
} | ||
} | ||
} | ||
|
||
.components-modal { | ||
&__header { | ||
height: 52px; | ||
padding: 20px 20px 0 20px; | ||
|
||
button { | ||
padding: 4px; | ||
} | ||
} | ||
|
||
&__content { | ||
margin-top: 48px; | ||
padding: 0 50px 48px 50px; | ||
} | ||
} | ||
|
||
&__header { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 8px; | ||
border-bottom: 1px solid $color-gray-500; | ||
padding-bottom: 12px; | ||
margin-bottom: 24px; | ||
} | ||
|
||
&__title { | ||
@include font(16, 20, 600); | ||
color: $color-black; | ||
} | ||
|
||
&__content { | ||
width: 400px; | ||
max-width: 100%; | ||
} | ||
|
||
&__inverted-toggle-control { | ||
.components-form-toggle { | ||
order: 1; | ||
} | ||
} | ||
|
||
&__field-row { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 8px; | ||
|
||
&--save { | ||
margin-top: 24px; | ||
align-items: flex-end; | ||
} | ||
|
||
|
||
input[type='text'] { | ||
padding: 7px 11px; | ||
@include font(14, 20, 400); | ||
margin: 0; | ||
border-color: $color-gray-700; | ||
} | ||
|
||
label { | ||
@include font(14, 16, 400); | ||
color: $color-gray-900; | ||
} | ||
} | ||
|
||
&__field-rows { | ||
display: flex; | ||
flex-direction: column; | ||
gap: 24px; | ||
|
||
&--acdc { | ||
gap: 18px; | ||
} | ||
} | ||
|
||
.ppcp-r-modal__field-row--save button.is-primary { | ||
border-radius: 2px; | ||
padding: 6px 12px; | ||
@include font(13, 20, 400); | ||
} | ||
|
||
&__content-title { | ||
@include font(14, 20, 600); | ||
color: $color-black; | ||
display: block; | ||
margin: 0 0 4px 0; | ||
} | ||
|
||
&__description { | ||
@include font(14, 20, 400); | ||
margin: 0 0 24px 0; | ||
color: $color-black; | ||
} | ||
|
||
&__field-rdb { | ||
display: flex; | ||
gap: 18px; | ||
align-items: center; | ||
position: relative; | ||
label { | ||
@include font(14, 20, 400); | ||
color: $color-black; | ||
} | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
modules/ppcp-settings/resources/css/components/screens/dashboard/_tab-payment-methods.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.ppcp-r-payment-methods{ | ||
display: flex; | ||
flex-direction: column; | ||
gap:48px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
modules/ppcp-settings/resources/js/Components/ReusableComponents/PaymentMethodItem.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
import { Button } from '@wordpress/components'; | ||
import PaymentMethodIcon from './PaymentMethodIcon'; | ||
import { PayPalCheckbox } from './Fields'; | ||
import { useState } from '@wordpress/element'; | ||
import { __ } from '@wordpress/i18n'; | ||
|
||
const PaymentMethodItem = ( props ) => { | ||
const [ paymentMethodState, setPaymentMethodState ] = useState(); | ||
const [ modalIsVisible, setModalIsVisible ] = useState( false ); | ||
let Modal = null; | ||
if ( props?.modal ) { | ||
Modal = props.modal; | ||
} | ||
const handleCheckboxState = ( checked ) => { | ||
if ( checked ) { | ||
setPaymentMethodState( props.payment_method_id ); | ||
} else { | ||
setPaymentMethodState( null ); | ||
} | ||
}; | ||
return ( | ||
<> | ||
<div className="ppcp-r-payment-method-item"> | ||
<div className="ppcp-r-payment-method-item__checkbox-wrap"> | ||
<PayPalCheckbox | ||
currentValue={ [ paymentMethodState ] } | ||
name="payment_method_status" | ||
value={ props.payment_method_id } | ||
handleCheckboxState={ handleCheckboxState } | ||
/> | ||
<div className="ppcp-r-payment-method-item__icon-wrap"> | ||
<PaymentMethodIcon | ||
icons={ [ props.icon ] } | ||
type={ props.icon } | ||
/> | ||
</div> | ||
<div className="ppcp-r-payment-method-item__content"> | ||
<span className="ppcp-r-payment-method-item__title"> | ||
{ props.title } | ||
</span> | ||
<p>{ props.description }</p> | ||
</div> | ||
</div> | ||
{ Modal && ( | ||
<Button | ||
variant="secondary" | ||
onClick={ () => { | ||
setModalIsVisible( true ); | ||
} } | ||
> | ||
{ __( 'Modify', 'woocommerce-paypal-payments' ) } | ||
</Button> | ||
) } | ||
</div> | ||
{ Modal && modalIsVisible && ( | ||
<Modal setModalIsVisible={ setModalIsVisible } /> | ||
) } | ||
</> | ||
); | ||
}; | ||
|
||
export default PaymentMethodItem; |
35 changes: 35 additions & 0 deletions
35
modules/ppcp-settings/resources/js/Components/ReusableComponents/PaymentMethodModal.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import { Modal } from '@wordpress/components'; | ||
import PaymentMethodIcon from './PaymentMethodIcon'; | ||
|
||
const PaymentMethodModal = ( props ) => { | ||
let className = 'ppcp-r-modal'; | ||
let classNameContainer = 'ppcp-r-modal__container'; | ||
|
||
if ( props?.className ) { | ||
className += ' ' + props.className; | ||
} | ||
|
||
if ( props?.container && props.container === 'small' ) { | ||
classNameContainer += ' ppcp-r-modal__container--small'; | ||
} | ||
|
||
return ( | ||
<Modal | ||
className={ className } | ||
onRequestClose={ () => props.setModalIsVisible( false ) } | ||
> | ||
<div className={ classNameContainer }> | ||
<div className="ppcp-r-modal__header"> | ||
<PaymentMethodIcon | ||
icons={ [ props.icon ] } | ||
type={ props.icon } | ||
/> | ||
<span className="ppcp-r-modal__title">{ props.title }</span> | ||
</div> | ||
<div className="ppcp-r-modal__content">{ props.children }</div> | ||
</div> | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default PaymentMethodModal; |
Oops, something went wrong.