mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-02 06:07:06 +01:00
42be5a07d7
* Replaced addresses by the address component on SignTypedData v4 signatures * Fixing signature-request e2e tests * Modified scss file for signature-request message * Using address component for rendering the addresses and bold label where hex address is not valid * Modify the address component * Added proper BEM syntax for class names and used Box and Typography * FIxing e2e tests * Commited requested changes from George and added storybook * Review requested changes * Created new component for rendering data in signature-request-message.js * Fixing proper usage for getAccountName and getMetadataContractName selectors * Fixing e2e tests
40 lines
1.1 KiB
JavaScript
40 lines
1.1 KiB
JavaScript
import { connect } from 'react-redux';
|
|
import {
|
|
getAccountsWithLabels,
|
|
getAddressBookEntry,
|
|
getIsBuyableChain,
|
|
getNetworkIdentifier,
|
|
getSwapsDefaultToken,
|
|
getMetadataContractName,
|
|
getAccountName,
|
|
getMetaMaskIdentities,
|
|
} from '../../../selectors';
|
|
import ConfirmPageContainer from './confirm-page-container.component';
|
|
|
|
function mapStateToProps(state, ownProps) {
|
|
const to = ownProps.toAddress;
|
|
const isBuyableChain = getIsBuyableChain(state);
|
|
const contact = getAddressBookEntry(state, to);
|
|
const networkIdentifier = getNetworkIdentifier(state);
|
|
const defaultToken = getSwapsDefaultToken(state);
|
|
const accountBalance = defaultToken.string;
|
|
const identities = getMetaMaskIdentities(state);
|
|
const toName = getAccountName(identities, to);
|
|
const toMetadataName = getMetadataContractName(state, to);
|
|
|
|
return {
|
|
isBuyableChain,
|
|
contact,
|
|
toName,
|
|
toMetadataName,
|
|
isOwnedAccount: getAccountsWithLabels(state)
|
|
.map((accountWithLabel) => accountWithLabel.address)
|
|
.includes(to),
|
|
to,
|
|
networkIdentifier,
|
|
accountBalance,
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps)(ConfirmPageContainer);
|