Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
import { createElement } from "react";
|
|
/**
|
|
* @typedef OwnProps
|
|
*
|
|
* @property {import('./types').IconKey} icon Icon name
|
|
* @property {string} [className] Class name
|
|
* @property {number} [size] Size of the icon
|
|
*/
|
|
|
|
/**
|
|
* Internal dependencies
|
|
*/
|
|
|
|
function Dashicon({
|
|
icon,
|
|
className,
|
|
size = 20,
|
|
style = {},
|
|
...extraProps
|
|
}) {
|
|
const iconClass = ['dashicon', 'dashicons', 'dashicons-' + icon, className].filter(Boolean).join(' ');
|
|
|
|
// For retro-compatibility reasons (for example if people are overriding icon size with CSS), we add inline styles just if the size is different to the default
|
|
const sizeStyles =
|
|
// using `!=` to catch both 20 and "20"
|
|
// eslint-disable-next-line eqeqeq
|
|
20 != size ? {
|
|
fontSize: `${size}px`,
|
|
width: `${size}px`,
|
|
height: `${size}px`
|
|
} : {};
|
|
const styles = {
|
|
...sizeStyles,
|
|
...style
|
|
};
|
|
return createElement("span", {
|
|
className: iconClass,
|
|
style: styles,
|
|
...extraProps
|
|
});
|
|
}
|
|
export default Dashicon;
|
|
//# sourceMappingURL=index.js.map
|