mirror of https://github.com/trezor/trezor-wallet
Merge branch 'styled-components-refactor' of https://github.com/satoshilabs/trezor-wallet into styled-components-refactor
commit
37f8a24ee2
@ -0,0 +1,94 @@
|
||||
import React, { Component } from 'react';
|
||||
import styled from 'styled-components';
|
||||
import PropTypes from 'prop-types';
|
||||
import Icon from 'components/Icon';
|
||||
|
||||
import icons from 'config/icons';
|
||||
import colors from 'config/colors';
|
||||
import { FONT_SIZE } from 'config/variables';
|
||||
|
||||
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;
|
||||
`;
|
||||
|
||||
class MenuItems extends Component {
|
||||
// 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;
|
||||
// }
|
||||
// }
|
||||
|
||||
showClone() {
|
||||
return this.props.selectedDevice && this.props.selectedDevice.features.passphrase_protection && this.props.selectedDevice.connected && this.props.selectedDevice.available;
|
||||
}
|
||||
|
||||
showRenewSession() {
|
||||
return this.props.selectedDevice && this.props.selectedDevice.status !== 'available';
|
||||
}
|
||||
|
||||
render() {
|
||||
return (
|
||||
<Wrapper>
|
||||
<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>
|
||||
)}
|
||||
</Wrapper>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
};
|
||||
|
||||
export default MenuItems;
|
@ -1,88 +0,0 @@
|
||||
.loader-circle {
|
||||
|
||||
position: relative;
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
p {
|
||||
position: absolute;
|
||||
//margin: auto;
|
||||
//line-height: 100%;
|
||||
color: @color_text_secondary;
|
||||
}
|
||||
|
||||
.circular {
|
||||
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
animation: rotate 2s linear infinite;
|
||||
transform-origin: center center;
|
||||
|
||||
position: absolute;
|
||||
|
||||
.route {
|
||||
stroke: @color_gray_light;
|
||||
}
|
||||
|
||||
.path {
|
||||
stroke-dasharray: 1, 200;
|
||||
stroke-dashoffset: 0;
|
||||
animation: dash 1.5s ease-in-out infinite, color 6s ease-in-out infinite;
|
||||
stroke-linecap: round;
|
||||
}
|
||||
}
|
||||
|
||||
&.info {
|
||||
.path {
|
||||
animation: dash 1.5s ease-in-out infinite, colorInfo 6s ease-in-out infinite;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes dash {
|
||||
0% {
|
||||
stroke-dasharray: 1, 200;
|
||||
stroke-dashoffset: 0;
|
||||
}
|
||||
50% {
|
||||
stroke-dasharray: 89, 200;
|
||||
stroke-dashoffset: -35;
|
||||
}
|
||||
100% {
|
||||
stroke-dasharray: 89, 200;
|
||||
stroke-dashoffset: -124;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes color {
|
||||
100%, 0% {
|
||||
stroke: @color_green_primary;
|
||||
}
|
||||
40% {
|
||||
stroke: @color_green_primary;
|
||||
}
|
||||
66% {
|
||||
stroke: @color_green_secondary;
|
||||
}
|
||||
80%, 90% {
|
||||
stroke: @color_green_tertiary;
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes colorInfo {
|
||||
100%, 0% {
|
||||
stroke: @color_info_primary;
|
||||
}
|
||||
40% {
|
||||
stroke: @color_info_primary;
|
||||
}
|
||||
66% {
|
||||
stroke: @color_info_primary;
|
||||
}
|
||||
80%, 90% {
|
||||
stroke: @color_info_primary;
|
||||
}
|
||||
}
|
Loading…
Reference in new issue