// Copyright 2017-2020 @polkadot/react-components authors & contributors // SPDX-License-Identifier: Apache-2.0 import React from 'react'; import styled from 'styled-components'; import type { ThemeProps } from '@polkadot/react-components/types'; import AccountName from '../AccountName'; import IdentityIcon from '../IdentityIcon'; interface Props { address: string; className?: string; isUppercase: boolean; name: string; style?: Record; } function KeyPair ({ address, className = '' }: Props): React.ReactElement { return (
{address}
); } export default React.memo(styled(KeyPair)(({ theme }: ThemeProps) => ` display: flex; flex-wrap: nowrap; justify-content: space-between; position: relative; white-space: nowrap; > .address { display: inline-block; flex: 1; font: ${theme.fontMono}; margin-left: 1rem; opacity: 0.5; overflow: hidden; text-align: right; text-overflow: ellipsis; } > .icon { position: absolute; top: -5px; left: 0; } > .name { display: inline-block; flex: 1 0; margin-left: 3rem; overflow: hidden; text-overflow: ellipsis; &.uppercase { text-transform: uppercase; } } `));