mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-06 00:03:24 +00:00
de7d4fbaa2
* 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.
102 lines
2.7 KiB
JavaScript
102 lines
2.7 KiB
JavaScript
// @flow
|
|
import React, { Component } from 'react';
|
|
import { connect } from 'react-redux';
|
|
import { accessContract } from 'actions/contracts';
|
|
import type { ABIFunction } from 'actions/contracts';
|
|
import { getNetworkContracts } from 'selectors/config';
|
|
import type { NetworkContract } from 'config/data';
|
|
import { State } from 'reducers/contracts';
|
|
import translate from 'translations';
|
|
import Interact from './components/Interact';
|
|
import Deploy from './components/Deploy';
|
|
import './index.scss';
|
|
|
|
type Props = {
|
|
NetworkContracts: Array<NetworkContract>,
|
|
selectedAddress: ?string,
|
|
selectedABIJson: ?string,
|
|
selectedABIFunctions: ?Array<ABIFunction>,
|
|
accessContract: Function
|
|
};
|
|
|
|
class Contracts extends Component {
|
|
props: Props;
|
|
|
|
state = {
|
|
activeTab: 'interact'
|
|
};
|
|
|
|
changeTab(activeTab) {
|
|
this.setState({ activeTab });
|
|
}
|
|
|
|
render() {
|
|
const {
|
|
NetworkContracts,
|
|
selectedAddress,
|
|
selectedABIJson,
|
|
selectedABIFunctions,
|
|
accessContract
|
|
} = this.props;
|
|
const { activeTab } = this.state;
|
|
let content = '';
|
|
let interactActive = '';
|
|
let deployActive = '';
|
|
|
|
if (activeTab === 'interact') {
|
|
content = (
|
|
<Interact
|
|
NetworkContracts={NetworkContracts}
|
|
selectedAddress={selectedAddress}
|
|
selectedABIJson={selectedABIJson}
|
|
selectedABIFunctions={selectedABIFunctions}
|
|
accessContract={accessContract}
|
|
/>
|
|
);
|
|
interactActive = 'is-active';
|
|
} else {
|
|
content = <Deploy />;
|
|
deployActive = 'is-active';
|
|
}
|
|
|
|
return (
|
|
<section className="Tab-content Contracts">
|
|
<div className="Tab-content-pane">
|
|
<h1 className="Contracts-header">
|
|
<button
|
|
className={`Contracts-header-tab ${interactActive}`}
|
|
onClick={() => this.changeTab('interact')}
|
|
>
|
|
{translate('NAV_InteractContract')}
|
|
</button>{' '}
|
|
<span>or</span>{' '}
|
|
<button
|
|
className={`Contracts-header-tab ${deployActive}`}
|
|
onClick={() => this.changeTab('deploy')}
|
|
>
|
|
{translate('NAV_DeployContract')}
|
|
</button>
|
|
</h1>
|
|
</div>
|
|
|
|
<main className="Tab-content-pane" role="main">
|
|
<div className="Contracts-content">
|
|
{content}
|
|
</div>
|
|
</main>
|
|
</section>
|
|
);
|
|
}
|
|
}
|
|
|
|
function mapStateToProps(state: State) {
|
|
return {
|
|
NetworkContracts: getNetworkContracts(state),
|
|
selectedAddress: state.contracts.selectedAddress,
|
|
selectedABIJson: state.contracts.selectedABIJson,
|
|
selectedABIFunctions: state.contracts.selectedABIFunctions
|
|
};
|
|
}
|
|
|
|
export default connect(mapStateToProps, { accessContract })(Contracts);
|