mirror of
https://github.com/trezor/trezor-wallet
synced 2024-12-25 16:38:08 +00:00
Rename 'Selection' components to 'Menu' in 'LeftNavigation'
This commit is contained in:
parent
a43112a6cf
commit
113b2535e0
@ -45,22 +45,22 @@ const RowAccountWrapper = styled.div`
|
||||
const RowAccount = ({
|
||||
accountIndex, balance, url, isSelected = false,
|
||||
}) => (
|
||||
<NavLink to={url}>
|
||||
<RowAccountWrapper
|
||||
to={url}
|
||||
isSelected={isSelected}
|
||||
>
|
||||
<Row column>
|
||||
Account #{accountIndex + 1}
|
||||
{balance ? (
|
||||
<span>{balance}</span>
|
||||
) : (
|
||||
<span>Loading...</span>
|
||||
)}
|
||||
</Row>
|
||||
</RowAccountWrapper>
|
||||
</NavLink>
|
||||
);
|
||||
<NavLink to={url}>
|
||||
<RowAccountWrapper
|
||||
to={url}
|
||||
isSelected={isSelected}
|
||||
>
|
||||
<Row column>
|
||||
Account #{accountIndex + 1}
|
||||
{balance ? (
|
||||
<span>{balance}</span>
|
||||
) : (
|
||||
<span>Loading...</span>
|
||||
)}
|
||||
</Row>
|
||||
</RowAccountWrapper>
|
||||
</NavLink>
|
||||
);
|
||||
RowAccount.propTypes = {
|
||||
accountIndex: PropTypes.number.isRequired,
|
||||
url: PropTypes.string.isRequired,
|
||||
@ -68,7 +68,7 @@ RowAccount.propTypes = {
|
||||
isSelected: PropTypes.bool,
|
||||
};
|
||||
|
||||
const AccountSelection = (props: Props): ?React$Element<string> => {
|
||||
const AccountMenu = (props: Props): ?React$Element<string> => {
|
||||
const selected = props.wallet.selectedDevice;
|
||||
if (!selected) return null;
|
||||
|
||||
@ -204,4 +204,4 @@ const AccountSelection = (props: Props): ?React$Element<string> => {
|
||||
);
|
||||
};
|
||||
|
||||
export default AccountSelection;
|
||||
export default AccountMenu;
|
@ -31,13 +31,13 @@ const Logo = styled.div`
|
||||
const CoinName = ({
|
||||
coinImg, text,
|
||||
}) => (
|
||||
<CoinNameWrapper>
|
||||
<Logo
|
||||
coinImg={coinImg}
|
||||
/>
|
||||
<p>{text}</p>
|
||||
</CoinNameWrapper>
|
||||
);
|
||||
<CoinNameWrapper>
|
||||
<Logo
|
||||
coinImg={coinImg}
|
||||
/>
|
||||
<p>{text}</p>
|
||||
</CoinNameWrapper>
|
||||
);
|
||||
CoinName.propTypes = {
|
||||
coinImg: PropTypes.string.isRequired,
|
||||
text: PropTypes.string.isRequired,
|
||||
@ -56,21 +56,21 @@ const RowCoinWrapper = styled.div`
|
||||
const RowCoin = ({
|
||||
coin, icon,
|
||||
}) => (
|
||||
<RowCoinWrapper>
|
||||
<Row>
|
||||
<CoinName
|
||||
coinImg={coin.img}
|
||||
text={coin.name}
|
||||
/>
|
||||
{icon && (
|
||||
<Icon
|
||||
icon={icon.type}
|
||||
color={icon.color}
|
||||
<RowCoinWrapper>
|
||||
<Row>
|
||||
<CoinName
|
||||
coinImg={coin.img}
|
||||
text={coin.name}
|
||||
/>
|
||||
)}
|
||||
</Row>
|
||||
</RowCoinWrapper>
|
||||
);
|
||||
{icon && (
|
||||
<Icon
|
||||
icon={icon.type}
|
||||
color={icon.color}
|
||||
/>
|
||||
)}
|
||||
</Row>
|
||||
</RowCoinWrapper>
|
||||
);
|
||||
RowCoin.propTypes = {
|
||||
coin: PropTypes.shape({
|
||||
img: PropTypes.string.isRequired,
|
||||
@ -83,7 +83,7 @@ RowCoin.propTypes = {
|
||||
};
|
||||
|
||||
|
||||
class CoinSelection extends Component {
|
||||
class CoinMenu extends Component {
|
||||
getBaseUrl() {
|
||||
const { selectedDevice } = this.props.wallet;
|
||||
let baseUrl = '';
|
||||
@ -147,11 +147,11 @@ class CoinSelection extends Component {
|
||||
}
|
||||
}
|
||||
|
||||
CoinSelection.propTypes = {
|
||||
CoinMenu.propTypes = {
|
||||
config: PropTypes.object,
|
||||
wallet: PropTypes.object,
|
||||
selectedDevice: PropTypes.object,
|
||||
localStorage: PropTypes.object,
|
||||
};
|
||||
|
||||
export default CoinSelection;
|
||||
export default CoinMenu;
|
@ -0,0 +1,4 @@
|
||||
export { default as AccountMenu } from './AccountMenu';
|
||||
export { default as CoinMenu } from './CoinMenu';
|
||||
export { DeviceSelect } from './DeviceMenu';
|
||||
export { DeviceDropdown } from './DeviceMenu';
|
@ -1,4 +0,0 @@
|
||||
export { default as AccountSelection } from './AccountSelection';
|
||||
export { default as CoinSelection } from './CoinSelection';
|
||||
export { DeviceSelect } from './DeviceSelection';
|
||||
export { DeviceDropdown } from './DeviceSelection';
|
@ -5,11 +5,11 @@ import styled from 'styled-components';
|
||||
|
||||
import type { TrezorDevice } from 'flowtype';
|
||||
import {
|
||||
AccountSelection,
|
||||
CoinSelection,
|
||||
AccountMenu,
|
||||
CoinMenu,
|
||||
DeviceSelect,
|
||||
DeviceDropdown,
|
||||
} from './Selection';
|
||||
} from './Menu';
|
||||
import StickyContainer from './StickyContainer';
|
||||
|
||||
import type { Props } from './index';
|
||||
@ -72,7 +72,7 @@ const LeftNavigation = (props: Props): React$Element<typeof StickyContainer | st
|
||||
animationType = 'slide-left';
|
||||
// menu = (
|
||||
// <TransitionMenu animationType="slide-left">
|
||||
// <AccountSelection {...props} />
|
||||
// <AccountMenu {...props} />
|
||||
// </TransitionMenu>
|
||||
// );
|
||||
} else if (selected.features && !selected.features.bootloader_mode && selected.features.initialized) {
|
||||
@ -81,7 +81,7 @@ const LeftNavigation = (props: Props): React$Element<typeof StickyContainer | st
|
||||
animationType = 'slide-right';
|
||||
// menu = (
|
||||
// <TransitionMenu animationType="slide-right">
|
||||
// <CoinSelection {...props} />
|
||||
// <CoinMenu {...props} />
|
||||
// </TransitionMenu>
|
||||
// );
|
||||
}
|
||||
@ -97,8 +97,8 @@ const LeftNavigation = (props: Props): React$Element<typeof StickyContainer | st
|
||||
<TransitionMenu
|
||||
animationType={animationType}
|
||||
>
|
||||
{animationType === 'slide-left' && <AccountSelection key="accounts" {...props} />}
|
||||
{animationType === 'slide-right' && <CoinSelection key="coins" {...props} />}
|
||||
{animationType === 'slide-left' && <AccountMenu key="accounts" {...props} />}
|
||||
{animationType === 'slide-right' && <CoinMenu key="coins" {...props} />}
|
||||
</TransitionMenu>
|
||||
)}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user