mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Add ExtensionCard component
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
0d27812298
commit
133c534469
@ -4,10 +4,30 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import React from "react";
|
import React from "react";
|
||||||
|
import { Button } from "../button";
|
||||||
import { Icon } from "../icon";
|
import { Icon } from "../icon";
|
||||||
import { SearchInput } from "../input";
|
import { SearchInput } from "../input";
|
||||||
|
|
||||||
|
interface Extension {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
description: string;
|
||||||
|
version: string;
|
||||||
|
downloads: number;
|
||||||
|
author: string;
|
||||||
|
iconUrl?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export function Install() {
|
export function Install() {
|
||||||
|
const extension: Extension = {
|
||||||
|
id: "resourcemap",
|
||||||
|
name: "Lens Resource Map",
|
||||||
|
description: "Lens Resource Map is an extension for Lens - The Kubernetes IDE that displays Kubernetes resources and their relations as a real-time force-directed graph.",
|
||||||
|
version: "1.0.1",
|
||||||
|
downloads: 12400,
|
||||||
|
author: "nevalla",
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section>
|
<section>
|
||||||
<h2><Icon material="add"/> Install Extensions</h2>
|
<h2><Icon material="add"/> Install Extensions</h2>
|
||||||
@ -21,6 +41,48 @@ export function Install() {
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2><Icon material="star"/> Featured Extensions</h2>
|
<h2><Icon material="star"/> Featured Extensions</h2>
|
||||||
|
|
||||||
|
<ExtensionList extensions={[extension]}/>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function ExtensionList({ extensions }: { extensions: Extension[] }) {
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{extensions.map(extension => <ExtensionCard key={extension.id} extension={extension}/>)}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
function ExtensionCard({ extension }: { extension: Extension }) {
|
||||||
|
const { name, version, downloads, description, author } = extension;
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="ExtensionCard">
|
||||||
|
<div className="head">
|
||||||
|
<div className="nameAndVersion">
|
||||||
|
<div className="name">{name}</div>
|
||||||
|
<div className="version">{version}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="downloads">
|
||||||
|
<Icon material="cloud_download"/> {downloads}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="description">
|
||||||
|
{description}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div className="footer">
|
||||||
|
<div className="author">
|
||||||
|
<img src="https://avatars.githubusercontent.com/u/455844?v=4"/> {author}
|
||||||
|
</div>
|
||||||
|
<div className="install">
|
||||||
|
<Button primary><Icon material="cloud_download"/> Install</Button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user