Replacing condition depending on pageTitle due to translation issues

This commit is contained in:
Joel T 2022-04-13 16:24:55 -07:00
parent 932571c839
commit 0ec373734f
1 changed files with 7 additions and 9 deletions

View File

@ -14,6 +14,7 @@ import { getAdminLink } from '@woocommerce/settings';
import { close as closeIcon } from '@wordpress/icons'; import { close as closeIcon } from '@wordpress/icons';
import interpolateComponents from '@automattic/interpolate-components'; import interpolateComponents from '@automattic/interpolate-components';
import { useEffect } from '@wordpress/element'; import { useEffect } from '@wordpress/element';
import { getQuery } from '@woocommerce/navigation';
/** /**
* Internal dependencies * Internal dependencies
@ -66,7 +67,6 @@ const ReminderText: React.FC< ReminderTextProps > = ( { remainingCount } ) => {
export const TasksReminderBar: React.FC< ReminderBarProps > = ( { export const TasksReminderBar: React.FC< ReminderBarProps > = ( {
taskListId = 'setup_experiment_1', taskListId = 'setup_experiment_1',
pageTitle,
updateBodyMargin, updateBodyMargin,
} ) => { } ) => {
const { updateOptions } = useDispatch( OPTIONS_STORE_NAME ); const { updateOptions } = useDispatch( OPTIONS_STORE_NAME );
@ -119,20 +119,18 @@ export const TasksReminderBar: React.FC< ReminderBarProps > = ( {
}; };
} ); } );
const isHomescreen =
getQuery().page && getQuery().page === 'wc-admin' && ! getQuery().path;
const isActiveTaskPage = Boolean( getQuery().wc_onboarding_active_task );
const hideReminderBar = const hideReminderBar =
loading || loading ||
taskListHidden || taskListHidden ||
taskListComplete || taskListComplete ||
reminderBarHidden || reminderBarHidden ||
completedTasksCount === 0 || completedTasksCount === 0 ||
[ isHomescreen ||
'Home', isActiveTaskPage;
'Shipping',
'Tax',
'Payments',
'Edit Product',
'Add New',
].includes( pageTitle );
useEffect( () => { useEffect( () => {
updateBodyMargin(); updateBodyMargin();