-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathLoginOptionsDisplay.js
65 lines (57 loc) · 2.08 KB
/
LoginOptionsDisplay.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
import PropTypes from 'prop-types';
import React from 'react';
import {FormattedMessage} from 'react-intl';
import LoginButton from 'components/LoginButton';
import FormattedLoginOption from 'types/FormattedLoginOption';
import {getBEMClassName} from 'utils';
const LoginOptionsDisplay = ({
loginAsYourselfOptions,
loginAsGemachtigdeOptions,
cosignLoginOptions,
}) => {
return (
<div className={getBEMClassName('login-options')}>
<div className={getBEMClassName('login-options__list')}>
{loginAsYourselfOptions.map(option => (
<LoginButton key={option.identifier} option={option} />
))}
</div>
{loginAsGemachtigdeOptions.length > 0 && (
<>
<h2 className={getBEMClassName('login-options__caption')}>
<FormattedMessage
description="Log in on behalf of someone else title"
defaultMessage="Log in on behalf of someone else"
/>
</h2>
<div className={getBEMClassName('login-options__list')}>
{loginAsGemachtigdeOptions.map(option => (
<LoginButton key={option.identifier} option={option} />
))}
</div>
</>
)}
{cosignLoginOptions?.length > 0 && (
<div className={getBEMClassName('login-options__cosign')}>
<h2 className={getBEMClassName('login-options__caption')}>
<FormattedMessage
description="Log in to co-sign the form title"
defaultMessage="Log in to co-sign the form"
/>
</h2>
<div className={getBEMClassName('login-options__list')}>
{cosignLoginOptions.map(option => (
<LoginButton key={option.identifier} option={option} />
))}
</div>
</div>
)}
</div>
);
};
LoginOptionsDisplay.propTypes = {
loginAsYourselfOptions: PropTypes.arrayOf(FormattedLoginOption).isRequired,
loginAsGemachtigdeOptions: PropTypes.arrayOf(FormattedLoginOption).isRequired,
cosignLoginOptions: PropTypes.arrayOf(FormattedLoginOption),
};
export default LoginOptionsDisplay;