♻️ Minor code cleanup in PaymentMethodsBlock

This commit is contained in:
Philipp Stracker 2025-01-27 11:07:19 +01:00
parent e878deb66e
commit 7613babb7c
No known key found for this signature in database

View file

@ -1,11 +1,12 @@
import SettingsBlock from '../SettingsBlock';
import PaymentMethodItemBlock from './PaymentMethodItemBlock';
import { usePaymentMethods } from '../../../data/payment/hooks';
import { PaymentHooks } from '../../../data';
const PaymentMethodsBlock = ( { paymentMethods, onTriggerModal } ) => {
const { setPersistent } = usePaymentMethods();
// TODO: This is not a reusable component, as it's connected to the Redux store.
const PaymentMethodsBlock = ( { paymentMethods = [], onTriggerModal } ) => {
const { setPersistent } = PaymentHooks.useStore();
if ( ! paymentMethods?.length ) {
if ( ! paymentMethods.length ) {
return null;
}