-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example of builtin template, fix SubRoute
- Loading branch information
Showing
5 changed files
with
71 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
'use strict'; | ||
|
||
import React, {Component} from "react"; | ||
import {withComponentMixins} from "../lib/decorator-helpers"; | ||
import {withErrorHandling} from "../lib/error-handling"; | ||
import {withPageHelpers} from "../lib/page"; | ||
|
||
@withComponentMixins([ | ||
withErrorHandling, | ||
withPageHelpers, | ||
]) | ||
export default class HelloWorld extends Component { | ||
render() { | ||
return ( | ||
<div>{this.props.message}</div> | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
'use strict'; | ||
|
||
import em from '../lib/extension-manager'; | ||
import React from "react"; | ||
import HelloWorld from "./HelloWorld"; | ||
|
||
em.set('client.builtinTemplates.routes.hello', (panel, t, panelUrl, isFullscreen) => ({ | ||
// resolve: { ... }, | ||
panelRender: props => <HelloWorld panel={panel} panelUrl={panelUrl} message={panel.params.message} />, // message from panel configuration | ||
children: { | ||
':message': { | ||
link: params => `${panelUrl}/${params.message}`, | ||
panelRender: props => <HelloWorld panel={panel} panelUrl={panelUrl} message={props.params.message} />, // message from url parameter | ||
panelInFullScreen: isFullscreen, | ||
} | ||
} | ||
})); |