From d9bf5e5cefa149660eb1fa9f9c093e8a665d6e5a Mon Sep 17 00:00:00 2001 From: Joshua Dinh Date: Mon, 16 Dec 2024 12:23:59 +0900 Subject: [PATCH] refactor: update defaultCampaignModalContent --- .../components/DonationFormsRowActions.tsx | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/src/DonationForms/V2/resources/components/DonationFormsRowActions.tsx b/src/DonationForms/V2/resources/components/DonationFormsRowActions.tsx index 88004523ec..3b85c52c63 100644 --- a/src/DonationForms/V2/resources/components/DonationFormsRowActions.tsx +++ b/src/DonationForms/V2/resources/components/DonationFormsRowActions.tsx @@ -6,6 +6,8 @@ import {useContext} from 'react'; import {ShowConfirmModalContext} from '@givewp/components/ListTable/ListTablePage'; import {Interweave} from 'interweave'; import {UpgradeModalContent} from './Migration'; +import {createInterpolateElement} from '@wordpress/element'; + const donationFormsApi = new ListTableApi(window.GiveDonationForms); @@ -34,7 +36,7 @@ export function DonationFormsRowActions({data, item, removeRow, addRow, setUpdat const confirmTrashForm = (selected) => (

- {__('Really trash the following form?', 'give')} + {__('Are you sure you want to trash the following donation form? ', 'give')}

@@ -60,16 +62,17 @@ export function DonationFormsRowActions({data, item, removeRow, addRow, setUpdat const isCampaignDetailsPage = urlParams.get('id') && urlParams.get('page') && 'give-campaigns' === urlParams.get('page'); + const defaultCampaignModalContent = createInterpolateElement( + __('This will set as the default form for this campaign. Do you want to proceed?', 'give'), + { + title_link: , + } + ); + const confirmDefaultCampaignFormModal = (event) => { showConfirmModal( __('Make as default', 'give'), - (selected) => ( -

- {__('Really make the following campaign form default?', 'give')} -
- -

- ), + (selected) =>

{defaultCampaignModalContent}

, async () => { await entity.edit({ defaultFormId: item.id