Enable useNextVariants and replace depracated typography variants
[arvados-workbench2.git] / src / views / login-panel / login-panel.tsx
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import * as React from 'react';
6 import { connect, DispatchProp } from 'react-redux';
7 import { Grid, Typography, Button } from '@material-ui/core';
8 import { StyleRulesCallback, WithStyles, withStyles } from '@material-ui/core/styles';
9 import { login } from '~/store/auth/auth-action';
10 import { ArvadosTheme } from '~/common/custom-theme';
11 import * as classNames from 'classnames';
12
13 type CssRules = 'root' | 'container' | 'title' | 'content' | 'content__bolder' | 'button';
14
15 const styles: StyleRulesCallback<CssRules> = (theme: ArvadosTheme) => ({
16     root: {
17         position: 'relative',
18         backgroundColor: theme.palette.grey["200"],
19         '&::after': {
20             content: `''`,
21             position: 'absolute',
22             top: 0,
23             left: 0,
24             bottom: 0,
25             right: 0,
26             background: 'url("arvados-logo-big.png") no-repeat center center',
27             opacity: 0.2,
28         }
29     },
30     container: {
31         width: '560px',
32         zIndex: 10
33     },
34     title: {
35         marginBottom: theme.spacing.unit * 6,
36         color: theme.palette.grey["800"]
37     },
38     content: {
39         marginBottom: theme.spacing.unit * 3,
40         lineHeight: '1.2rem',
41         color: theme.palette.grey["800"]
42     },
43     'content__bolder': {
44         fontWeight: 'bolder'
45     },
46     button: {
47         boxShadow: 'none'
48     }
49 });
50
51 type LoginPanelProps = DispatchProp<any> & WithStyles<CssRules>;
52
53 export const LoginPanel = withStyles(styles)(connect()(
54     ({ classes, dispatch }: LoginPanelProps) =>
55     <Grid container direction="column" item xs alignItems="center" justify="center" className={classes.root}>
56         <Grid item className={classes.container}>
57             <Typography variant='h6' align="center" className={classes.title}>
58                 Welcome to the Arvados Workbench
59             </Typography>
60             <Typography  className={classes.content}>
61                 The "Log in" button below will show you a Google sign-in page.
62                 After you assure Google that you want to log in here with your Google account, you will be redirected back here to Arvados Workbench.
63             </Typography>
64             <Typography  className={classes.content}>
65                 If you have never used Arvados Workbench before, logging in for the first time will automatically create a new account.
66             </Typography>
67             <Typography variant='body1' className={classNames(classes.content, classes.content__bolder)}>
68                 IMPORTANT: Please keep in mind to store exploratory data only but not any information used for clinical decision making.
69             </Typography>
70             <Typography  className={classes.content}>
71                 Arvados Workbench uses your name and email address only for identification, and does not retrieve any other personal information from Google.
72             </Typography>
73             <Typography component="div" align="right">
74                 <Button variant="contained" color="primary" className={classes.button} onClick={() => dispatch(login())}>
75                     Log in
76                 </Button>
77             </Typography>
78         </Grid>
79     </Grid>
80 ));