Fix wrong code snippet
This commit is contained in:
@ -190,6 +190,8 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
|
|
||||||
const userProfileFormFieldComponentName = "UserProfileFormFields";
|
const userProfileFormFieldComponentName = "UserProfileFormFields";
|
||||||
|
|
||||||
|
const componentName = componentBasename.replace(/.tsx$/, "");
|
||||||
|
|
||||||
console.log(
|
console.log(
|
||||||
[
|
[
|
||||||
``,
|
``,
|
||||||
@ -207,10 +209,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
`// ...`,
|
`// ...`,
|
||||||
``,
|
``,
|
||||||
chalk.green(
|
chalk.green(
|
||||||
`+const ${componentBasename.replace(
|
`+const ${componentName} = lazy(() => import("./pages/${componentName}"));`
|
||||||
/.tsx$/,
|
|
||||||
""
|
|
||||||
)} = lazy(() => import("./pages/${componentBasename}"));`
|
|
||||||
),
|
),
|
||||||
...[
|
...[
|
||||||
``,
|
``,
|
||||||
@ -224,7 +223,7 @@ export async function command(params: { cliCommandOptions: CliCommandOptions })
|
|||||||
` switch (kcContext.pageId) {`,
|
` switch (kcContext.pageId) {`,
|
||||||
` // ...`,
|
` // ...`,
|
||||||
`+ case "${pageIdOrComponent}": return (`,
|
`+ case "${pageIdOrComponent}": return (`,
|
||||||
`+ <${componentBasename}`,
|
`+ <${componentName}`,
|
||||||
`+ {...{ kcContext, i18n, classes }}`,
|
`+ {...{ kcContext, i18n, classes }}`,
|
||||||
`+ Template={Template}`,
|
`+ Template={Template}`,
|
||||||
`+ doUseDefaultCss={true}`,
|
`+ doUseDefaultCss={true}`,
|
||||||
|
Reference in New Issue
Block a user