Changes to directory structure

This commit is contained in:
Jeremy Rangel
2024-12-18 02:27:09 -08:00
parent d5a5f4e87b
commit 94d2c7c8a2
135 changed files with 335 additions and 5435 deletions

View File

@ -0,0 +1,25 @@
import { useBlockProps } from '@wordpress/block-editor';
export default function save(props) {
const { attributes } = props;
const { type, popUpId, buttonText, iconSvgPath } = attributes; // Destructure buttonText and iconSvgPath from attributes
// Get the block props for the button
const blockProps = useBlockProps.save();
// Conditionally add data-open-popup if type is 'openPopUp' and popUpId is not empty
if (type === 'openPopUp' && popUpId) {
blockProps['data-open-popup'] = popUpId; // Add the data attribute dynamically
}
return (
<button {...blockProps}>
{/* Conditionally render the icon if iconSvgPath is set */}
{iconSvgPath && (
<svg className="icon" viewBox="0 0 24 24" width="100" height="100" dangerouslySetInnerHTML={{ __html: iconSvgPath }} />
)}
{/* Render the button text */}
{buttonText || 'Button'} {/* Use buttonText or fallback */}
</button>
);
}