1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-07-02 21:02:36 +00:00
trezor-wallet/src/js/components/Log/index.js
2018-08-16 16:09:56 +02:00

31 lines
916 B
JavaScript

/* @flow */
import React from 'react';
import { bindActionCreators } from 'redux';
import { connect } from 'react-redux';
import { H2 } from 'components/Heading';
import * as LogActions from 'actions/LogActions';
import type { State, Dispatch } from 'flowtype';
const Log = (props: Props): ?React$Element<string> => {
if (!props.log.opened) return null;
return (
<div className="log">
<button className="log-close transparent" onClick={props.toggle} />
<H2>Log</H2>
<p>Attention: The log contains your XPUBs. Anyone with your XPUBs can see your account history.</p>
<textarea value={JSON.stringify(props.log.entries)} readOnly />
</div>
);
};
export default connect(
(state: State) => ({
log: state.log,
}),
(dispatch: Dispatch) => ({
toggle: bindActionCreators(LogActions.toggle, dispatch),
}),
)(Log);