Skip to content

Commit

Permalink
Merge pull request #8567 from google/enhance/#8381-remove-ads-bullet-…
Browse files Browse the repository at this point in the history
…point-como
  • Loading branch information
nfmohit authored Apr 17, 2024
2 parents b47fb7e + a3d34bd commit 266ef77
Showing 1 changed file with 29 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import { __, sprintf } from '@wordpress/i18n';
*/
import Data from 'googlesitekit-data';
import { CORE_MODULES } from '../../googlesitekit/modules/datastore/constants';
import { CORE_SITE } from '../../googlesitekit/datastore/site/constants';
import { listFormat, trackEvent } from '../../util';
import ModalDialog from '../ModalDialog';
import useViewContext from '../../hooks/useViewContext';
Expand All @@ -42,6 +43,10 @@ export default function ConfirmDisableConsentModeDialog( {
} ) {
const viewContext = useViewContext();

const isAdsConnected = useSelect( ( select ) =>
select( CORE_SITE ).isAdsConnected()
);

const dependentModuleNames = useSelect( ( select ) =>
[ 'analytics-4', 'ads' ].reduce( ( names, slug ) => {
if ( select( CORE_MODULES ).isModuleConnected( slug ) ) {
Expand Down Expand Up @@ -70,23 +75,36 @@ export default function ConfirmDisableConsentModeDialog( {
trackEvent( `${ viewContext }_CoMo`, 'view_modal' );
} );

let provides = [
__( 'Track how visitors interact with your site', 'google-site-kit' ),
];
let subtitle = __(
'Disabling consent mode may affect your ability in the European Economic Area and the United Kingdom to:',
'google-site-kit'
);

if ( isAdsConnected ) {
provides = [
__( 'Performance of your Ad campaigns', 'google-site-kit' ),
__(
'How visitors interact with your site via Analytics',
'google-site-kit'
),
];
subtitle = __(
'Disabling consent mode may affect your ability to track these in the European Economic Area and the United Kingdom:',
'google-site-kit'
);
}

return (
<ModalDialog
dialogActive
title={ __( 'Disable consent mode?', 'google-site-kit' ) }
subtitle={ __(
'Disabling consent mode may affect your ability to track these in the European Economic Area and the United Kingdom:',
'google-site-kit'
) }
subtitle={ subtitle }
handleConfirm={ onConfirm }
handleDialog={ onCancel }
provides={ [
__( 'Performance of your Ad campaigns', 'google-site-kit' ),
__(
'How visitors interact with your site via Analytics',
'google-site-kit'
),
] }
provides={ provides }
dependentModules={ dependentModulesText }
confirmButton={ __( 'Disable', 'google-site-kit' ) }
danger
Expand Down

0 comments on commit 266ef77

Please sign in to comment.