mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-27 12:56:01 +01:00
aa89bb189b
* ConnectedAccountsPermissions: convert to FC * permissions: add usePermissionsDescriptions - fix ConnectedAccountsPermissions eth_accounts i18n * ConnectedAccountsPermissions: rm .component from path * ConnectedAccountsPermissions: fix toggleExpanded ensure we change previous state value Co-authored-by: Mark Stacey <markjstacey@gmail.com> Co-authored-by: Mark Stacey <markjstacey@gmail.com>
30 lines
859 B
JavaScript
30 lines
859 B
JavaScript
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { usePermissionDescriptions } from '../../../hooks/usePermissionDescriptions';
|
|
|
|
export default function PermissionsConnectPermissionList({ permissions }) {
|
|
const getPermissionDescription = usePermissionDescriptions();
|
|
|
|
return (
|
|
<div className="permissions-connect-permission-list">
|
|
{Object.keys(permissions).map((permission) => {
|
|
const { label, leftIcon, rightIcon } = getPermissionDescription(
|
|
permission,
|
|
);
|
|
|
|
return (
|
|
<div className="permission" key={permission}>
|
|
<i className={leftIcon} />
|
|
{label}
|
|
{rightIcon && <i className={rightIcon} />}
|
|
</div>
|
|
);
|
|
})}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
PermissionsConnectPermissionList.propTypes = {
|
|
permissions: PropTypes.object.isRequired,
|
|
};
|