mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Add todo item click handler
This commit is contained in:
parent
3ec41d47ae
commit
bdb72d7ad0
2 changed files with 11 additions and 2 deletions
|
@ -8,7 +8,11 @@ const TodoSettingsBlock = ( { todosData, className = '' } ) => {
|
||||||
className={ `ppcp-r-settings-block__todo ppcp-r-todo-items ${ className }` }
|
className={ `ppcp-r-settings-block__todo ppcp-r-todo-items ${ className }` }
|
||||||
>
|
>
|
||||||
{ todosData.map( ( todo ) => (
|
{ todosData.map( ( todo ) => (
|
||||||
<TodoItem key={ todo.id } title={ todo.title } />
|
<TodoItem
|
||||||
|
key={ todo.id }
|
||||||
|
title={ todo.title }
|
||||||
|
onClick={ todo.onClick }
|
||||||
|
/>
|
||||||
) ) }
|
) ) }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -16,7 +20,7 @@ const TodoSettingsBlock = ( { todosData, className = '' } ) => {
|
||||||
|
|
||||||
const TodoItem = ( props ) => {
|
const TodoItem = ( props ) => {
|
||||||
return (
|
return (
|
||||||
<div className="ppcp-r-todo-item">
|
<div className="ppcp-r-todo-item" onClick={ props.onClick }>
|
||||||
<div className="ppcp-r-todo-item__inner">
|
<div className="ppcp-r-todo-item__inner">
|
||||||
<div className="ppcp-r-todo-item__icon"></div>
|
<div className="ppcp-r-todo-item__icon"></div>
|
||||||
<div className="ppcp-r-todo-item__description">
|
<div className="ppcp-r-todo-item__description">
|
||||||
|
|
|
@ -10,6 +10,7 @@ import FeatureSettingsBlock from '../../ReusableComponents/SettingsBlocks/Featur
|
||||||
import { TITLE_BADGE_POSITIVE } from '../../ReusableComponents/TitleBadge';
|
import { TITLE_BADGE_POSITIVE } from '../../ReusableComponents/TitleBadge';
|
||||||
import { useMerchantInfo } from '../../../data/common/hooks';
|
import { useMerchantInfo } from '../../../data/common/hooks';
|
||||||
import { STORE_NAME } from '../../../data/common';
|
import { STORE_NAME } from '../../../data/common';
|
||||||
|
import { updateQueryString } from '../../../utils/navigation';
|
||||||
|
|
||||||
const TabOverview = () => {
|
const TabOverview = () => {
|
||||||
const [ todosData ] = useState( todosDataDefault );
|
const [ todosData ] = useState( todosDataDefault );
|
||||||
|
@ -188,6 +189,10 @@ const todosDataDefault = [
|
||||||
isCompleted: () => {
|
isCompleted: () => {
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
|
onClick: ( event ) => {
|
||||||
|
event.preventDefault();
|
||||||
|
updateQueryString( { panel: 'payment-methods' } );
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'enable_credit_debit_cards',
|
id: 'enable_credit_debit_cards',
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue