mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 14:57:26 +08:00
✨ Implement logic for the enable buttons checkbox
This commit is contained in:
parent
2eac7bc5c9
commit
5c371d928e
3 changed files with 37 additions and 12 deletions
|
@ -83,11 +83,14 @@ export const useStylingLocation = () => {
|
|||
};
|
||||
|
||||
export const useLocationProps = ( location ) => {
|
||||
const { getLocationProp, setLocationProp } = useHooks();
|
||||
const details = STYLING_LOCATIONS[ location ] ?? {};
|
||||
|
||||
return {
|
||||
choices: Object.values( STYLING_LOCATIONS ),
|
||||
details,
|
||||
isActive: getLocationProp( location, 'enabled' ),
|
||||
setActive: ( state ) => setLocationProp( location, 'enabled', state ),
|
||||
};
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue