mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Restructure extension apis (#1101)
Signed-off-by: Jari Kolehmainen <jari.kolehmainen@gmail.com>
This commit is contained in:
1 parent
c566c85351
commit
d25e2f015b
14 files changed
+109
-53
No files matched your search
@@ -1,10 +1,10 @@
|
||||
import { Button, Icon, IconProps, LensRendererExtension } from "@lens/ui-extensions";
|
||||
import { Component, LensRendererExtension } from "@lens/ui-extensions";
|
||||
import { CoffeeDoodle } from "react-open-doodles";
|
||||
import path from "path";
|
||||
import React from "react"
|
||||
|
||||
export function ExtensionIcon(props: IconProps) {
|
||||
return <Icon {...props} material="pages" tooltip={path.basename(__filename)}/>
|
||||
export function ExtensionIcon(props: Component.IconProps) {
|
||||
return <Component.Icon {...props} material="pages" tooltip={path.basename(__filename)}/>
|
||||
}
|
||||
|
||||
export class ExtensionPage extends React.Component<{ extension: LensRendererExtension }> {
|
||||
@@ -22,7 +22,7 @@ export class ExtensionPage extends React.Component<{ extension: LensRendererExte
|
||||
<div style={doodleStyle}><CoffeeDoodle accent="#3d90ce" /></div>
|
||||
<p>Hello from Example extension!</p>
|
||||
<p>File: <i>{__filename}</i></p>
|
||||
<Button accent label="Deactivate" onClick={this.deactivate}/>
|
||||
<Component.Button accent label="Deactivate" onClick={this.deactivate}/>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DynamicPageType, LensRendererExtension, PageRegistry } from "@lens/ui-extensions";
|
||||
import { Registry, LensRendererExtension } from "@lens/ui-extensions";
|
||||
import { examplePage, ExtensionIcon } from "./page"
|
||||
|
||||
export default class ExampleExtension extends LensRendererExtension {
|
||||
@@ -6,10 +6,10 @@ export default class ExampleExtension extends LensRendererExtension {
|
||||
console.log('EXAMPLE EXTENSION RENDERER: ACTIVATED', this.getMeta());
|
||||
}
|
||||
|
||||
registerPages(registry: PageRegistry) {
|
||||
registerPages(registry: Registry.PageRegistry) {
|
||||
this.disposers.push(
|
||||
registry.add({
|
||||
type: DynamicPageType.CLUSTER,
|
||||
type: Registry.DynamicPageType.CLUSTER,
|
||||
path: "/extension-example",
|
||||
title: "Example Extension",
|
||||
components: {
|
||||
|
||||
Reference in new issue
Block a user