-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expand file tree
/
Copy pathSideMenu.tsx
More file actions
27 lines (25 loc) · 941 Bytes
/
SideMenu.tsx
File metadata and controls
27 lines (25 loc) · 941 Bytes
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
import React, { Component } from 'react';
import { connect } from '../connect';
import { ComponentProps } from '../ComponentProps';
import { LayoutComponent } from './LayoutComponent';
import ParentNode from '../Layouts/ParentNode';
export const SideMenuRoot = connect(
class extends Component<ComponentProps> {
render() {
const children = this.props.layoutNode.children;
return children.map((child: ParentNode) => {
return <LayoutComponent key={child.nodeId} layoutNode={child} />;
});
}
}
);
const SideMenuComponent = connect(class extends Component<ComponentProps> {
render() {
const children = this.props.layoutNode.children;
const component = children[0];
return <LayoutComponent key={component.nodeId} layoutNode={component} />;
}
});
export const SideMenuLeft = SideMenuComponent;
export const SideMenuCenter = SideMenuComponent;
export const SideMenuRight = SideMenuComponent;