add check using idx

This commit is contained in:
Barry Gitarts 2019-11-18 10:43:02 -05:00 committed by Barry G
parent 2c21f9fe0c
commit 6178061e6c
4 changed files with 15 additions and 6 deletions

View File

@ -347,6 +347,7 @@ module.exports = function(webpackEnv) {
},
},
],
require.resolve('babel-plugin-idx')
],
// This is a feature of `babel-loader` for webpack (not Babel itself).
// It enables caching results in ./node_modules/.cache/babel-loader/

View File

@ -80,6 +80,7 @@
"babel-eslint": "9.0.0",
"babel-jest": "23.6.0",
"babel-loader": "8.0.5",
"babel-plugin-idx": "^2.4.0",
"babel-plugin-named-asset-import": "^0.3.1",
"babel-preset-react-app": "^7.0.2",
"bfj": "6.1.1",
@ -112,6 +113,7 @@
"graphql": "^14.4.2",
"html-webpack-plugin": "4.0.0-alpha.2",
"identity-obj-proxy": "3.0.0",
"idx": "^2.5.6",
"ipfs": "^0.38.0",
"ipfs-http-client": "^38.2.0",
"jest": "23.6.0",

View File

@ -2,6 +2,7 @@ import React, { useContext, useState, useMemo, useEffect } from 'react'
import { Formik } from 'formik'
import { makeStyles } from '@material-ui/core/styles'
import classnames from 'classnames'
import idx from 'idx'
import { useQuery } from '@apollo/react-hooks'
import LiquidPledging from '../../embarkArtifacts/contracts/LiquidPledging'
import SwapProxy from '../../embarkArtifacts/contracts/SwapProxy'
@ -318,7 +319,7 @@ function FundProject({ match, history }) {
profileData={data.profile}
startPolling={startPolling}
/>
{!!Number(data.profile.pledgesInfos[0].lifetimeReceived) && <div className={classes.pledgesLink}>
{!!Number(idx(data, _ => _.profile.pledgesInfos[0].lifetimeReceived)) && <div className={classes.pledgesLink}>
<Typography>This project received pledges. You have funds available to withdraw.</Typography>
<Link to={`/pledges/${projectId}`} className={classes.link}>
<StatusButton buttonText="View Pledges" />

View File

@ -3285,6 +3285,11 @@ babel-plugin-emotion@^9.2.11:
source-map "^0.5.7"
touch "^2.0.1"
babel-plugin-idx@^2.4.0:
version "2.4.0"
resolved "https://registry.yarnpkg.com/babel-plugin-idx/-/babel-plugin-idx-2.4.0.tgz#5d144eb337fb22c4bf1ff75cb2e1c051a76a0323"
integrity sha512-+rEYZgSCLh0suJDlgZ64isSLhDW7Qxu6AnUMGhl/mW1kyYvfwqLqsDmgj3e5QXH0oX7A4Hq2x0BgqdU8tiuo5A==
babel-plugin-istanbul@^4.1.6:
version "4.1.6"
resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-4.1.6.tgz#36c59b2192efce81c5b378321b74175add1c9a45"
@ -7589,11 +7594,6 @@ embark@^4.1.0-beta.0:
window-size "1.1.1"
ws "7.1.2"
embarkjs-connector-web3@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/embarkjs-connector-web3/-/embarkjs-connector-web3-4.0.0.tgz#d474b23649668730082c7f6fa74b6a8c2cd0a447"
integrity sha512-mqLDRGawEfyqXgoSb2NgTwhlbAHwDrk7eyHrtEvywWgKfEPer+S+5IN+KGXi85d7QxcNKJSZ+BHve8wvWX0FfQ==
embarkjs-ens@^4.1.1:
version "4.1.1"
resolved "https://registry.yarnpkg.com/embarkjs-ens/-/embarkjs-ens-4.1.1.tgz#ab4a75a6eed31985fc5f9fb94c764d94013f0037"
@ -10613,6 +10613,11 @@ idna-uts46-hx@^2.3.1:
dependencies:
punycode "2.1.0"
idx@^2.5.6:
version "2.5.6"
resolved "https://registry.yarnpkg.com/idx/-/idx-2.5.6.tgz#1f824595070100ae9ad585c86db08dc74f83a59d"
integrity sha512-WFXLF7JgPytbMgelpRY46nHz5tyDcedJ76pLV+RJWdb8h33bxFq4bdZau38DhNSzk5eVniBf1K3jwfK+Lb5nYA==
ieee754@^1.1.4, ieee754@^1.1.8:
version "1.1.13"
resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.13.tgz#ec168558e95aa181fd87d37f55c32bbcb6708b84"