1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import * as React from 'react';
6 import { Dispatch } from 'redux';
7 import { connect } from 'react-redux';
8 import { Grid, Typography, Button } from '@material-ui/core';
9 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
10 import { ArvadosTheme } from '~/common/custom-theme';
11 import { navigateToLinkAccount } from '~/store/navigation/navigation-action';
12 import { RootState } from '~/store/store';
14 type CssRules = 'root' | 'ontop' | 'title';
16 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
19 backgroundColor: theme.palette.grey["200"],
27 background: 'url("arvados-logo-big.png") no-repeat center center',
35 marginBottom: theme.spacing.unit * 6,
36 color: theme.palette.grey["800"]
40 export interface InactivePanelActionProps {
41 startLinking: () => void;
44 const mapDispatchToProps = (dispatch: Dispatch): InactivePanelActionProps => ({
46 dispatch<any>(navigateToLinkAccount);
50 export interface InactivePanelStateProps {
51 inactivePageText: string;
54 type InactivePanelProps = WithStyles<CssRules> & InactivePanelActionProps & InactivePanelStateProps;
56 export const InactivePanel = connect((state: RootState) => ({
57 inactivePageText: state.auth.config.clusterConfig.Workbench.InactivePageHTML
58 }), mapDispatchToProps)(withStyles(styles)((({ classes, startLinking, inactivePageText }: InactivePanelProps) =>
59 <Grid container justify="center" alignItems="center" direction="column" spacing={24}
60 className={classes.root}
61 style={{ marginTop: 56, height: "100%" }}>
64 <div dangerouslySetInnerHTML={{ __html: inactivePageText }} style={{ margin: "1em" }} />
68 <Typography align="center">
69 If you would like to use this login to access another account click "Link Account".
73 <Button className={classes.ontop} color="primary" variant="contained" onClick={() => startLinking()}>