-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathAppComponent.ts
More file actions
executable file
·50 lines (48 loc) · 1.73 KB
/
AppComponent.ts
File metadata and controls
executable file
·50 lines (48 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
import {img} from '@xh/hoist/cmp/layout';
import {tabContainer} from '@xh/hoist/cmp/tab';
import {webSocketIndicator} from '@xh/hoist/cmp/websocket';
import {hoistCmp, uses} from '@xh/hoist/core';
import {appBar, appBarSeparator} from '@xh/hoist/desktop/cmp/appbar';
import {panel} from '@xh/hoist/desktop/cmp/panel';
import {dynamicTabSwitcher} from '@xh/hoist/desktop/cmp/tab';
import {welcomeMsg} from '../core/cmp/WelcomeMsg';
// @ts-ignore
import xhLogo from '../core/img/xh-toolbox-logo.png';
import '../core/Toolbox.scss';
import './App.scss';
import {AppModel} from './AppModel';
export const AppComponent = hoistCmp({
displayName: 'App',
model: uses(AppModel),
render({model}) {
return panel({
tbar: appBar({
icon: img({src: xhLogo, onClick: () => model.goHome()}),
title: null,
leftItems: [dynamicTabSwitcher()],
rightItems: [
webSocketIndicator({iconOnly: true, marginRight: 4}),
appBarSeparator()
],
hideRefreshButton: false,
appMenuButtonProps: {
hideLogoutItem: false,
extraItems: [welcomeMsg({multiline: true})]
}
}),
hotkeys: [
{
label: 'Switch to the home tab',
combo: 'shift + h',
global: true,
onKeyDown: () => model.goHome()
}
],
item: tabContainer({
switcher: false,
childContainerProps: {switcher: {orientation: 'left', className: 'tb-switcher'}}
}),
mask: 'onLoad'
});
}
});