mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Remove duplication from separators in application menu
Co-authored-by: Janne Savolainen <janne.savolainen@live.fi> Signed-off-by: Iku-turso <mikko.aspiala@gmail.com>
This commit is contained in:
parent
31de88dae4
commit
2446f62da1
@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
|
*/
|
||||||
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
|
import type { Separator } from "./application-menu-item-injection-token";
|
||||||
|
import applicationMenuItemInjectionToken from "./application-menu-item-injection-token";
|
||||||
|
|
||||||
|
const getApplicationMenuSeparatorInjectable = ({ id, ...rest }: { id: string } & Omit<Separator, "type">) =>
|
||||||
|
getInjectable({
|
||||||
|
id: `application-menu-separator/${id}`,
|
||||||
|
|
||||||
|
instantiate: () => ({
|
||||||
|
...rest,
|
||||||
|
type: "separator" as const,
|
||||||
|
}),
|
||||||
|
|
||||||
|
injectionToken: applicationMenuItemInjectionToken,
|
||||||
|
});
|
||||||
|
|
||||||
|
export { getApplicationMenuSeparatorInjectable };
|
||||||
@ -2,32 +2,19 @@
|
|||||||
* Copyright (c) OpenLens Authors. All rights reserved.
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
||||||
* Licensed under MIT License. See LICENSE in root directory for more information.
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
|
||||||
|
|
||||||
import applicationMenuItemInjectionToken from "../../application-menu-item-injection-token";
|
import {
|
||||||
|
getApplicationMenuSeparatorInjectable,
|
||||||
|
} from "../../get-application-menu-separator-injectable";
|
||||||
|
|
||||||
export const separatorAfterCheckForUpdatesInjectable = getInjectable({
|
export const separator1 = getApplicationMenuSeparatorInjectable({
|
||||||
id: "separator-after-check-for-updates",
|
id: "separator-1",
|
||||||
|
|
||||||
instantiate: () => ({
|
|
||||||
id: "separator-after-check-for-updates",
|
|
||||||
parentId: "primary-for-mac",
|
parentId: "primary-for-mac",
|
||||||
type: "separator" as const,
|
|
||||||
orderNumber: 30,
|
orderNumber: 30,
|
||||||
}),
|
|
||||||
|
|
||||||
injectionToken: applicationMenuItemInjectionToken,
|
|
||||||
});
|
});
|
||||||
|
|
||||||
export const separatorAfterExtensionsInjectable = getInjectable({
|
export const separator2 = getApplicationMenuSeparatorInjectable({
|
||||||
id: "separator-after-extensions",
|
id: "separator-2",
|
||||||
|
|
||||||
instantiate: () => ({
|
|
||||||
id: "separator-after-extensions",
|
|
||||||
parentId: "primary-for-mac",
|
parentId: "primary-for-mac",
|
||||||
type: "separator" as const,
|
|
||||||
orderNumber: 70,
|
orderNumber: 70,
|
||||||
}),
|
|
||||||
|
|
||||||
injectionToken: applicationMenuItemInjectionToken,
|
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user