1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import React from 'react';
6 import { StyleRulesCallback, WithStyles, withStyles, Grid, LinearProgress } from '@material-ui/core';
7 import { User } from "models/user";
8 import { ArvadosTheme } from 'common/custom-theme';
9 import { WorkbenchPanel } from 'views/workbench/workbench';
10 import { LoginPanel } from 'views/login-panel/login-panel';
11 import { InactivePanel } from 'views/inactive-panel/inactive-panel';
12 import { WorkbenchLoadingScreen } from 'views/workbench/workbench-loading-screen';
13 import { MainAppBar } from 'views-components/main-app-bar/main-app-bar';
15 type CssRules = 'root';
17 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
25 export interface MainPanelRootDataProps {
31 isNotLinking: boolean;
32 isLinkingPath: boolean;
34 sessionIdleTimeout: number;
35 sidePanelIsCollapsed: boolean;
36 isTransitioning: boolean;
37 currentSideWidth: number;
40 interface MainPanelRootDispatchProps {
41 toggleSidePanel: () => void
44 type MainPanelRootProps = MainPanelRootDataProps & MainPanelRootDispatchProps & WithStyles<CssRules>;
46 export const MainPanelRoot = withStyles(styles)(
47 ({ classes, loading, working, user, buildInfo, uuidPrefix,
48 isNotLinking, isLinkingPath, siteBanner, sessionIdleTimeout,
49 sidePanelIsCollapsed, isTransitioning, currentSideWidth}: MainPanelRootProps) =>{
51 ? <WorkbenchLoadingScreen />
53 {isNotLinking && <MainAppBar
56 uuidPrefix={uuidPrefix}
57 siteBanner={siteBanner}
58 sidePanelIsCollapsed={sidePanelIsCollapsed}
61 ? <LinearProgress color="secondary" data-cy="linear-progress" />
64 <Grid container direction="column" className={classes.root}>
66 ? (user.isActive || (!user.isActive && isLinkingPath)
68 isNotLinking={isNotLinking}
69 isUserActive={user.isActive}
70 sessionIdleTimeout={sessionIdleTimeout}
71 sidePanelIsCollapsed={sidePanelIsCollapsed}
72 isTransitioning={isTransitioning}
73 currentSideWidth={currentSideWidth}/>