mirror of https://github.com/trezor/trezor-wallet
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.9 KiB
94 lines
2.9 KiB
6 years ago
|
import React, { Component } from 'react';
|
||
|
import styled from 'styled-components';
|
||
6 years ago
|
import PropTypes from 'prop-types';
|
||
6 years ago
|
import Icon from 'components/Icon';
|
||
6 years ago
|
|
||
6 years ago
|
import icons from 'config/icons';
|
||
|
import colors from 'config/colors';
|
||
6 years ago
|
import { FONT_SIZE } from 'config/variables';
|
||
6 years ago
|
|
||
6 years ago
|
const Wrapper = styled.div`
|
||
|
padding: 0px 24px 8px 19px;
|
||
|
border-bottom: 1px solid ${colors.DIVIDER};
|
||
|
background: ${colors.WHITE};
|
||
|
`;
|
||
|
|
||
|
const Item = styled.div`
|
||
|
padding: 4px 2px;
|
||
|
display: flex;
|
||
|
align-items: center;
|
||
|
font-size: ${FONT_SIZE.SMALL};
|
||
|
line-height: 24px;
|
||
|
cursor: pointer;
|
||
|
color: ${colors.TEXT_SECONDARY};
|
||
|
`;
|
||
|
|
||
|
const Label = styled.div`
|
||
|
padding-left: 15px;
|
||
|
`;
|
||
6 years ago
|
|
||
|
class MenuItems extends Component {
|
||
6 years ago
|
// makeAction(action, device) {
|
||
|
// switch (action) {
|
||
|
// case 'reload': this.props.acquireDevice();
|
||
|
// break;
|
||
|
// case 'forget': this.props.forgetDevice();
|
||
|
// break;
|
||
|
// case 'clone': this.props.duplicateDevice();
|
||
|
// break;
|
||
|
// case 'settings': {
|
||
|
// this.props.toggleDeviceDropdown(false);
|
||
|
// this.props.gotoDeviceSettings(device);
|
||
|
// break;
|
||
|
// }
|
||
|
// default: console.log('no action');
|
||
|
// break;
|
||
|
// }
|
||
|
// }
|
||
6 years ago
|
|
||
6 years ago
|
showClone() {
|
||
6 years ago
|
return this.props.selectedDevice && this.props.selectedDevice.features.passphrase_protection && this.props.selectedDevice.connected && this.props.selectedDevice.available;
|
||
6 years ago
|
}
|
||
|
|
||
|
showRenewSession() {
|
||
6 years ago
|
return this.props.selectedDevice && this.props.selectedDevice.status !== 'available';
|
||
6 years ago
|
}
|
||
|
|
||
|
render() {
|
||
|
return (
|
||
|
<Wrapper>
|
||
6 years ago
|
<Item>
|
||
|
<Icon icon={icons.COG} size={25} color={colors.TEXT_SECONDARY} />
|
||
|
<Label>Device settings</Label>
|
||
|
</Item>
|
||
|
<Item>
|
||
|
<Icon icon={icons.EJECT} size={25} color={colors.TEXT_SECONDARY} />
|
||
|
<Label>Forget</Label>
|
||
|
</Item>
|
||
|
{this.showClone() && (
|
||
|
<Item>
|
||
|
<Icon icon={icons.T1} size={25} color={colors.TEXT_SECONDARY} />
|
||
|
<Label>Create hidden wallet</Label>
|
||
|
</Item>
|
||
|
)}
|
||
|
{this.showRenewSession() && (
|
||
|
<Item>
|
||
|
<Icon icon={icons.T1} size={25} color={colors.TEXT_SECONDARY} />
|
||
|
<Label>Renew session</Label>
|
||
|
</Item>
|
||
|
)}
|
||
6 years ago
|
</Wrapper>
|
||
|
);
|
||
|
}
|
||
|
}
|
||
|
|
||
6 years ago
|
MenuItems.propTypes = {
|
||
|
selectedDevice: PropTypes.object.isRequired,
|
||
|
acquireDevice: PropTypes.func.isRequired,
|
||
|
forgetDevice: PropTypes.func.isRequired,
|
||
|
duplicateDevice: PropTypes.func.isRequired,
|
||
|
toggleDeviceDropdown: PropTypes.func.isRequired,
|
||
|
gotoDeviceSettings: PropTypes.func.isRequired,
|
||
|
};
|
||
|
|
||
6 years ago
|
export default MenuItems;
|