-
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.
- Loading branch information
Showing
15 changed files
with
622 additions
and
246 deletions.
There are no files selected for viewing
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
79 changes: 39 additions & 40 deletions
79
...tings/resources/js/Components/ReusableComponents/SettingsBlocks/PaymentMethodItemBlock.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
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
2 changes: 2 additions & 0 deletions
2
modules/ppcp-settings/resources/js/Components/ReusableComponents/TabNavigation.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
51 changes: 51 additions & 0 deletions
51
modules/ppcp-settings/resources/js/Components/Screens/Overview/Modals/Modal.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,51 @@ | ||
import { __ } from '@wordpress/i18n'; | ||
import ModalPayPal from './ModalPayPal'; | ||
import ModalFastlane from './ModalFastlane'; | ||
import ModalAcdc from './ModalAcdc'; | ||
import { useActiveModal } from '../../../../data/common/hooks'; | ||
|
||
export const MODAL_CONFIG = { | ||
paypal: { | ||
component: ModalPayPal, | ||
icon: 'payment-method-paypal-big', | ||
title: __( 'PayPal', 'woocommerce-paypal-payments' ), | ||
}, | ||
fastlane: { | ||
component: ModalFastlane, | ||
icon: 'payment-method-fastlane-big', | ||
title: __( 'Fastlane by PayPal', 'woocommerce-paypal-payments' ), | ||
size: 'small', | ||
}, | ||
advanced_credit_and_debit_card_payments: { | ||
component: ModalAcdc, | ||
icon: 'payment-method-cards-big', | ||
title: __( | ||
'Advanced Credit and Debit Card Payments', | ||
'woocommerce-paypal-payments' | ||
), | ||
}, | ||
}; | ||
|
||
const Modal = () => { | ||
const { activeModal, setActiveModal } = useActiveModal(); | ||
|
||
const handleCloseModal = () => { | ||
setActiveModal( '' ); | ||
}; | ||
|
||
if ( ! activeModal || ! MODAL_CONFIG[ activeModal ] ) { | ||
return null; | ||
} | ||
|
||
const { component: ModalComponent, ...modalProps } = | ||
MODAL_CONFIG[ activeModal ]; | ||
|
||
return ( | ||
<ModalComponent | ||
setModalIsVisible={ handleCloseModal } | ||
{ ...modalProps } | ||
/> | ||
); | ||
}; | ||
|
||
export default Modal; |
Oops, something went wrong.