We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
File location: /packages/core/components/AutoField/index.tsx
Code Before Modification:
const defaultFields = { array: ArrayField, external: ExternalField, object: ObjectField, select: SelectField, textarea: TextareaField, radio: RadioField, text: DefaultField, number: DefaultField, };
Code after modification:
let defaultFields = { array: ArrayField, external: ExternalField, object: ObjectField, select: SelectField, textarea: TextareaField, radio: RadioField, text: DefaultField, number: DefaultField, ...overrides.defaultFields, };
Usage Example:
const overrides = { header: PanelHeader, fields: PanelFields, fieldTypes: { accordion: AccordionField }, defaultFields: { accordion: AccordionField }, }; export const AccordionField = ({ field, onChange, value, name, label, Label, readOnly, id, }) => { const { selectedItem } = usePuck(); if(!selectedItem) { return null; } if (field.type !== "accordion" || !field.objectFields) { return null; } let readOnlyFields = selectedItem.readOnly || {}; const data = value || {}; return ( <div label={label || name} icon={<MoreVertical size={16} />} el="div" readOnly={readOnly} > <div className={getClassName()}> ... </div> </div> )
The text was updated successfully, but these errors were encountered:
No branches or pull requests
File location: /packages/core/components/AutoField/index.tsx
Code Before Modification:
Code after modification:
Usage Example:
The text was updated successfully, but these errors were encountered: