2017-06-26 22:27:55 +00:00
|
|
|
// @flow
|
|
|
|
import React from 'react';
|
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import translate from 'translations';
|
|
|
|
|
|
|
|
export default class UnlockHeader extends React.Component {
|
2017-07-02 05:49:06 +00:00
|
|
|
props: {
|
|
|
|
title: string
|
|
|
|
};
|
|
|
|
static propTypes = {
|
|
|
|
title: PropTypes.string.isRequired
|
|
|
|
};
|
2017-06-26 22:27:55 +00:00
|
|
|
|
2017-07-02 05:49:06 +00:00
|
|
|
state: {
|
|
|
|
expanded: boolean
|
|
|
|
} = {
|
|
|
|
expanded: true
|
|
|
|
};
|
2017-06-26 22:27:55 +00:00
|
|
|
|
2017-07-02 05:49:06 +00:00
|
|
|
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 &&
|
|
|
|
<div>
|
|
|
|
{/* @@if (site === 'cx' ) { <cx-wallet-decrypt-drtv></cx-wallet-decrypt-drtv> }
|
2017-06-26 22:27:55 +00:00
|
|
|
@@if (site === 'mew' ) { <wallet-decrypt-drtv></wallet-decrypt-drtv> } */}
|
2017-07-02 05:49:06 +00:00
|
|
|
</div>}
|
2017-06-26 22:27:55 +00:00
|
|
|
|
2017-07-02 05:49:06 +00:00
|
|
|
{this.state.expanded && <hr />}
|
|
|
|
</article>
|
|
|
|
);
|
|
|
|
}
|
2017-06-26 22:27:55 +00:00
|
|
|
|
2017-07-02 05:49:06 +00:00
|
|
|
toggleExpanded = () => {
|
|
|
|
this.setState(state => {
|
|
|
|
return { expanded: !state.expanded };
|
|
|
|
});
|
|
|
|
};
|
2017-06-26 22:27:55 +00:00
|
|
|
}
|