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

fix: minor tuning on auth

This commit is contained in:
Ivar Conradi Østhus 2021-04-23 11:40:12 +02:00
parent 0ca753e7e5
commit cb7555d048

View File

@ -80,11 +80,8 @@ const PasswordAuth = ({ authDetails, passwordLogin, loadInitialData }) => {
<form <form
onSubmit={handleSubmit} onSubmit={handleSubmit}
action={authDetails.path} action={authDetails.path}
className={styles.loginContainer}
> >
<Typography variant="subtitle1">
{authDetails.message}
</Typography>
<Typography variant="subtitle2" className={styles.apiError}> <Typography variant="subtitle2" className={styles.apiError}>
{apiError} {apiError}
</Typography> </Typography>
@ -131,21 +128,24 @@ const PasswordAuth = ({ authDetails, passwordLogin, loadInitialData }) => {
}; };
const renderWithOptions = options => ( const renderWithOptions = options => (
<div style={{ textAlign: 'center' }}> <div>
{options.map(o => ( {options.map(o => (
<CardActions key={o.type}> <div key={o.type} className={classnames(
<Button raised accent href={o.path}> styles.contentContainer,
commonStyles.contentSpacingY
)}>
<Button color="primary" variant="contained" href={o.path}>
{o.value} {o.value}
</Button> </Button>
</CardActions> </div>
))} ))}
<ConditionallyRender <ConditionallyRender
condition={showFields} condition={showFields}
show={renderLoginForm()} show={renderLoginForm()}
elseShow={ elseShow={
<IconButton> <IconButton onClick={onShowOptions} >
{' '} {' '}
onClick={onShowOptions} Show more options Show more options
</IconButton> </IconButton>
} }
/> />
@ -155,11 +155,17 @@ const PasswordAuth = ({ authDetails, passwordLogin, loadInitialData }) => {
const { options = [] } = authDetails; const { options = [] } = authDetails;
return ( return (
<div>
<Typography variant="subtitle1">
{authDetails.message}
</Typography>
<ConditionallyRender <ConditionallyRender
condition={options.length > 0} condition={options.length > 0}
show={renderWithOptions(options)} show={renderWithOptions(options)}
elseShow={renderLoginForm()} elseShow={renderLoginForm()}
/> />
</div>
); );
}; };