Browse Source

Remove device from sidebar

master
meriadec 7 years ago
parent
commit
935c24cc18
No known key found for this signature in database GPG Key ID: 1D2FC2305E2CB399
  1. 32
      src/components/SideBar/index.js

32
src/components/SideBar/index.js

@ -9,9 +9,8 @@ import { connect } from 'react-redux'
import { MODAL_SEND, MODAL_RECEIVE, MODAL_ADD_ACCOUNT } from 'constants' import { MODAL_SEND, MODAL_RECEIVE, MODAL_ADD_ACCOUNT } from 'constants'
import type { MapStateToProps } from 'react-redux' import type { MapStateToProps } from 'react-redux'
import type { Accounts, T, Device } from 'types/common' import type { Accounts, T } from 'types/common'
import { getCurrentDevice } from 'reducers/devices'
import { openModal } from 'reducers/modals' import { openModal } from 'reducers/modals'
import { getVisibleAccounts } from 'reducers/accounts' import { getVisibleAccounts } from 'reducers/accounts'
@ -26,7 +25,6 @@ import IconCurrencyBitcoin from 'icons/currencies/Bitcoin'
import Box, { Tabbable } from 'components/base/Box' import Box, { Tabbable } from 'components/base/Box'
import GrowScroll from 'components/base/GrowScroll' import GrowScroll from 'components/base/GrowScroll'
import Text from 'components/base/Text'
import Item from './Item' import Item from './Item'
const CapsSubtitle = styled(Box).attrs({ const CapsSubtitle = styled(Box).attrs({
@ -44,15 +42,6 @@ const Container = styled(Box)`
width: ${p => p.theme.sizes.sideBarWidth}px; width: ${p => p.theme.sizes.sideBarWidth}px;
` `
const Connected = styled(Box).attrs({
bg: p => (p.state ? 'green' : 'grenade'),
mx: 3,
})`
border-radius: 50%;
height: 10px;
width: 10px;
`
const PlusBtn = styled(Tabbable).attrs({ const PlusBtn = styled(Tabbable).attrs({
p: 1, p: 1,
m: -1, m: -1,
@ -72,12 +61,10 @@ type Props = {
t: T, t: T,
accounts: Accounts, accounts: Accounts,
openModal: Function, openModal: Function,
currentDevice: Device,
} }
const mapStateToProps: MapStateToProps<*, *, *> = state => ({ const mapStateToProps: MapStateToProps<*, *, *> = state => ({
accounts: getVisibleAccounts(state), accounts: getVisibleAccounts(state),
currentDevice: getCurrentDevice(state),
}) })
const mapDispatchToProps = { const mapDispatchToProps = {
@ -86,7 +73,7 @@ const mapDispatchToProps = {
class SideBar extends PureComponent<Props> { class SideBar extends PureComponent<Props> {
render() { render() {
const { t, accounts, openModal, currentDevice } = this.props const { t, accounts, openModal } = this.props
return ( return (
<Container bg="white"> <Container bg="white">
@ -131,21 +118,6 @@ class SideBar extends PureComponent<Props> {
</GrowScroll> </GrowScroll>
</Box> </Box>
</Box> </Box>
<Box borderColor="argile" borderWidth={1} borderTop horizontal py={2}>
<Box align="center" justify="center">
<Connected state={currentDevice !== null} />
</Box>
<Box>
<Box>
<Text fontSize={1}>Ledger Nano S</Text>
</Box>
<Box>
<Text fontSize={0} color="grey">
{t(currentDevice !== null ? 'device.connected' : 'device.notConnected')}
</Text>
</Box>
</Box>
</Box>
</Container> </Container>
) )
} }

Loading…
Cancel
Save