mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Adding a extensions placeholder
Signed-off-by: Alex Andreev <alex.andreev.email@gmail.com>
This commit is contained in:
parent
32f612f673
commit
7dd4bc0028
@ -26,6 +26,10 @@
|
||||
.contentRegion {
|
||||
.content {
|
||||
max-width: 740px;
|
||||
|
||||
> section {
|
||||
height: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -589,6 +589,8 @@ export class Extensions extends React.Component {
|
||||
}
|
||||
|
||||
render() {
|
||||
const extensions = Array.from(ExtensionLoader.getInstance().userExtensions.values());
|
||||
|
||||
return (
|
||||
<DropFileInput onDropFiles={installOnDrop}>
|
||||
<PageLayout showOnTop className="Extensions" contentGaps={false}>
|
||||
@ -605,10 +607,10 @@ export class Extensions extends React.Component {
|
||||
installPath={this.installPath}
|
||||
/>
|
||||
|
||||
<hr/>
|
||||
{extensions.length && <hr/>}
|
||||
|
||||
<InstalledExtensions
|
||||
extensions={Array.from(ExtensionLoader.getInstance().userExtensions.values())}
|
||||
extensions={extensions}
|
||||
uninstall={confirmUninstallExtension}
|
||||
/>
|
||||
</section>
|
||||
|
||||
@ -13,4 +13,9 @@
|
||||
|
||||
.title {
|
||||
margin-bottom: 0!important;
|
||||
}
|
||||
|
||||
.noItemsIcon {
|
||||
@apply opacity-10;
|
||||
--size: 180px;
|
||||
}
|
||||
@ -1,7 +1,6 @@
|
||||
import styles from "./installed-extensions.module.css";
|
||||
import React, { useMemo } from "react";
|
||||
import { ExtensionDiscovery, InstalledExtension } from "../../../extensions/extension-discovery";
|
||||
import { ExtensionLoader } from "../../../extensions/extension-loader";
|
||||
import { Icon } from "../icon";
|
||||
import { List } from "../list/list";
|
||||
import { MenuActions, MenuItem } from "../menu";
|
||||
@ -20,12 +19,19 @@ function getStatus(isEnabled: boolean) {
|
||||
|
||||
export function InstalledExtensions({ extensions, uninstall }: Props) {
|
||||
if (!ExtensionDiscovery.getInstance().isLoaded) {
|
||||
return <div><Spinner /></div>;
|
||||
return <div><Spinner center /></div>;
|
||||
}
|
||||
|
||||
if (ExtensionLoader.getInstance().userExtensions.size == 0) {
|
||||
// TODO: Add placeholder
|
||||
return <div>No extensions</div>;
|
||||
if (extensions.length != 0) {
|
||||
return (
|
||||
<div className="flex column h-full items-center justify-center">
|
||||
<Icon material="extension" className={styles.noItemsIcon}/>
|
||||
<h3 className="font-medium text-3xl mt-5 mb-2">
|
||||
There are no extensions installed.
|
||||
</h3>
|
||||
<p>Please use the form above to install or drag tarbar-file here.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const filters = [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user