Skip to content

Commit

Permalink
fix: paymentSettingUrl localize name and update notice text.
Browse files Browse the repository at this point in the history
  • Loading branch information
MdAsifHossainNadim committed Jan 28, 2025
1 parent ad94988 commit 7b769c7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion includes/Withdraw/Hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function localize_withdraw_scripts() {
wp_localize_script(
'dokan-react-frontend',
'dokanWithdraw',
[ 'setUpUrl' => dokan_get_navigation_url( 'settings/payment' ) ]
[ 'paymentSettingUrl' => dokan_get_navigation_url( 'settings/payment' ) ]
);
}

Expand Down
26 changes: 14 additions & 12 deletions src/dashboard/Withdraw/RequestWithdrawBtn.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { __ } from '@wordpress/i18n';
import { __, sprintf } from '@wordpress/i18n';
import {
Button,
MaskedInput,
Expand Down Expand Up @@ -219,23 +219,25 @@ function RequestWithdrawBtn( {
</div>
</>
) : (
<SimpleAlert
type="warning"
color="orange"
>
{ __( 'No payment methods found to submit withdraw request. Please set up payment methods first. ', 'dokan-lite' ) }
<strong className={`cursor-pointer text-dokan-primary underline`}>
<a href={ dokanWithdraw?.setUpUrl }>
{ __( 'Payment Settings Setup', 'dokan-lite' ) }
</a>
</strong>
<SimpleAlert type="warning" color="orange">
<p className="mb-2" dangerouslySetInnerHTML={{
__html: sprintf(
/* translators: %s: opening and closing anchor tags for "payment methods" link */
__(
'No payment methods found to submit a withdrawal request. Please set up your %1$spayment methods%2$s first.',
'dokan-lite'
),
`<a href="${dokanWithdraw?.paymentSettingUrl}" class="cursor-pointer text-dokan-primary">`,
'</a>'
)
}}></p>
</SimpleAlert>
)}
</>
);
};

useEffect( () => {
useEffect(() => {
if ( settings?.data?.payment_methods.length > 0 ) {
setWithdrawMethod( settings?.data?.payment_methods[ 0 ].value );
}
Expand Down

0 comments on commit 7b769c7

Please sign in to comment.