mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Add prop id to content component
This commit is contained in:
parent
acfdb3d163
commit
23077a14ee
5 changed files with 23 additions and 12 deletions
|
@ -33,8 +33,10 @@ export const Header = ( { children, className = '' } ) => (
|
|||
);
|
||||
|
||||
// Card Elements
|
||||
export const Content = ( { children } ) => (
|
||||
<div className="ppcp-r-settings-card__content">{ children }</div>
|
||||
export const Content = ( { children, id = '' } ) => (
|
||||
<div id={ id } className="ppcp-r-settings-card__content">
|
||||
{ children }
|
||||
</div>
|
||||
);
|
||||
|
||||
export const ContentWrapper = ( { children } ) => (
|
||||
|
|
|
@ -7,13 +7,18 @@ const TodoSettingsBlock = ( { todosData, className = '' } ) => {
|
|||
<div
|
||||
className={ `ppcp-r-settings-block__todo ppcp-r-todo-items ${ className }` }
|
||||
>
|
||||
{ todosData.map( ( todo ) => (
|
||||
<TodoItem
|
||||
key={ todo.id }
|
||||
title={ todo.title }
|
||||
onClick={ todo.onClick }
|
||||
/>
|
||||
) ) }
|
||||
{ todosData
|
||||
.slice( 0, 5 )
|
||||
.filter( ( todo ) => {
|
||||
return ! todo.isCompleted();
|
||||
} )
|
||||
.map( ( todo ) => (
|
||||
<TodoItem
|
||||
key={ todo.id }
|
||||
title={ todo.title }
|
||||
onClick={ todo.onClick }
|
||||
/>
|
||||
) ) }
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -18,8 +18,10 @@ const SettingsCard = ( {
|
|||
if ( contentItems ) {
|
||||
return (
|
||||
<ContentWrapper>
|
||||
{ contentItems.map( ( item, index ) => (
|
||||
<Content key={ index }>{ item }</Content>
|
||||
{ contentItems.map( ( item ) => (
|
||||
<Content key={ item.key } id={ item.key }>
|
||||
{ item }
|
||||
</Content>
|
||||
) ) }
|
||||
</ContentWrapper>
|
||||
);
|
||||
|
|
|
@ -14,7 +14,6 @@ import Features from './TabSettingsElements/Blocks/Features';
|
|||
import { todosData } from '../../../data/settings/tab-overview-todos-data';
|
||||
|
||||
const TabOverview = () => {
|
||||
//const [ todosData ] = useState( todosDataDefault );
|
||||
const [ isRefreshing, setIsRefreshing ] = useState( false );
|
||||
|
||||
const { merchant } = useMerchantInfo();
|
||||
|
|
|
@ -46,5 +46,8 @@ export const todosData = [
|
|||
isCompleted: () => {
|
||||
return false;
|
||||
},
|
||||
onClick: () => {
|
||||
selectTab( TAB_IDS.OVERVIEW, 'pay_later_messaging' );
|
||||
},
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue