Forked from addisonschultz/generatePropertyControls.ts
Created
July 15, 2023 23:17
-
-
Save airandopal/427f9022bbf4327bae13d4e1b53916c8 to your computer and use it in GitHub Desktop.
Revisions
-
addisonschultz revised this gist
Jan 6, 2020 . No changes.There are no files selected for viewing
-
addisonschultz revised this gist
Jan 2, 2020 . No changes.There are no files selected for viewing
-
addisonschultz created this gist
Jan 2, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,23 @@ import { ControlType, PropertyControls } from "framer"; export function generatePropertyControls( options: { hidden?: (props: any) => boolean; omittedProperties?: string[]; } = {} ): PropertyControls { const properties: PropertyControls = { // Property Controls go here }; if (!!options.omittedProperties) { return Object.keys(properties).reduce<PropertyControls>((acc, key) => { if (options.omittedProperties.indexOf(key) === -1) { acc[key] = properties[key]; } return acc; }, {}); } return properties; }