diff --git a/src/components/modals/ImportAccounts/AccountRow.js b/src/components/modals/ImportAccounts/AccountRow.js index b9bb96b7..634ee51d 100644 --- a/src/components/modals/ImportAccounts/AccountRow.js +++ b/src/components/modals/ImportAccounts/AccountRow.js @@ -16,6 +16,7 @@ import IconCheck from 'icons/Check' type Props = { account: Account, isChecked: boolean, + isDisabled: boolean, onClick: Account => void, onAccountUpdate: Account => void, } @@ -69,11 +70,11 @@ export default class AccountRow extends PureComponent { _input = null render() { - const { account, isChecked, onClick } = this.props + const { account, isChecked, onClick, isDisabled } = this.props const { isEditing, accountNameCopy } = this.state return ( - onClick(account)}> + onClick(account)} isDisabled={isDisabled}> {isEditing ? ( @@ -108,7 +109,7 @@ export default class AccountRow extends PureComponent { fontSize={4} color="grey" /> - + ) } @@ -123,9 +124,12 @@ const AccountRowContainer = styled(Box).attrs({ })` height: 48px; border-radius: 4px; - cursor: pointer; + + opacity: ${p => (p.isDisabled ? 0.5 : 1)}; + pointer-events: ${p => (p.isDisabled ? 'none' : 'auto')}; &:hover { + cursor: pointer; background-color: ${p => darken(p.theme.colors.lightGrey, 0.015)}; } diff --git a/src/components/modals/ImportAccounts/steps/03-step-import.js b/src/components/modals/ImportAccounts/steps/03-step-import.js index c884428e..05463305 100644 --- a/src/components/modals/ImportAccounts/steps/03-step-import.js +++ b/src/components/modals/ImportAccounts/steps/03-step-import.js @@ -102,7 +102,7 @@ class StepImport extends PureComponent { } render() { - const { scanStatus, err, scannedAccounts, checkedAccountsIds } = this.props + const { scanStatus, err, scannedAccounts, checkedAccountsIds, existingAccounts } = this.props return ( @@ -111,11 +111,14 @@ class StepImport extends PureComponent { {scannedAccounts.map(account => { const isChecked = checkedAccountsIds.find(id => id === account.id) !== undefined + const existingAccount = existingAccounts.find(a => a.id === account.id) + const isDisabled = existingAccount !== undefined return ( @@ -153,4 +156,8 @@ class StepImport extends PureComponent { export default StepImport -export const StepImportFooter = (props: StepProps) =>
noetuhnoethunot
+export const StepImportFooter = ({ scanStatus, transitionTo, t }: StepProps) => ( + +)