Skip to content

Instantly share code, notes, and snippets.

@djcowan
Last active September 19, 2024 11:30
Show Gist options
  • Save djcowan/b80ac5fe0610c2d9df0af973915e01d9 to your computer and use it in GitHub Desktop.
Save djcowan/b80ac5fe0610c2d9df0af973915e01d9 to your computer and use it in GitHub Desktop.
Wordpress BlockVariation Array<BlockVariation> Type
import { RiCellphoneLine, RiCheckboxLine, RiUserFollowLine, RiCheckLine, RiCalendarLine, RiPhoneLine, type RemixiconComponentType, } from '@remixicon/react';
import type { BlockVariation } from "@wordpress/blocks";
const variations: Array<BlockVariation> = [
{
isDefault: true,
scope: [ 'inserter', 'transform' ],
isActive: ( blockAttributes, variationAttributes ) =>
{
return blockAttributes?.metadata.name === variationAttributes?.metadata.name;
},
name: 'availability',
title: 'Availability',
icon: RiUserFollowLine,
attributes: {
metadata: { name: "Availability." },
value: false,
label: "Accepting new patients?"
},
},
{
isDefault: true,
scope: [ 'inserter', 'transform' ],
isActive: ( blockAttributes, variationAttributes ) =>
{
return blockAttributes.metadata.name === variationAttributes.metadata.name;
},
name: 'appointment',
title: 'Appointment',
icon: RiCalendarLine,
attributes: {
metadata: { name: "Appointment" },
value: false,
label: "Appoinment needed?"
},
},
{
isDefault: true,
scope: [ 'inserter', 'transform' ],
isActive: ( blockAttributes, variationAttributes ) =>
{
return blockAttributes?.metadata.name === variationAttributes?.metadata.name;
},
name: 'telehealth',
title: 'Telehealth',
icon: RiCheckboxLine,
attributes: {
metadata: {
name: "Telehealth."
},
value: false,
label: "Telehealth available?"
},
}
];
export default variations;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment