mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-04 23:14:56 +01:00
90b656bd66
* Changed back button to the one in design * PermissionConnect now uses Chip component * Added SiteOrigin widget * WIP * Added new permission list * Fix linting errors * Removed unused messages * Removed more unused messages * Make SiteOrigin bigger * Fix lint * Code Review fixes * Fix SiteOrigin overflowing * Add stories * Fix lint * Added useMemo to constant * Fix Chip's max-content overflowing SiteOrigin * Fix code review issues Co-authored-by: Olaf Tomalka <olaftomalka@Olafs-MacBook-Pro-2.local>
34 lines
982 B
JavaScript
34 lines
982 B
JavaScript
import React, { useMemo } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import { useI18nContext } from '../../../hooks/useI18nContext';
|
|
|
|
export default function PermissionsConnectPermissionList({ permissions }) {
|
|
const t = useI18nContext();
|
|
|
|
const PERMISSION_TYPES = useMemo(() => {
|
|
return {
|
|
eth_accounts: {
|
|
leftIcon: 'fas fa-eye',
|
|
label: t('eth_accounts'),
|
|
rightIcon: null,
|
|
},
|
|
};
|
|
}, [t]);
|
|
|
|
return (
|
|
<div className="permissions-connect-permission-list">
|
|
{Object.keys(permissions).map((permission) => (
|
|
<div className="permission" key={PERMISSION_TYPES[permission].label}>
|
|
<i className={PERMISSION_TYPES[permission].leftIcon} />
|
|
{PERMISSION_TYPES[permission].label}
|
|
<i className={PERMISSION_TYPES[permission].rightIcon} />
|
|
</div>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
PermissionsConnectPermissionList.propTypes = {
|
|
permissions: PropTypes.objectOf(PropTypes.bool).isRequired,
|
|
};
|