1
0
mirror of https://github.com/trezor/trezor-wallet synced 2025-01-24 15:00:58 +00:00

move forget device menu item to the bottom

This commit is contained in:
slowbackspace 2019-01-16 10:43:38 +01:00
parent 0efcc2c5be
commit 740661b4c6

View File

@ -27,19 +27,6 @@ const Label = styled.div`
`; `;
class MenuItems extends PureComponent { class MenuItems extends PureComponent {
onDeviceMenuClick(action, device) {
if (action === 'reload') {
this.props.acquireDevice();
} else if (action === 'forget') {
this.props.forgetDevice(device);
} else if (action === 'clone') {
this.props.duplicateDevice(device);
} else if (action === 'settings') {
this.props.toggleDeviceDropdown(false);
this.props.gotoDeviceSettings(device);
}
}
showDeviceMenu() { showDeviceMenu() {
const { device } = this.props; const { device } = this.props;
return device && device.mode === 'normal'; return device && device.mode === 'normal';
@ -55,9 +42,14 @@ class MenuItems extends PureComponent {
render() { render() {
if (!this.showDeviceMenu()) return null; if (!this.showDeviceMenu()) return null;
const { device } = this.props;
return ( return (
<Wrapper> <Wrapper>
{/* <Item onClick={() => this.onDeviceMenuClick('settings', this.props.device)}> {/* <Item onClick={() => {
this.props.toggleDeviceDropdown(false);
this.props.gotoDeviceSettings(device);
}}
>
<Icon <Icon
icon={icons.COG} icon={icons.COG}
size={25} size={25}
@ -65,16 +57,8 @@ class MenuItems extends PureComponent {
/> />
<Label>Device settings</Label> <Label>Device settings</Label>
</Item> */} </Item> */}
<Item onClick={() => this.onDeviceMenuClick('forget', this.props.device)}>
<Icon
icon={icons.EJECT}
size={25}
color={colors.TEXT_SECONDARY}
/>
<Label>Forget</Label>
</Item>
{this.showClone() && ( {this.showClone() && (
<Item onClick={() => this.onDeviceMenuClick('clone', this.props.device)}> <Item onClick={() => this.props.duplicateDevice(device)}>
<Icon <Icon
icon={icons.T1} icon={icons.T1}
size={25} size={25}
@ -85,12 +69,20 @@ class MenuItems extends PureComponent {
)} )}
{this.showRenewSession() && ( {this.showRenewSession() && (
<Item <Item
onClick={() => this.onDeviceMenuClick('reload')} onClick={() => this.props.acquireDevice()}
> >
<Icon icon={icons.T1} size={25} color={colors.TEXT_SECONDARY} /> <Icon icon={icons.T1} size={25} color={colors.TEXT_SECONDARY} />
<Label>Renew session</Label> <Label>Renew session</Label>
</Item> </Item>
)} )}
<Item onClick={() => this.props.forgetDevice(device)}>
<Icon
icon={icons.EJECT}
size={25}
color={colors.TEXT_SECONDARY}
/>
<Label>Forget device</Label>
</Item>
</Wrapper> </Wrapper>
); );
} }
@ -101,8 +93,8 @@ MenuItems.propTypes = {
acquireDevice: PropTypes.func.isRequired, acquireDevice: PropTypes.func.isRequired,
forgetDevice: PropTypes.func.isRequired, forgetDevice: PropTypes.func.isRequired,
duplicateDevice: PropTypes.func.isRequired, duplicateDevice: PropTypes.func.isRequired,
toggleDeviceDropdown: PropTypes.func.isRequired, // toggleDeviceDropdown: PropTypes.func.isRequired,
gotoDeviceSettings: PropTypes.func.isRequired, // gotoDeviceSettings: PropTypes.func.isRequired,
}; };
export default MenuItems; export default MenuItems;