core-plugin-api: Deprecate use of extensions without name
Signed-off-by: Johan Haals <johan.haals@gmail.com>
This commit is contained in:
@@ -37,11 +37,14 @@ type RendererProps = { title: string } & ComponentParts;
|
||||
export function createCardExtension<T>({
|
||||
title,
|
||||
components,
|
||||
name,
|
||||
}: {
|
||||
title: string;
|
||||
components: () => Promise<ComponentParts>;
|
||||
name?: string;
|
||||
}) {
|
||||
return createReactExtension({
|
||||
name,
|
||||
component: {
|
||||
lazy: () =>
|
||||
components().then(({ Content, Actions, Settings, ContextProvider }) => {
|
||||
|
||||
@@ -71,6 +71,7 @@ export const ComponentTab = homePlugin.provide(
|
||||
*/
|
||||
export const WelcomeTitle = homePlugin.provide(
|
||||
createComponentExtension({
|
||||
name: 'WelcomeTitle',
|
||||
component: {
|
||||
lazy: () =>
|
||||
import('./homePageComponents/WelcomeTitle').then(m => m.WelcomeTitle),
|
||||
@@ -80,6 +81,7 @@ export const WelcomeTitle = homePlugin.provide(
|
||||
|
||||
export const HomePageRandomJoke = homePlugin.provide(
|
||||
createCardExtension<{ defaultCategory?: 'any' | 'programming' }>({
|
||||
name: 'HomePageRandomJoke',
|
||||
title: 'Random Joke',
|
||||
components: () => import('./homePageComponents/RandomJoke'),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user