Skip to content

Commit

Permalink
chore(lint): fix lint and react warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
schnogz committed Jul 23, 2021
1 parent bea8b3e commit 5425cc0
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const CoinDisplay = (props) => {
weight={weight}
italic={italic}
color={color}
cursor={cursor}
cursor={cursor || undefined}
data-e2e={`${coin}Amt`}
{...rest}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const FiatDisplay = (props) => {
size={size}
weight={weight}
color={color}
cursor={cursor}
cursor={cursor || undefined}
data-e2e={`${coin}FiatAmt`}
{...rest}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,26 @@ const CoinText = styled(Text)`
display: flex;
`
const ItemIcon = styled(Icon)`
color: ${props => props.theme[props.color]} !important;
color: ${(props) => props.theme[props.color]} !important;
`
const SelectBoxCoin = styled(SelectBox)`
.bc__control {
border: 0px !important;
}
.bc__dropdown-indicator {
padding-left: 0px;
color: ${props => props.theme.black};
color: ${(props) => props.theme.black};
}
.bc__single-value {
color: ${props => props.theme.black};
color: ${(props) => props.theme.black};
transform: initial;
position: relative;
max-width: none;
top: initial;
}
`

const renderItem = props => {
const renderItem = (props) => {
const { text, value, ...rest } = props
const coinValue = value || 'BTC'
return (
Expand All @@ -59,18 +59,12 @@ const renderItem = props => {
const renderDisplay = (props, children) => {
const { value } = props
const coinValue = value || 'BTC'
const e2eTag = coinValue + 'CurrencyOption'
const e2eTag = `${coinValue}CurrencyOption`

return (
<HeaderWrapper>
<Icon name={coinValue} color={coinValue} size='22px' weight={400} />
<CoinText
size='18px'
weight={500}
color='black'
cursor='pointer'
data-e2e={e2eTag}
>
<CoinText size='18px' weight={500} color='black' cursor='pointer' data-e2e={e2eTag}>
{children} ({value})
</CoinText>
</HeaderWrapper>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ export const getCoins = () => [
{ text: 'Bitcoin Cash', value: 'BCH' },
{ text: 'Stellar', value: 'XLM' }
]

export default getCoins
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class HeaderContainer extends React.PureComponent<Props> {
}
}

const mapDispatchToProps = dispatch => ({
const mapDispatchToProps = (dispatch) => ({
actions: bindActionCreators(actions.components.layoutWallet, dispatch),
modalActions: bindActionCreators(actions.modals, dispatch),
refreshActions: bindActionCreators(actions.components.refresh, dispatch)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const BlockchainLogoImage = styled(Image)`
margin-left: 0;
`
const NavbarStyled = styled(Navbar)`
background-color: ${props => props.theme.grey900};
background-color: ${(props) => props.theme.grey900};
`

const Large: React.FC<Props> = props => {
const Large: React.FC<Props> = (props) => {
return (
<NavbarStyled height='60px'>
<NavbarHeader>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,7 @@ import { NavLink } from 'react-router-dom'
import styled from 'styled-components'

import { Image } from 'blockchain-info-components'
import {
Navbar,
NavbarBrand,
NavbarDivider,
NavbarHeader,
NavbarNav
} from 'components/Navbar'
import { Navbar, NavbarBrand, NavbarDivider, NavbarHeader, NavbarNav } from 'components/Navbar'

import Balances from '../MenuLeft/Balances'
import { Props as OwnProps } from '.'
Expand All @@ -27,7 +21,7 @@ const Spacer = styled.div``
const NavbarContainer = styled.div`
width: auto;
padding: 0 16px;
background-color: ${props => props.theme.grey900};
background-color: ${(props) => props.theme.grey900};
`

const BlockchainLogoImage = styled(Image)`
Expand All @@ -39,13 +33,13 @@ const BlockchainLogoImage = styled(Image)`
const NavbarBottomStyled = styled(Navbar)`
display: flex;
box-sizing: border-box;
border-top: 1px solid ${props => props.theme.whiteFade100};
border-top: 1px solid ${(props) => props.theme.whiteFade100};
`

const Medium: React.FC<Props> = props => {
const Medium: React.FC<Props> = (props) => {
return (
<NavbarContainer>
<Navbar>
<Navbar height='60px'>
<NavbarHeader>
<NavbarBrand>
<NavLink to='/home' data-e2e='homeLink'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const Spacer = styled.div``
const NavbarContainer = styled.div`
width: auto;
padding: 0 16px;
background-color: ${props => props.theme.grey900};
background-color: ${(props) => props.theme.grey900};
`

const BlockchainLogoImage = styled(Image)`
Expand All @@ -41,17 +41,17 @@ const NavbarBottomStyled = styled(Navbar)`
display: flex;
box-sizing: border-box;
justify-content: space-between;
border-top: 1px solid ${props => props.theme.whiteFade100};
border-top: 1px solid ${(props) => props.theme.whiteFade100};
`

const HamburgerIcon = styled(Icon)`
margin-right: 16px;
`

const Small: React.FC<Props> = props => {
const Small: React.FC<Props> = (props) => {
return (
<NavbarContainer>
<Navbar>
<Navbar height='60px'>
<NavbarHeader>
<NavbarBrand>
<NavLink to='/home' data-e2e='homeLink'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,12 @@ import Large from './template.large'
import Medium from './template.medium'
import Small from './template.small'

const Header = props => {
const Header = (props) => {
const isLaptop = useMedia('laptop')
const isTablet = useMedia('tablet')

return (
<>
{isTablet ? (
<Small {...props} />
) : isLaptop ? (
<Medium {...props} />
) : (
<Large {...props} />
)}
</>
<>{isTablet ? <Small {...props} /> : isLaptop ? <Medium {...props} /> : <Large {...props} />}</>
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@ import { FormattedMessage } from 'react-intl'
import styled from 'styled-components'

import { Icon } from 'blockchain-info-components'
import {
IconBackground,
SceneHeader,
SceneHeaderText,
SceneSubHeaderText
} from 'components/Layout'
import { IconBackground, SceneHeader, SceneHeaderText, SceneSubHeaderText } from 'components/Layout'

const HeaderWrapper = styled.div`
width: 100%;
Expand All @@ -22,10 +17,7 @@ const LockboxHeader = () => {
<Icon name='hardware' color='blue600' size='21px' />
</IconBackground>
<SceneHeaderText>
<FormattedMessage
id='scenes.hardware.title'
defaultMessage='Hardware'
/>
<FormattedMessage id='scenes.hardware.title' defaultMessage='Hardware' />
</SceneHeaderText>
</SceneHeader>
<SceneSubHeaderText>
Expand Down

0 comments on commit 5425cc0

Please sign in to comment.