Last active
September 19, 2024 11:30
-
-
Save djcowan/b80ac5fe0610c2d9df0af973915e01d9 to your computer and use it in GitHub Desktop.
Wordpress BlockVariation Array<BlockVariation> Type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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