work on home menu

This commit is contained in:
Géry Debongnie
2019-02-03 15:05:53 +01:00
parent b244ba7304
commit b292a66523
9 changed files with 228 additions and 93 deletions
+24 -2
View File
@@ -1,6 +1,28 @@
import { Widget } from "../core/widget";
import { Env } from "../env";
import { MenuInfo, ProcessedMenuItem } from "../misc/menu_helpers";
export class HomeMenu extends Widget<Env, {}> {
template = "web.home_menu";
//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------
export interface Props {
menuInfo: MenuInfo;
}
//------------------------------------------------------------------------------
// Home Menu
//------------------------------------------------------------------------------
export class HomeMenu extends Widget<Env, Props> {
template = "web.home_menu";
openApp(appId: number) {
debugger;
}
get apps(): ProcessedMenuItem[] {
const info = this.props.menuInfo;
return info.roots.map(root => info.menuMap[root]!);
}
}