Move icons to constants

This commit is contained in:
inpsyde-maticluznar 2024-12-23 07:43:43 +01:00
parent eeb0c63200
commit a78e11c8e8
No known key found for this signature in database
GPG key ID: D005973F231309F6
3 changed files with 15 additions and 5 deletions

View file

@ -1 +1,3 @@
export { default as openSignup } from './Icons/open-signup';
export const NOTIFICATION_SUCCESS = '✔️';
export const NOTIFICATION_ERROR = '❌';

View file

@ -4,6 +4,10 @@ import { ButtonSettingsBlock } from '../../../../../ReusableComponents/SettingsB
import { __ } from '@wordpress/i18n';
import { useDispatch } from '@wordpress/data';
import { store as noticesStore } from '@wordpress/notices';
import {
NOTIFICATION_ERROR,
NOTIFICATION_SUCCESS,
} from '../../../../../ReusableComponents/Icons';
const ResubscribeBlock = () => {
const { createSuccessNotice, createErrorNotice } =
@ -24,7 +28,7 @@ const ResubscribeBlock = () => {
'woocommerce-paypal-payments'
),
{
icon: '❌',
icon: NOTIFICATION_ERROR,
}
);
return;
@ -37,7 +41,7 @@ const ResubscribeBlock = () => {
'woocommerce-paypal-payments'
),
{
icon: '✔️',
icon: NOTIFICATION_SUCCESS,
}
);
};

View file

@ -4,6 +4,10 @@ import { ButtonSettingsBlock } from '../../../../../ReusableComponents/SettingsB
import { useDispatch } from '@wordpress/data';
import { store as noticesStore } from '@wordpress/notices';
import { CommonHooks } from '../../../../../../data';
import {
NOTIFICATION_ERROR,
NOTIFICATION_SUCCESS,
} from '../../../../../ReusableComponents/Icons';
const SimulationBlock = () => {
const {
@ -52,7 +56,7 @@ const SimulationBlock = () => {
'woocommerce-paypal-payments'
),
{
icon: '❌',
icon: NOTIFICATION_ERROR,
}
);
return;
@ -78,7 +82,7 @@ const SimulationBlock = () => {
'woocommerce-paypal-payments'
),
{
icon: '✔️',
icon: NOTIFICATION_SUCCESS,
}
);
stopSimulation();
@ -97,7 +101,7 @@ const SimulationBlock = () => {
'woocommerce-paypal-payments'
),
{
icon: '❌',
icon: NOTIFICATION_ERROR,
}
);
};