1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-02-09 00:18:00 +01:00

fix: improve password auth extra options

This commit is contained in:
Ivar Conradi Østhus 2021-05-08 18:46:05 +02:00
parent 48ed5f711f
commit f744e67fce
2 changed files with 9 additions and 5 deletions

View File

@ -8,12 +8,14 @@ import { useCommonStyles } from '../../../common.styles';
import { useStyles } from './HostedAuth.styles';
import { Link } from 'react-router-dom';
import { GoogleSvg } from './Icons';
import useQueryParams from '../../../hooks/useQueryParams';
const PasswordAuth = ({ authDetails, passwordLogin, loadInitialData }) => {
const commonStyles = useCommonStyles();
const styles = useStyles();
const history = useHistory();
const [username, setUsername] = useState('');
const params = useQueryParams();
const [username, setUsername] = useState(params.get('email') || '');
const [password, setPassword] = useState('');
const [errors, setErrors] = useState({
usernameError: '',

View File

@ -2,12 +2,14 @@ import React, { useState } from 'react';
import classnames from 'classnames';
import PropTypes from 'prop-types';
import { Button, TextField, Typography, IconButton } from '@material-ui/core';
import LockRounded from '@material-ui/icons/LockRounded';
import ConditionallyRender from '../../common/ConditionallyRender';
import { useHistory } from 'react-router';
import { useCommonStyles } from '../../../common.styles';
import { useStyles } from './PasswordAuth.styles';
import { Link } from 'react-router-dom';
import useQueryParams from '../../../hooks/useQueryParams';
import { GoogleSvg } from '../HostedAuth/Icons';
const PasswordAuth = ({ authDetails, passwordLogin }) => {
const commonStyles = useCommonStyles();
@ -137,8 +139,8 @@ const PasswordAuth = ({ authDetails, passwordLogin }) => {
commonStyles.contentSpacingY
)}
>
<Button color="primary" variant="contained" href={o.path}>
{o.message || o.value}
<Button color="primary" variant="outlined" href={o.path} startIcon={o.type === 'google' ? <GoogleSvg /> : <LockRounded />}>
{o.message}
</Button>
</div>
))}
@ -146,8 +148,8 @@ const PasswordAuth = ({ authDetails, passwordLogin }) => {
condition={showFields}
show={renderLoginForm()}
elseShow={
<IconButton onClick={onShowOptions}>
{' '}
<IconButton size="small" onClick={onShowOptions}>
Show more options
</IconButton>
}