Skip to content

Commit

Permalink
chore(vars): remove unused vars (#6245)
Browse files Browse the repository at this point in the history
  • Loading branch information
mperdomo-bc committed Jan 23, 2024
1 parent a770bb6 commit 0c7bdef
Show file tree
Hide file tree
Showing 57 changed files with 62 additions and 164 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useMemo } from 'react'
import { scaleTime, TimeDomain } from '@visx/scale'
import { scaleTime } from '@visx/scale'
import { extent } from 'd3-array'

export const useTimeScale = <DATA extends unknown = unknown>({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ const DragAndDrop = (props: Props) => {
}
}

const openUploader = (e) => {
const openUploader = (_) => {
if (inputFile && inputFile.current && inputFile.current !== undefined) {
inputFile.current.click()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default {
},
nextStep: () => {},
previousStep: () => {},
submitData: (files) => {}
submitData: (_) => {}
},
component: UploadAndVerify,
decorators: [
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { ReactNode } from 'react'
import React from 'react'
import styled from 'styled-components'

// Wrapper is static size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,22 @@ import styled from 'styled-components'

import { Link, Text } from 'blockchain-info-components'

const TermsContainer = styled.div<{ inline?: boolean; isCentered?: boolean }>`
const TermsContainer = styled.div<{ inline?: boolean }>`
& > * {
display: ${(props) => (props.inline ? 'inline' : 'inline-block')};
}
${(props) =>
props.isCentered &&
`
text-align: center;
`};
`
const Terms = (props) => {
const { company, isCentered = null, recovery, sofi } = props

type Props = {
company?: string
recovery?: boolean
}

const Terms = ({ company, recovery }: Props) => {
switch (company) {
case 'blockchain-kyc':
return (
<TermsContainer isCentered={isCentered}>
<TermsContainer>
<Text size='12px' weight={400}>
<FormattedMessage
id='scenes.register.registerform.blockchainkyc.read'
Expand Down Expand Up @@ -55,7 +55,7 @@ const Terms = (props) => {
)
case 'sofi':
return (
<TermsContainer style={{ paddingLeft: '4px' }} isCentered={isCentered} inline>
<TermsContainer style={{ paddingLeft: '4px' }} inline>
<Text color='grey800' size='12px' weight={500}>
<FormattedMessage
id='scenes.register.registerform.blockchain.read_1'
Expand Down Expand Up @@ -93,7 +93,7 @@ const Terms = (props) => {
)
case 'sofi-bakkt':
return (
<TermsContainer style={{ paddingLeft: '4px' }} isCentered={isCentered} inline>
<TermsContainer style={{ paddingLeft: '4px' }} inline>
<Text color='grey800' size='12px' weight={500}>
<FormattedMessage
id='scenes.register.registerform.blockchain.bakkt'
Expand All @@ -117,7 +117,7 @@ const Terms = (props) => {
)
default:
return (
<TermsContainer style={{ paddingLeft: recovery ? 0 : '4px' }} isCentered={isCentered}>
<TermsContainer style={{ paddingLeft: recovery ? 0 : '4px' }}>
{recovery ? (
<Text color='grey800' size='12px' weight={500} style={{ margin: '4px 0' }}>
<FormattedMessage
Expand Down
9 changes: 2 additions & 7 deletions packages/blockchain-wallet-v4-frontend/src/data/auth/sagas.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import base64url from 'base64url'
import Login from 'blockchain-wallet-v4-frontend/src/scenes/Login'
import { find, propEq } from 'ramda'
import { startSubmit, stopSubmit } from 'redux-form'
import { all, call, fork, put, select, take } from 'redux-saga/effects'
Expand All @@ -19,7 +18,6 @@ import {
ExchangeAuthOriginType,
ExchangeErrorCodes,
LoginRoutinePayloadType,
ModalName,
ProductEligibilityForUser
} from 'data/types'
import walletSagas from 'data/wallet/sagas'
Expand All @@ -45,6 +43,8 @@ import {
ProductAuthOptions
} from './types'

const LOGIN_FORM = 'login'

export default ({ api, coreSagas, networks }) => {
const logLocation = 'auth/sagas'
const { createExchangeUser, createUser, waitForUserData } = profileSagas({
Expand All @@ -63,8 +63,6 @@ export default ({ api, coreSagas, networks }) => {
const { saveGoals } = goalSagas({ api, coreSagas, networks })
const { generateCaptchaToken, startCoinWebsockets } = miscSagas()

const LOGIN_FORM = 'login'

const authNabu = function* (firstLogin?: boolean) {
yield put(
actions.components.identityVerification.fetchSupportedCountries({ scope: CountryScope.KYC })
Expand Down Expand Up @@ -372,9 +370,6 @@ export default ({ api, coreSagas, networks }) => {
const createExchangeUserFlag = (yield select(
selectors.core.walletOptions.getCreateExchangeUserOnSignupOrLogin
)).getOrElse(false)
const associateBeforeEmailVerification = (yield select(
selectors.core.walletOptions.getAssociateSofiBeforeEmailVerification
)).getOrElse(false)

if (!isAccountReset && !recovery && createExchangeUserFlag) {
if (firstLogin) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ import {
BrokerageModalOriginType,
BSCheckoutFormValuesType,
CustodialSanctionsEnum,
DeleteBankEndpointTypes,
ModalName,
ProductEligibilityForUser,
VerifyIdentityOriginType
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { promptForSecondPassword } from 'services/sagas'

import * as S from './selectors'
import { actions as A } from './slice'
import { DexSwapForm, DexSwapSide, DexSwapSteps } from './types'
import { DexSwapForm, DexSwapSteps } from './types'
import { getValidSwapAmount } from './utils'
import { parseRawTx } from './utils/parseRawTx'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ import {
EarnTransactionType,
PendingTransactionType,
RewardsDepositFormType,
StakingDepositFormType,
StakingWithdrawalFormType
StakingDepositFormType
} from './types'

const PASSIVE_REWARDS_DEPOSIT_FORM = 'passiveRewardsDepositForm'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { call, delay, put, select } from 'redux-saga/effects'
import { call, put, select } from 'redux-saga/effects'

import { APIType } from '@core/network/api'
import { errorHandler } from '@core/utils'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,7 @@ import { all, call, put, select } from 'redux-saga/effects'
import { Exchange, Remote } from '@core'
import { convertCoinToCoin } from '@core/exchange'
import { APIType } from '@core/network/api'
import {
GasCalculationOperations,
GasDataI,
NftAsset,
NftTemplateParams
} from '@core/network/api/nfts/types'
import { GasCalculationOperations, GasDataI, NftAsset } from '@core/network/api/nfts/types'
import {
calculateGasFees,
cancelNftOrder,
Expand Down Expand Up @@ -875,7 +870,7 @@ export default ({ api, coreSagas, networks }: { api: APIType; coreSagas; network
const handleRouterChange = function* (action) {
if (action.payload.location.pathname.includes('/nfts/')) {
const url = new URL(window.location.href)
const [hash, query] = url.href.split('#')[1].split('?')
const [, query] = url.href.split('#')[1].split('?')
// @ts-ignore
const params = Object.fromEntries(new URLSearchParams(query))

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { contains, toUpper } from 'ramda'
import { toUpper } from 'ramda'
import { call, put, select } from 'redux-saga/effects'

import { actions, selectors } from 'data'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import BigNumber from 'bignumber.js'
import bip21 from 'bip21'
import { add, equals, hasPath, identity, includes, isNil, nth, path, pathOr, prop } from 'ramda'
import { change, destroy, initialize, startSubmit, stopSubmit } from 'redux-form'
import { all, call, put, race, select, take } from 'redux-saga/effects'
import { call, put, race, select, take } from 'redux-saga/effects'

import { Exchange, utils } from '@core'
import { APIType } from '@core/network/api'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,6 @@ export default ({ api, coreSagas, networks }: { api: APIType; coreSagas; network
switch (action.meta.field) {
case 'from':
const fromPayload = payload as SendEthFormFromActionType['payload']
let source
switch (fromPayload.type) {
case 'ACCOUNT':
yield put(A.initialized(coin))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import * as AT from './actionTypes'

export {
arrayInsert,
arrayMove,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import { createSlice } from '@reduxjs/toolkit'

import LOG_LEVELS from './model'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { promptForInput } from 'services/sagas'
const { toCashAddr } = utils.bch
const GAP_LIMIT = 20

export default ({ coreSagas, networks }) => {
export default ({ networks }) => {
const logLocation = 'modules/addressesBch/sagas'

const editBchAccountLabel = function* (action) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import sha256 from 'crypto-js/sha256'
import { differenceInMilliseconds, subSeconds } from 'date-fns'
import { query } from 'express'
import { compose, equals, prop, sortBy, tail } from 'ramda'
import { stopSubmit } from 'redux-form'
import { call, cancel, delay, fork, put, race, select, spawn, take } from 'redux-saga/effects'
Expand All @@ -12,7 +11,6 @@ import { actions, actionTypes, selectors } from 'data'
import { LOGIN_FORM } from 'data/auth/model'
import { sendMessageToMobile } from 'data/auth/sagas.mobile'
import { Analytics, AuthMagicLink, ModalName, PlatformTypes, ProductAuthOptions } from 'data/types'
import { isNabuError, NabuError } from 'services/errors'
import { promptForSecondPassword } from 'services/sagas'

import * as A from './actions'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AxiosError } from 'axios'
import { type } from 'os'

import { SofiMigrationStatusResponseType } from '@core/network/api/sofi/types'
import type {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { and, compose, head, last, prop } from 'ramda'
import { call, put, select } from 'redux-saga/effects'

import { actions, selectors } from 'data'
import { actions } from 'data'

import * as A from './actions'
import { configEquals, splitPair } from './model'
import { configEquals } from './model'
import * as S from './selectors'

export default ({ api }) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ export default ({ api }) => {
try {
const guid = yield select(selectors.core.wallet.getGuid)
const email = (yield select(selectors.core.settings.getEmail)).getOrElse(undefined)
const unified = yield select(selectors.cache.getUnifiedAccountStatus)
const sessionToken = yield select(selectors.session.getWalletSessionId, guid, email)
yield call(api.deauthorizeBrowser, sessionToken)
yield put(actions.cache.removeStoredLogin())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { askSecondPasswordEnhancer } from 'services/sagas'

export default ({ api, coreSagas, networks }) => {
const logLocation = 'auth/sagas'
const SIGNUP_FORM = 'register'
const { createExchangeUser, createUser, generateRetailToken, setSession } = profileSagas({
api,
coreSagas,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { createSlice, PayloadAction } from '@reduxjs/toolkit'
import { boolean } from 'zod'

import { Remote } from '@core'

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { CoinType, Erc20CoinType, WalletFiatEnum, WalletFiatType } from '@core/types'
import { CoinType, Erc20CoinType, WalletFiatType } from '@core/types'

export type CoinCheckHookHelpers = {
isBCH: (coin: CoinType) => boolean
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import { useEffect, useState } from 'react'

export const useDebounce = <T>(val: T, delay: number): T => {
const [debounceVal, setDebounceVal] = useState<T>(val)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { FC, useEffect } from 'react'
import React, { useEffect } from 'react'
import { connect, ConnectedProps } from 'react-redux'
import { Redirect, Route, withRouter } from 'react-router-dom'
import { bindActionCreators } from 'redux'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const Wrapper = styled.div`
box-sizing: border-box;
`

export default (props) => (
export default () => (
<Wrapper>
<SkeletonRectangle height='20px' width='30%' />
<SkeletonRectangle height='40px' width='100%' style={spacing('mt-15')} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const insufficientFunds = (value, allValues, props) => {
return getEffectiveBalance(props) > 0 ? undefined : <InsufficientFundsMessage />
}

export const invalidAmount = (value, allValues, props) => {
export const invalidAmount = (value) => {
const valueBch = prop('coin', value)
const valueSatoshi = Exchange.convertCoinToCoin({
baseToStandard: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const Wrapper = styled.div`
box-sizing: border-box;
`

export default (props) => {
export default () => {
return (
<Wrapper>
<SkeletonRectangle height='20px' width='30%' />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { connect } from 'react-redux'
import PropTypes from 'prop-types'
import { bindActionCreators, compose } from 'redux'

import { actions, model, selectors } from 'data'
import { actions, selectors } from 'data'
import modalEnhancer from 'providers/ModalEnhancer'

import FirstStep from './FirstStep'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useEffect, useState } from 'react'
import React, { useEffect } from 'react'
import { connect, ConnectedProps, useDispatch } from 'react-redux'
import { compose } from 'redux'

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

import { BeneficiaryType, NabuSymbolNumberType } from '@core/types'
import { BeneficiaryType } from '@core/types'
import { Icon, Image, Text } from 'blockchain-info-components'
import { AddNewButton } from 'components/Brokerage'
import { FlyoutWrapper } from 'components/Flyout'
Expand Down
Loading

0 comments on commit 0c7bdef

Please sign in to comment.