1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-12-02 14:15:06 +01:00
metamask-extension/ui/components/app/permissions-connect-permission-list/permissions-connect-permission-list.js
Ariella Vu 34bf555e50 Fix v10.11: Unable to find value of key "eth_accounts" for locale "en" in Permissions Modal (#13833)
* 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>
2022-03-04 13:40:58 -03:30

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,
};