AppLayout.js
1.79 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
51
52
53
54
55
import _ from 'lodash';
import { Meteor } from 'meteor/meteor';
import React, { Component } from 'react';
import { Link } from 'react-router';
import { Avatar } from '/imports/client/components/Avatar';
import { Icon } from '/imports/client/components/Icon';
import classNames from 'classnames';
import { EnterModule } from '/imports/client/views/org/enter/module/index';
// import { VerifyModule } from '/imports/client/views/verify/module/index';
import { Navbar,Modal, Nav, NavItem,
Glyphicon, Collapse,
NavbarToggler, NavbarBrand,
NavLink, DropdownItem, DropdownToggle, DropdownMenu,
NavDropdown, MenuItem, Breadcrumb } from 'react-bootstrap';
import { VerifyModule } from '/imports/client/views/verify/module/index'
import { AdminAppLayout } from '/imports/client/views/org/admin/AdminLayout'
var Accordion = require('react-bootstrap').Accordion;
var Panel = require('react-bootstrap').Panel;
export class AppLayout extends Component {
render() {
const {user, org} = this.props.data;
if(!user) {
return (
<EnterModule
pane = {this.props.location.query.enter}
location = {this.props.location}
/>
);
}
if(!user.isEmailVerified()) {
return (
<VerifyModule
pane = {this.props.location.query.verify}
location = {this.props.location}
/>
);
}
if(user.role==='ADMIN'){
return(
<AdminAppLayout
user = {user}
org = {org}
/>
);
}
return (
null
);
};
};