refactor shopify storefront
This commit is contained in:
26
components/commerce/collection.editor.tsx
Normal file
26
components/commerce/collection.editor.tsx
Normal file
@@ -0,0 +1,26 @@
|
||||
import { ComponentConfig } from "@reacteditor/core";
|
||||
import { FolderOpen } from "lucide-react";
|
||||
import { CollectionView, type CollectionProps } from "@/components/commerce/collection";
|
||||
|
||||
export function createCollectionEditor(opts: {
|
||||
collectionField: any;
|
||||
}): ComponentConfig<CollectionProps> {
|
||||
return {
|
||||
label: "Collection page",
|
||||
icon: <FolderOpen size={16} />,
|
||||
category: "commerce",
|
||||
defaultProps: { collection: null, showDescription: "no" },
|
||||
fields: {
|
||||
collection: { label: "Collection", ...opts.collectionField },
|
||||
showDescription: {
|
||||
label: "Description",
|
||||
type: "radio",
|
||||
options: [
|
||||
{ label: "Hide description", value: "no" },
|
||||
{ label: "Show description", value: "yes" },
|
||||
],
|
||||
},
|
||||
},
|
||||
render: (props) => <CollectionView {...props} />,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user