Newer
Older
piotr.kupczyk@id.ethz.ch
committed
import React from 'react'
import { withStyles } from '@material-ui/core/styles'
import Content from '@src/js/components/common/content/Content.jsx'
import DatabaseBrowser from '@src/js/components/database/browser/DatabaseBrowser.jsx'
piotr.kupczyk@id.ethz.ch
committed
import DatabaseTab from '@src/js/components/database/DatabaseTab.jsx'
piotr.kupczyk@id.ethz.ch
committed
import DatabaseComponent from '@src/js/components/database/DatabaseComponent.jsx'
piotr.kupczyk@id.ethz.ch
committed
import pages from '@src/js/common/consts/pages.js'
import logger from '@src/js/common/logger.js'
const styles = () => ({
container: {
display: 'flex',
width: '100%'
},
component: {
height: 0,
flex: '1 1 100%',
overflow: 'hidden'
},
piotr.kupczyk@id.ethz.ch
committed
})
class Database extends React.PureComponent {
render() {
logger.log(logger.DEBUG, 'Database.render')
const classes = this.props.classes
return (
<div className={classes.container}>
<DatabaseBrowser />
<Content
classes={{component: classes.component}}
piotr.kupczyk@id.ethz.ch
committed
page={pages.DATABASE}
renderComponent={this.renderComponent}
renderTab={this.renderTab}
/>
</div>
)
}
piotr.kupczyk@id.ethz.ch
committed
renderComponent(tab) {
return <DatabaseComponent object={tab.object} />
piotr.kupczyk@id.ethz.ch
committed
}
renderTab(tab) {
piotr.kupczyk@id.ethz.ch
committed
return <DatabaseTab tab={tab} />
piotr.kupczyk@id.ethz.ch
committed
}
}
export default withStyles(styles)(Database)