mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Explicitly initialize registries
- Helps moves towards turning on banning CyclicImports Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
1 parent
c18df6bcae
commit
6d10f011e5
101 files changed
+1178
-1087
No files matched your search
@@ -24,33 +24,10 @@ import React from "react";
|
||||
import { observer } from "mobx-react";
|
||||
import { Icon } from "../icon";
|
||||
import { productName, slackUrl } from "../../../common/vars";
|
||||
import { welcomeMenuRegistry } from "../../../extensions/registries";
|
||||
import { navigate } from "../../navigation";
|
||||
import { catalogURL, preferencesURL } from "../../../common/routes";
|
||||
import { WelcomeMenuRegistry } from "../../../extensions/registries";
|
||||
|
||||
@observer
|
||||
export class Welcome extends React.Component {
|
||||
|
||||
componentDidMount() {
|
||||
if (welcomeMenuRegistry.getItems().find((item) => item.title === "Browse Your Catalog")) {
|
||||
return;
|
||||
}
|
||||
|
||||
welcomeMenuRegistry.add({
|
||||
title: "Browse Your Catalog",
|
||||
icon: "view_list",
|
||||
click: () => navigate(catalogURL())
|
||||
});
|
||||
|
||||
if (welcomeMenuRegistry.getItems().length === 1) {
|
||||
welcomeMenuRegistry.add({
|
||||
title: "Configure Preferences",
|
||||
icon: "settings",
|
||||
click: () => navigate(preferencesURL())
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<div className="Welcome flex justify-center align-center">
|
||||
@@ -65,7 +42,7 @@ export class Welcome extends React.Component {
|
||||
</p>
|
||||
|
||||
<ul className="box">
|
||||
{ welcomeMenuRegistry.getItems().map((item, index) => (
|
||||
{WelcomeMenuRegistry.getInstance().getItems().map((item, index) => (
|
||||
<li key={index} className="flex grid-12" onClick={() => item.click()}>
|
||||
<Icon material={item.icon} className="box col-1" /> <a className="box col-10">{typeof item.title === "string" ? item.title : item.title()}</a> <Icon material="navigate_next" className="box col-1" />
|
||||
</li>
|
||||
|
||||
Reference in new issue
Block a user