X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/e02a51f2799aaab5cdd0194dc9363e31592d4209..34f68df51c55f8144bc96d78695070851e6b34f5:/src/views/main-panel/main-panel.tsx diff --git a/src/views/main-panel/main-panel.tsx b/src/views/main-panel/main-panel.tsx index 22455c3c..7592afb3 100644 --- a/src/views/main-panel/main-panel.tsx +++ b/src/views/main-panel/main-panel.tsx @@ -2,77 +2,21 @@ // // SPDX-License-Identifier: AGPL-3.0 -import * as React from 'react'; -import { connect, DispatchProp } from 'react-redux'; -import { push } from 'react-router-redux'; -import { LinearProgress, Grid } from '@material-ui/core'; -import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles'; -import { ArvadosTheme } from '~/common/custom-theme'; -import { isSystemWorking } from '~/store/progress-indicator/progress-indicator-reducer'; import { RootState } from '~/store/store'; -import { User } from '~/models/user'; -import { WorkbenchPanel } from '~/views/workbench/workbench'; -import { LoginPanel } from '~/views/login-panel/login-panel'; -import { MainAppBar } from '~/views-components/main-app-bar/main-app-bar'; - -type CssRules = 'root'; - -const styles: StyleRulesCallback = (theme: ArvadosTheme) => ({ - root: { - overflow: 'hidden', - width: '100vw', - height: '100vh' - } -}); - -interface MainPanelDataProps { - user?: User; - working: boolean; -} - -interface MainPanelGeneralProps { - buildInfo: string; -} - -interface MainPanelState { - searchText: string; -} - -type MainPanelProps = MainPanelDataProps & MainPanelGeneralProps & DispatchProp & WithStyles; +import { connect } from 'react-redux'; +import { MainPanelRoot, MainPanelRootDataProps } from '~/views/main-panel/main-panel-root'; +import { isSystemWorking } from '~/store/progress-indicator/progress-indicator-reducer'; +import { isWorkbenchLoading } from '~/store/workbench/workbench-actions'; -export const MainPanel = withStyles(styles)( - connect( - (state: RootState) => ({ - user: state.auth.user, - working: isSystemWorking(state.progressIndicator) - }) - )( - class extends React.Component { - state = { - searchText: "", - }; +const mapStateToProps = (state: RootState): MainPanelRootDataProps => { + return { + user: state.auth.user, + working: isSystemWorking(state.progressIndicator), + loading: isWorkbenchLoading(state), + buildInfo: state.appInfo.buildInfo + }; +}; - render() { - const { classes, user, buildInfo, working } = this.props; - const { searchText } = this.state; - return <> - - {working ? : null} - - - {user ? : } - - ; - } +const mapDispatchToProps = null; - onSearch = (searchText: string) => { - this.setState({ searchText }); - this.props.dispatch(push(`/search?q=${searchText}`)); - } - } - ) -); \ No newline at end of file +export const MainPanel = connect(mapStateToProps, mapDispatchToProps)(MainPanelRoot); \ No newline at end of file