mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-17 21:47:47 +00:00
* Convert bootstrap to sass instead of checked in and less * Darken body, adjust header. * First pass at tab styles, each tab will need a lot of individual love tho. * Update footer to main site content, improve responsiveness. * Missing key added. * Fix dropdowns. * Convert GenerateWallet HTML over, still needs styling. * Send form. * Current rates styled. * CurrencySwap form styles. * SwapInfoHeader styled. * Finish up swap restyling, minor usability improvements for mobile. * Fix up notifications / alert customizations * Import v3 variables. * Fix notification spacing. * Align input height base with buttons. * Revert height base, add additional bootstrap overrides. * Grid overrides. * Move overrides to their own folder. Adjust naming. * Fix inconsistencies. * Style generate wallet pt 1. * Style generate wallet pt 2 * Style generate wallet pt 3 * Fix swap * Added some missing overries, fixed the fallout. * Remove header text, indicate alpha version. * Fix radio / checkbox weights. * Bind => arrow * Convert simpledropdown to proper form select, instead of weirdly implemented nonfuncitoning dropdown. * Fix token balances buttons, footr icons.
71 lines
1.6 KiB
JavaScript
71 lines
1.6 KiB
JavaScript
// @flow
|
|
import React from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import translate from 'translations';
|
|
import WalletDecrypt from 'components/WalletDecrypt';
|
|
import BaseWallet from 'libs/wallet/base';
|
|
import { connect } from 'react-redux';
|
|
import type { State } from 'reducers';
|
|
|
|
type Props = {
|
|
title: string,
|
|
wallet: BaseWallet
|
|
};
|
|
|
|
export class UnlockHeader extends React.Component {
|
|
props: Props;
|
|
static propTypes = {
|
|
title: PropTypes.string.isRequired
|
|
};
|
|
|
|
state: {
|
|
expanded: boolean
|
|
} = {
|
|
expanded: !this.props.wallet
|
|
};
|
|
|
|
componentDidUpdate(prevProps: Props) {
|
|
if (this.props.wallet && this.props.wallet !== prevProps.wallet) {
|
|
this.setState({ expanded: false });
|
|
}
|
|
|
|
// not sure if could happen
|
|
if (!this.props.wallet && this.props.wallet !== prevProps.wallet) {
|
|
this.setState({ expanded: true });
|
|
}
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<article className="collapse-container">
|
|
<div onClick={this.toggleExpanded}>
|
|
<a className="collapse-button">
|
|
<span>
|
|
{this.state.expanded ? '-' : '+'}
|
|
</span>
|
|
</a>
|
|
<h1>
|
|
{translate(this.props.title)}
|
|
</h1>
|
|
</div>
|
|
{this.state.expanded && <WalletDecrypt />}
|
|
{this.state.expanded && <hr />}
|
|
</article>
|
|
);
|
|
}
|
|
|
|
toggleExpanded = () => {
|
|
this.setState(state => {
|
|
return { expanded: !state.expanded };
|
|
});
|
|
};
|
|
}
|
|
|
|
function mapStateToProps(state: State) {
|
|
return {
|
|
wallet: state.wallet.inst
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps)(UnlockHeader);
|