mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-01-11 19:44:21 +00:00
816ce3180f
* Update account view routing * Temporarily add unicode character to translated strings for testing * Temporarily select add unicode to all untranslated strings * Format changes * Add all english translations for /account & /generate * Add the rest of the english translations * Add a few more missing translations * Update en translations * Get selectedLanguage from localstorage instead of redux sttate * Update snapshots * Add missing translation keys & Update translate functs & change variable prefix * translate all markdown strings & remove old translation strings * Update snapshot * Add a few more translation strs * Move raw strings being translated into json * All translation keys are now Uppercase * Fix up the last few translations * Update snapshot * Uppercase de translation strings * Bring back shapeshift logo on swap * Fix contracts tab translations * Fix a few more translations * Fix translations * remove debugging stuff * Update snapshots * Use react.fragment as markdown root renderer * Seperate markdown translations into their own function * Clean up translation functions * Clean up translation functions * Update snapshot * Fix some broken translation strings * Add prettier ignore file
44 lines
1.1 KiB
TypeScript
44 lines
1.1 KiB
TypeScript
import React, { Component } from 'react';
|
|
import Spinner from './Spinner';
|
|
import './SimpleButton.scss';
|
|
|
|
const DEFAULT_BUTTON_TYPE = 'primary';
|
|
const DEFAULT_BUTTON_SIZE = 'lg';
|
|
|
|
type ButtonType = 'default' | 'primary' | 'success' | 'info' | 'warning' | 'danger';
|
|
type ButtonSize = 'lg' | 'sm' | 'xs';
|
|
|
|
interface Props {
|
|
text: string;
|
|
loading?: boolean;
|
|
disabled?: boolean;
|
|
loadingText?: string;
|
|
size?: ButtonSize;
|
|
type?: ButtonType;
|
|
onClick(): any;
|
|
}
|
|
|
|
export default class SimpleButton extends Component<Props, {}> {
|
|
public computedClass = () => {
|
|
return `btn btn-${this.props.size || DEFAULT_BUTTON_TYPE} btn-${this.props.type ||
|
|
DEFAULT_BUTTON_SIZE}`;
|
|
};
|
|
|
|
public render() {
|
|
const { loading, disabled, loadingText, text, onClick } = this.props;
|
|
return (
|
|
<div>
|
|
<button onClick={onClick} disabled={loading || disabled} className={this.computedClass()}>
|
|
{loading ? (
|
|
<div className="SimpleButton">
|
|
<Spinner light={true} /> {loadingText || text}
|
|
</div>
|
|
) : (
|
|
<div>{text}</div>
|
|
)}
|
|
</button>
|
|
</div>
|
|
);
|
|
}
|
|
}
|