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';
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 type InactivePanelProps = WithStyles<CssRules> & InactivePanelActionProps;
52 export const InactivePanel = connect(null, mapDispatchToProps)(withStyles(styles)((({ classes, startLinking }: InactivePanelProps) =>
53 <Grid container justify="center" alignItems="center" direction="column" spacing={24}
54 className={classes.root}
55 style={{ marginTop: 56, height: "100%" }}>
57 <Typography variant='h6' align="center" className={classes.title}>
58 Hi! You're logged in, but...
62 <Typography align="center">
63 Your account is inactive. An administrator must activate your account before you can get any further.
67 <Typography align="center">
68 If you would like to use this login to access another account click "Link Account".
72 <Button className={classes.ontop} color="primary" variant="contained" onClick={() => startLinking()}>