Enabling reminder bar for both experiments and control
This commit is contained in:
parent
27cecd9b83
commit
8e04383fb0
|
@ -95,21 +95,32 @@ export const Header = ( { sections, isEmbedded = false, query } ) => {
|
||||||
}
|
}
|
||||||
}, [ isEmbedded, sections, siteTitle ] );
|
}, [ isEmbedded, sections, siteTitle ] );
|
||||||
|
|
||||||
const { hasTasksReminderFeature } = useSelect( ( select ) => {
|
const { activeSetuplist } = useSelect( ( select ) => {
|
||||||
const taskLists = select( ONBOARDING_STORE_NAME ).getTaskLists();
|
const taskLists = select( ONBOARDING_STORE_NAME ).getTaskLists();
|
||||||
|
|
||||||
|
const visibleSetupList = taskLists
|
||||||
|
.filter( ( list ) => list.isVisible )
|
||||||
|
.filter( ( list ) =>
|
||||||
|
[
|
||||||
|
'setup_experiment_1',
|
||||||
|
'setup_experiment_2',
|
||||||
|
'setup',
|
||||||
|
].includes( list.id )
|
||||||
|
);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
hasTasksReminderFeature: taskLists.some(
|
activeSetuplist: visibleSetupList.length
|
||||||
( list ) => list.id === 'setup_experiment_1'
|
? visibleSetupList[ 0 ].id
|
||||||
),
|
: null,
|
||||||
};
|
};
|
||||||
} );
|
} );
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={ className } ref={ headerElement }>
|
<div className={ className } ref={ headerElement }>
|
||||||
{ hasTasksReminderFeature && (
|
{ activeSetuplist && (
|
||||||
<TasksReminderBar
|
<TasksReminderBar
|
||||||
pageTitle={ pageTitle }
|
|
||||||
updateBodyMargin={ updateBodyMargin }
|
updateBodyMargin={ updateBodyMargin }
|
||||||
|
taskListId={ activeSetuplist }
|
||||||
/>
|
/>
|
||||||
) }
|
) }
|
||||||
<div className="woocommerce-layout__header-wrapper">
|
<div className="woocommerce-layout__header-wrapper">
|
||||||
|
|
|
@ -24,7 +24,6 @@ import './reminder-bar.scss';
|
||||||
|
|
||||||
type ReminderBarProps = {
|
type ReminderBarProps = {
|
||||||
taskListId: string;
|
taskListId: string;
|
||||||
pageTitle: string;
|
|
||||||
updateBodyMargin: () => void;
|
updateBodyMargin: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -83,7 +82,7 @@ const ReminderText: React.FC< ReminderTextProps > = ( {
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TasksReminderBar: React.FC< ReminderBarProps > = ( {
|
export const TasksReminderBar: React.FC< ReminderBarProps > = ( {
|
||||||
taskListId = 'setup_experiment_1',
|
taskListId,
|
||||||
updateBodyMargin,
|
updateBodyMargin,
|
||||||
} ) => {
|
} ) => {
|
||||||
const { updateOptions } = useDispatch( OPTIONS_STORE_NAME );
|
const { updateOptions } = useDispatch( OPTIONS_STORE_NAME );
|
||||||
|
|
Loading…
Reference in New Issue