mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Basic extension list view
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
e84984eb99
commit
8d99fa940d
@ -1,5 +1,5 @@
|
|||||||
import { RouteProps } from "react-router";
|
import { RouteProps } from "react-router";
|
||||||
import { buildURL } from "../../navigation";
|
import { buildURL } from "../../../common/utils/buildUrl";
|
||||||
|
|
||||||
export const extensionsRoute: RouteProps = {
|
export const extensionsRoute: RouteProps = {
|
||||||
path: "/extensions"
|
path: "/extensions"
|
||||||
|
|||||||
@ -1,3 +1,16 @@
|
|||||||
.Extensions {
|
.Extensions {
|
||||||
|
.content {
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.Badge.extension {
|
||||||
|
display: flex;
|
||||||
|
margin: 0;
|
||||||
|
padding: $padding $padding * 2;
|
||||||
|
|
||||||
|
.name {
|
||||||
|
color: $textColorAccent;
|
||||||
|
padding-bottom: $padding;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -4,18 +4,58 @@ import React from "react";
|
|||||||
import { Trans } from "@lingui/macro";
|
import { Trans } from "@lingui/macro";
|
||||||
import { observer } from "mobx-react";
|
import { observer } from "mobx-react";
|
||||||
import { PageLayout } from "../layout/page-layout";
|
import { PageLayout } from "../layout/page-layout";
|
||||||
|
import { Badge } from "../badge";
|
||||||
|
import { Button } from "../button";
|
||||||
|
|
||||||
@observer
|
@observer
|
||||||
export class Extensions extends React.Component {
|
export class Extensions extends React.Component {
|
||||||
disable() {
|
disable() {
|
||||||
|
}
|
||||||
|
|
||||||
|
renderExtensions() {
|
||||||
|
const extensions = [
|
||||||
|
{
|
||||||
|
id: "1",
|
||||||
|
name: "hello-world",
|
||||||
|
description: "Basic hello world example"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "2",
|
||||||
|
name: "light theme",
|
||||||
|
description: "Classic light theme for lens"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
if (!extensions.length) {
|
||||||
|
return (
|
||||||
|
<div className="flex align-center box grow justify-center gaps">
|
||||||
|
<span>There are no extensions found in</span>
|
||||||
|
<Badge>/.k8slens/extensions</Badge>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
return extensions.map(extension => {
|
||||||
|
const { id, name, description } = extension;
|
||||||
|
return (
|
||||||
|
<Badge key={id} className="extension flex gaps align-center justify-space-between">
|
||||||
|
<div>
|
||||||
|
<div className="name">
|
||||||
|
{name}
|
||||||
|
</div>
|
||||||
|
<div className="description">
|
||||||
|
{description}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<Button>Disable</Button>
|
||||||
|
</Badge>
|
||||||
|
)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const header = <h2><Trans>Extensions</Trans></h2>;
|
const header = <h2><Trans>Extensions</Trans></h2>;
|
||||||
return (
|
return (
|
||||||
<PageLayout showOnTop className="Extensions" header={header}>
|
<PageLayout showOnTop className="Extensions" header={header}>
|
||||||
<h2><Trans>List</Trans></h2>
|
{this.renderExtensions()}
|
||||||
</PageLayout>
|
</PageLayout>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user