update
This commit is contained in:
34
puck.config.tsx
Normal file
34
puck.config.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import type { Config } from "@puckeditor/core";
|
||||
|
||||
type Props = {
|
||||
HeadingBlock: { title: string };
|
||||
RichText: { content: string };
|
||||
};
|
||||
|
||||
const puckConfig: Config<Props> = {
|
||||
components: {
|
||||
HeadingBlock: {
|
||||
fields: {
|
||||
title: { type: "text" },
|
||||
},
|
||||
defaultProps: {
|
||||
title: "Heading",
|
||||
},
|
||||
render: ({ title }) => (
|
||||
<div style={{ padding: 64 }}>
|
||||
<h1>{title}</h1>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
RichText: {
|
||||
fields: {
|
||||
content: { type: "textarea" },
|
||||
},
|
||||
render: ({ content }) => (
|
||||
<div dangerouslySetInnerHTML={{ __html: content }} />
|
||||
),
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default puckConfig;
|
||||
Reference in New Issue
Block a user