X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FUI.git;a=blobdiff_plain;f=skyquake%2Fplugins%2Faccounts%2Fsrc%2Faccount%2FaccountsDashboard.jsx;fp=skyquake%2Fplugins%2Faccounts%2Fsrc%2Faccount%2FaccountsDashboard.jsx;h=c0e06807ae807bdcf45f0f03b3d8ddb26c050270;hp=0000000000000000000000000000000000000000;hb=e29efc315df33d546237e270470916e26df391d6;hpb=9c5e457509ba5a1822c316635c6308874e61b4b9 diff --git a/skyquake/plugins/accounts/src/account/accountsDashboard.jsx b/skyquake/plugins/accounts/src/account/accountsDashboard.jsx new file mode 100644 index 000000000..c0e06807a --- /dev/null +++ b/skyquake/plugins/accounts/src/account/accountsDashboard.jsx @@ -0,0 +1,62 @@ +/* + * + * Copyright 2016 RIFT.IO Inc + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + */ + +import React from 'react'; +import AppHeader from 'widgets/header/header.jsx'; +import AccountStore from './accountStore.js'; +import AccountSidebar from '../account_sidebar/accountSidebar.jsx'; +import SkyquakeComponent from 'widgets/skyquake_container/skyquakeComponent.jsx'; +import 'style/layout.scss'; + +class AccountsDashboard extends React.Component { + constructor(props) { + super(props); + this.Store = this.props.flux.stores.hasOwnProperty('AccountStore') ? this.props.flux.stores.AccountStore : this.props.flux.createStore(AccountStore); + this.state = this.Store.getState(); + } + componentWillMount() { + this.Store.listen(this.updateState); + this.Store.openAccountsSocket(); + } + componentWillUnmount() { + this.Store.closeSocket(); + this.Store.unlisten(this.updateState); + } + updateState = (state) => { + this.setState(state); + } + render() { + let self = this; + let html; + html = (
+
+ +
+ { this.props.children ? React.cloneElement(this.props.children, {store: self.Store, ...self.state}) : 'Edit or Create New Accounts' + } +
+
+
); + return html; + } +} +AccountsDashboard.contextTypes = { + router: React.PropTypes.object +}; + +export default SkyquakeComponent(AccountsDashboard);