|
|
@ -30,6 +30,7 @@ import Feedback from 'material-ui/svg-icons/action/feedback';
|
|
|
|
import DevicesOther from 'material-ui/svg-icons/hardware/devices-other';
|
|
|
|
import DevicesOther from 'material-ui/svg-icons/hardware/devices-other';
|
|
|
|
import NotificationsIcon from 'material-ui/svg-icons/social/notifications';
|
|
|
|
import NotificationsIcon from 'material-ui/svg-icons/social/notifications';
|
|
|
|
import ActionAccountCircle from 'material-ui/svg-icons/action/account-circle';
|
|
|
|
import ActionAccountCircle from 'material-ui/svg-icons/action/account-circle';
|
|
|
|
|
|
|
|
import FlatButton from 'material-ui/FlatButton';
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Base Layout:
|
|
|
|
* Base Layout:
|
|
|
@ -39,12 +40,9 @@ import ActionAccountCircle from 'material-ui/svg-icons/action/account-circle';
|
|
|
|
* */
|
|
|
|
* */
|
|
|
|
class BaseLayout extends Component {
|
|
|
|
class BaseLayout extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
constructor() {
|
|
|
|
constructor(props) {
|
|
|
|
super();
|
|
|
|
super(props);
|
|
|
|
this.state = {
|
|
|
|
this.state = this.props.state;
|
|
|
|
notifications: 0,
|
|
|
|
|
|
|
|
user: 'Admin'
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentWillMount() {
|
|
|
|
componentWillMount() {
|
|
|
@ -55,25 +53,6 @@ class BaseLayout extends Component {
|
|
|
|
this.handleHistory('/assets/apps');
|
|
|
|
this.handleHistory('/assets/apps');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
handleOverviewClick() {
|
|
|
|
|
|
|
|
this.handleHistory('/overview');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleApplicationCreateClick() {
|
|
|
|
|
|
|
|
this.handleHistory('/assets/apps/create');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handlePlatformClick() {
|
|
|
|
|
|
|
|
this.handleHistory('/assets/platforms');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handlePlatformCreateClick() {
|
|
|
|
|
|
|
|
this.handleHistory('/assets/platforms/create');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleReviewClick() {
|
|
|
|
|
|
|
|
this.handleHistory('/assets/reviews');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* The method to update the history.
|
|
|
|
* The method to update the history.
|
|
|
@ -83,33 +62,51 @@ class BaseLayout extends Component {
|
|
|
|
this.props.history.push(to);
|
|
|
|
this.props.history.push(to);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleUserLogin() {
|
|
|
|
|
|
|
|
if (this.state.user) {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<IconButton tooltip={this.state.user}>
|
|
|
|
|
|
|
|
<ActionAccountCircle/>
|
|
|
|
|
|
|
|
</IconButton>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<FlatButton label="Login"/>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
handleNotification() {
|
|
|
|
|
|
|
|
if (this.state.user) {
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<Badge
|
|
|
|
|
|
|
|
badgeContent={this.state.notifications}
|
|
|
|
|
|
|
|
secondary={true}
|
|
|
|
|
|
|
|
badgeStyle={{top: 12, right: 12}} >
|
|
|
|
|
|
|
|
<IconButton tooltip="Notifications">
|
|
|
|
|
|
|
|
<NotificationsIcon/>
|
|
|
|
|
|
|
|
</IconButton>
|
|
|
|
|
|
|
|
</Badge>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<AppBar title="App Publisher"
|
|
|
|
<AppBar title="App Store"
|
|
|
|
iconElementRight={
|
|
|
|
iconElementRight={
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<Badge
|
|
|
|
{this.handleNotification()}
|
|
|
|
badgeContent={this.state.notifications}
|
|
|
|
{this.handleUserLogin()}
|
|
|
|
secondary={true}
|
|
|
|
|
|
|
|
badgeStyle={{top: 12, right: 12}}
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<IconButton tooltip="Notifications">
|
|
|
|
|
|
|
|
<NotificationsIcon/>
|
|
|
|
|
|
|
|
</IconButton>
|
|
|
|
|
|
|
|
</Badge>
|
|
|
|
|
|
|
|
<IconButton onClick={() => {
|
|
|
|
|
|
|
|
console.log("Clicked")
|
|
|
|
|
|
|
|
}}>
|
|
|
|
|
|
|
|
<ActionAccountCircle/>
|
|
|
|
|
|
|
|
</IconButton>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<div>
|
|
|
|
<div>
|
|
|
|
<Drawer containerStyle={{height: 'calc(100% - 64px)', width: '15%', top: '10%'}} open={true}>
|
|
|
|
<Drawer containerStyle={{height: 'calc(100% - 64px)', width: '15%', top: '13%', left: '1%'}}
|
|
|
|
|
|
|
|
open={true}>
|
|
|
|
<List>
|
|
|
|
<List>
|
|
|
|
<ListItem primaryText="Applications"
|
|
|
|
<ListItem primaryText="Applications"
|
|
|
|
leftIcon={<Apps/>}
|
|
|
|
leftIcon={<Apps/>}
|
|
|
|
initiallyOpen={false}
|
|
|
|
initiallyOpen={false}
|
|
|
|
primaryTogglesNestedList={true}
|
|
|
|
primaryTogglesNestedList={true}
|
|
|
@ -117,27 +114,10 @@ class BaseLayout extends Component {
|
|
|
|
nestedItems={[
|
|
|
|
nestedItems={[
|
|
|
|
<ListItem
|
|
|
|
<ListItem
|
|
|
|
key={1}
|
|
|
|
key={1}
|
|
|
|
primaryText="Create"
|
|
|
|
primaryText="Business" //TODO: categoryies ...
|
|
|
|
onClick={this.handleApplicationCreateClick.bind(this)}
|
|
|
|
leftIcon={<List/>}
|
|
|
|
leftIcon={<Add/>}
|
|
|
|
|
|
|
|
/>]}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<ListItem primaryText="Platforms"
|
|
|
|
|
|
|
|
leftIcon={<DevicesOther/>}
|
|
|
|
|
|
|
|
initiallyOpen={false}
|
|
|
|
|
|
|
|
primaryTogglesNestedList={true}
|
|
|
|
|
|
|
|
onClick={this.handlePlatformClick.bind(this)}
|
|
|
|
|
|
|
|
nestedItems={[
|
|
|
|
|
|
|
|
<ListItem
|
|
|
|
|
|
|
|
key={1}
|
|
|
|
|
|
|
|
primaryText="Create"
|
|
|
|
|
|
|
|
onClick={this.handlePlatformCreateClick.bind(this)}
|
|
|
|
|
|
|
|
leftIcon={<Add/>}
|
|
|
|
|
|
|
|
/>]}
|
|
|
|
/>]}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<ListItem primaryText="Reviews"
|
|
|
|
|
|
|
|
onClick={this.handleReviewClick.bind(this)}
|
|
|
|
|
|
|
|
leftIcon={<Feedback/>}/>
|
|
|
|
|
|
|
|
</List>
|
|
|
|
</List>
|
|
|
|
</Drawer>
|
|
|
|
</Drawer>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -158,8 +138,11 @@ class BaseLayout extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BaseLayout.propTypes = {
|
|
|
|
BaseLayout
|
|
|
|
|
|
|
|
.propTypes = {
|
|
|
|
children: PropTypes.element
|
|
|
|
children: PropTypes.element
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default BaseLayout;
|
|
|
|
export
|
|
|
|
|
|
|
|
default
|
|
|
|
|
|
|
|
BaseLayout;
|
|
|
|