Template
Initial react editor Next.js template
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import type { RootConfig } from '@reacteditor/core';
|
||||
|
||||
export type RootProps = {
|
||||
title?: string;
|
||||
description?: string;
|
||||
};
|
||||
|
||||
export const Root: RootConfig<{ props: RootProps }> = {
|
||||
global: false,
|
||||
defaultProps: {
|
||||
title: 'Next.js Editor Starter',
|
||||
description: 'A minimal Next.js template powered by React Editor.',
|
||||
},
|
||||
fields: {
|
||||
title: { label: 'Page title', type: 'text' },
|
||||
description: { label: 'Meta description', type: 'textarea' },
|
||||
},
|
||||
render: ({ children }) => <>{children}</>,
|
||||
};
|
||||
|
||||
export default Root;
|
||||
@@ -0,0 +1,9 @@
|
||||
export const site = {
|
||||
name: 'Next.js Editor Starter',
|
||||
description: 'A minimal Next.js template powered by React Editor.',
|
||||
url:
|
||||
process.env.NEXT_PUBLIC_SITE_URL ??
|
||||
(process.env.VERCEL_PROJECT_PRODUCTION_URL
|
||||
? `https://${process.env.VERCEL_PROJECT_PRODUCTION_URL}`
|
||||
: 'http://localhost:3000'),
|
||||
};
|
||||
@@ -0,0 +1,19 @@
|
||||
import type { Config, Data } from '@reacteditor/core';
|
||||
import type { HeaderProps } from '@/components/website/header';
|
||||
import type { FooterProps } from '@/components/website/footer';
|
||||
import type { StarterProps } from '@/components/website/starter';
|
||||
import type { RootProps } from './root';
|
||||
|
||||
export type Components = {
|
||||
header: HeaderProps;
|
||||
footer: FooterProps;
|
||||
starter: StarterProps;
|
||||
};
|
||||
|
||||
export type UserConfig = Config<{
|
||||
components: Components;
|
||||
root: RootProps;
|
||||
categories: ['navigation', 'content'];
|
||||
}>;
|
||||
|
||||
export type UserData = Data<Components, RootProps>;
|
||||
Reference in New Issue
Block a user