Implement icon button

This commit is contained in:
Brandon Millman
2018-06-30 13:23:13 -07:00
parent b9b00e10d3
commit 3031598843
2 changed files with 18 additions and 2 deletions

View File

@@ -3,7 +3,7 @@ import { darken } from 'polished';
import * as React from 'react';
import { styled } from 'ts/style/theme';
export type TextTag = 'p' | 'div' | 'span' | 'label' | 'h1' | 'h2' | 'h3' | 'h4';
export type TextTag = 'p' | 'div' | 'span' | 'label' | 'h1' | 'h2' | 'h3' | 'h4' | 'i';
export interface TextProps {
className?: string;
@@ -17,6 +17,7 @@ export interface TextProps {
fontWeight?: number | string;
textDecorationLine?: string;
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
hoverColor?: string;
}
const PlainText: React.StatelessComponent<TextProps> = ({ children, className, onClick, Tag }) => (
@@ -37,7 +38,7 @@ export const Text = styled(PlainText)`
${props => (props.onClick ? 'cursor: pointer' : '')};
transition: color 0.5s ease;
&:hover {
${props => (props.onClick ? `color: ${darken(0.3, props.fontColor)}` : '')};
${props => (props.onClick ? `color: ${props.hoverColor || darken(0.3, props.fontColor)}` : '')};
}
`;

View File

@@ -199,11 +199,26 @@ export class Wallet extends React.Component<WalletProps, WalletState> {
<AccountConnection accountState={accountState} injectedProviderName={this.props.injectedProviderName} />
</div>
);
const onClick = _.noop;
const accessory = (
<Container marginRight="15px">
<Text
className="zmdi zmdi-more-horiz"
Tag="i"
fontSize="32px"
fontFamily="Material-Design-Iconic-Font"
fontColor={colors.darkGrey}
onClick={onClick}
hoverColor={colors.mediumBlue}
/>
</Container>
);
return (
<Link key={HEADER_ITEM_KEY} to={ACCOUNT_PATH} style={{ textDecoration: 'none' }}>
<StandardIconRow
icon={<Identicon address={userAddress} diameter={ICON_DIMENSION} />}
main={main}
accessory={accessory}
minHeight="60px"
backgroundColor={colors.white}
/>