ghost-keychain/packages/extension-ui/src/components/ActionText.tsx
Thibaut Sardan fe4148f12f
Use FontAwesome as much as possible (#499)
* header

* menuAdd

* bring in regular and ActionText

* settings menu

* replace arrow-left

* warning

* lock unlock derivation path

* fix test Header

* fix test Header

* alpha ordering

* neutral colors for menu icons

* Update package.json

* add a back button hover color (#502)

Co-authored-by: Github Actions <action@github.com>

* Update package.json

* Apply suggestions from code review

Co-authored-by: Jaco Greeff <jacogr@gmail.com>

Co-authored-by: Github Actions <action@github.com>
Co-authored-by: Jaco Greeff <jacogr@gmail.com>
2020-10-17 17:03:01 +02:00

48 lines
1.1 KiB
TypeScript

// Copyright 2019-2020 @polkadot/extension-ui authors & contributors
// SPDX-License-Identifier: Apache-2.0
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { ThemeProps } from '../types';
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import React, { MouseEventHandler } from 'react';
import styled from 'styled-components';
interface Props {
className?: string;
icon?: IconDefinition;
onClick: MouseEventHandler<HTMLDivElement>;
text: string;
}
function ActionText ({ className, icon, onClick, text }: Props): React.ReactElement<Props> {
return (
<div
className={className}
onClick={onClick}
>
{icon && <FontAwesomeIcon icon={icon} />}
<span>{text}</span>
</div>
);
}
export default styled(ActionText)(({ theme }: ThemeProps) => `
cursor: pointer;
span {
color: ${theme.labelColor}
font-size: ${theme.labelFontSize};
line-height: ${theme.labelLineHeight};
text-decoration-line: underline;
}
.svg-inline--fa {
color: ${theme.iconNeutralColor};
display: inline-block;
margin-right: 0.3rem;
position: relative;
top: 2px;
}
`);