Skip to content

Commit

Permalink
EDIT : fixed all warnings(optimize imports, remove unused variables, …
Browse files Browse the repository at this point in the history
…add '// eslint-disable-next-line' where inevitable)
  • Loading branch information
fl-y committed Apr 14, 2020
1 parent 3cf4080 commit 099b73d
Show file tree
Hide file tree
Showing 36 changed files with 21 additions and 48 deletions.
2 changes: 0 additions & 2 deletions src/Root.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ import consts from "src/constants/consts";
import App from "./App";
// comment this out if you do not plan on using firebase
import "./firebase";

// redux
import {Provider} from "react-redux";
import configure from "./store/configure";

// Mui
import {createMuiTheme, MuiThemeProvider} from "@material-ui/core/styles";

Expand Down
4 changes: 3 additions & 1 deletion src/assets/common/spin.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/dashboard/playstore.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/assets/footer/playstore_btn.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 0 additions & 3 deletions src/components/Account/Address/Address.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,12 @@ import copy from "copy-to-clipboard";
import {divide, fixed, multiply, sumArray} from "src/lib/Big";
import {useSelector} from "react-redux";
import Decimal from "src/components/common/Decimal";

// assets
import qrSVG from "src/assets/account/qr_code.svg";
import QrModal from "../QrModal";
import DisplayLongString from "src/components/common/DisplayLongString";

const cx = cn.bind(styles);
const ADDRESS_LENGTH = 42;
const ADDRESS_CUT_DISPLAY_LENGTH = 6;
export default function Address({account = {}, prices = []}) {
const bnbPrice = useSelector(state => state.blockchain.status?.price);
const [showModal, setShowModal] = React.useState(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import Decimal from "src/components/common/Decimal";
import tooltips from "src/constants/tooltips";
import Skeleton from "react-skeleton-loader";
import DisplayIcon from "src/components/common/DisplayIcon/DisplayIcon";

// assets
import symbolNoneSVG from "src/assets/transactions/symbol_none.svg";

Expand Down
1 change: 0 additions & 1 deletion src/components/Account/AssetTxs/TxTableRows/pickData.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import {NavLink} from "react-router-dom";
// components
import Skeleton from "react-skeleton-loader";
import Decimal from "src/components/common/Decimal";

// assets
import greenArrowSVG from "src/assets/common/transferarrow_gr.svg";
import redArrowSVG from "src/assets/common/transferarrow_rd.svg";
Expand Down
1 change: 0 additions & 1 deletion src/components/Asset/TxHolders/TxTableRows/TxTableRows.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import getTxType from "src/constants/getTxType";
import {TableCell, TableRow} from "@material-ui/core";
import Skeleton from "react-skeleton-loader";
import SvgDisplay from "src/components/common/SvgDisplay";

// assets
import greenArrowSVG from "src/assets/common/transferarrow_gr.svg";

Expand Down
1 change: 0 additions & 1 deletion src/components/AssetList/StatusCard/StatusCard.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import {useHistory} from "src/hooks";
import Chart from "src/components/common/Chart/Chart";
import DisplayIcon from "src/components/common/DisplayIcon";
import Spinner from "src/components/common/Spinner";

// assets
import upSVG from "src/assets/assets/up_gr.svg";
import downSVG from "src/assets/assets/down_rd.svg";
Expand Down
3 changes: 1 addition & 2 deletions src/components/AssetList/TableRow/TableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import {fixed} from "src/lib/Big";
import {Fade, TableCell, TableRow, Tooltip} from "@material-ui/core";
import Skeleton from "react-skeleton-loader";
import DisplayIcon from "src/components/common/DisplayIcon";
// import humanFormat from "human-format";

// assets
import symbolNoneSVG from "src/assets/transactions/symbol_none.svg";
// import humanFormat from "human-format";

const cx = cn.bind(styles);

Expand Down
2 changes: 1 addition & 1 deletion src/components/Block/BlockHeader/BlockHeader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as React from "react";
import cn from "classnames/bind";
import styles from "./BlockHeader.scss";

import {_, formatNumber, getTotalTime, setAgoTime} from "src/lib/scripts";
import {_, getTotalTime, setAgoTime} from "src/lib/scripts";
// components
import InfoRow from "src/components/common/InfoRow";
import Skeleton from "react-skeleton-loader";
Expand Down
1 change: 0 additions & 1 deletion src/components/Block/BlockTitle/BlockTitle.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import styles from "./BlockTitle.scss";
import classNames from "classnames/bind";

// assets
import RightArrowSVG from "src/assets/common/arrow_ic.svg";

Expand Down
3 changes: 2 additions & 1 deletion src/components/BlockList/Table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* A LOT of refactoring will probably be needed if attempted to fix.
* You have been warned
*/
import React, {useEffect, useMemo, useCallback} from "react";
import React, {useCallback, useEffect, useMemo} from "react";
import styles from "./Table.scss";
import classNames from "classnames/bind";
// utils
Expand Down Expand Up @@ -113,6 +113,7 @@ export default function(props) {
const onMouseLeave = useCallback(() => {
if (!state.isFront || state.maxIndex !== state.pageData?.[0]?.[BASE_PROPERTY]) return;
setRealTime(true);
// eslint-disable-next-line
}, [setRealTime, state.isFront]);

return (
Expand Down
2 changes: 0 additions & 2 deletions src/components/BlockList/TableRow/TableRow.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import customStyle from "./TableRow.scss";
import classNames from "classnames/bind";
import {NavLink} from "react-router-dom";
import {reduceString, setAgoTime} from "src/lib/scripts";

// redux
import {useSelector} from "react-redux";

// components
import {TableCell, TableRow} from "@material-ui/core";
import Skeleton from "react-skeleton-loader";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import * as React from "react";
import cn from "classnames/bind";
import styles from "./TableRow.scss";
import {NavLink} from "react-router-dom";

// redux
import {useSelector} from "react-redux";

// components
import {TableCell, TableRow} from "@material-ui/core";
import Skeleton from "react-skeleton-loader";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import GraphDisplay from "./GraphDisplay";
import PriceDisplay from "./PriceDisplay";
import BlocksDisplay from "./BlocksDisplay";
import TxDisplay from "./TxDisplay";

// assets
import exchangeSVG from "src/assets/dashboard/exchange_ic.svg";
import dexSVG from "src/assets/dashboard/dex_ic.svg";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,3 @@ const options = {
renderTo: "container",
},
};
const margin = [
[5, 20, 20, 10],
[5, 20, 20, 10],
];
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Skeleton from "react-skeleton-loader";
// redux
import {useSelector} from "react-redux";
import consts from "src/constants/consts";

// svgs
import down_rd from "src/assets/common/arrow_down.svg";
import up_gr from "src/assets/common/arrow_up.svg";
Expand Down
1 change: 0 additions & 1 deletion src/components/Dashboard/SearchArea/SearchArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import styles from "./SearchArea.scss";
import SearchArea from "src/components/common/SearchArea";
import consts from "src/constants/consts";
import LinkCard from "src/components/Dashboard/LinkCard";

// assets
import iosIcon from "src/assets/dashboard/appstore_img.svg";
import googleIcon from "src/assets/dashboard/playstore.svg";
Expand Down
5 changes: 2 additions & 3 deletions src/components/Tx/TxData/TxMessage/TxMessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import styles from "./TxMessage.scss";
import cn from "classnames/bind";
import {NavLink} from "react-router-dom";
import {divide, multiply} from "src/lib/Big";
import {_, empty, formatNumber, reduceString, refineAddress, getTotalTime} from "src/lib/scripts";
import {_, empty, formatNumber, getTotalTime, refineAddress} from "src/lib/scripts";
// redux
import {useSelector} from "react-redux";
// hooks
Expand All @@ -23,7 +23,6 @@ import tooltips from "src/constants/tooltips";
import Decimal from "src/components/common/Decimal";
import DisplayIcon from "src/components/common/DisplayIcon";
import Skeleton from "react-skeleton-loader";

// assets
import arrowSVG from "src/assets/transactions/symbol_arrow.svg";
import transferArrowSVG from "src/assets/transactions/transferArrow.svg";
Expand Down Expand Up @@ -299,7 +298,7 @@ const TxSubmitProposal = ({txData, value}) => {
<InfoRow label='Expire Time'>{getTotalTime(description.expire_time)}</InfoRow>
</>
),
[description, displaySymbol, listingSymbol]
[description, displaySymbol, listingSymbol, value]
);
if (value.proposal_type !== "ListTradingPair") return <InfoRow label='Type'>{value.proposal_type} - not implemented yet</InfoRow>;
return render;
Expand Down
1 change: 0 additions & 1 deletion src/components/Tx/TxInfo/TxInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {setAgoTime} from "src/lib/scripts";
// components
import InfoRow from "src/components/common/InfoRow";
import DisplayLongString from "src/components/common/DisplayLongString";

// assets
import failSVG from "src/assets/transactions/fail_ic.svg";
import successSVG from "src/assets/transactions/success_ic.svg";
Expand Down
1 change: 1 addition & 0 deletions src/components/TxList/Table/Table.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ export default function(props) {
const onMouseLeave = useCallback(() => {
if (!state.isFront || state.maxIndex !== state.pageData?.[0]?.[BASE_PROPERTY]) return;
setRealTime(true);
// eslint-disable-next-line
}, [setRealTime, state.isFront]);

return (
Expand Down
1 change: 0 additions & 1 deletion src/components/TxList/TableRow/pickData.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import getTxType from "src/constants/getTxType";
// components
import Skeleton from "react-skeleton-loader";
import SvgDisplay from "src/components/common/SvgDisplay";

// assets
import greenArrowSVG from "src/assets/common/transferarrow_gr.svg";

Expand Down
1 change: 1 addition & 0 deletions src/components/common/NoTx/NoTx.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import styles from "./NoTx.scss";
import cn from "classnames/bind";

import listNone from "src/assets/misc/noitem_ic.svg";

const cx = cn.bind(styles);

export default function({text}) {
Expand Down
2 changes: 0 additions & 2 deletions src/components/common/NotFound/NotFound.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,8 @@ import styles from "./NotFound.scss";
import classNames from "classnames/bind";
import consts from "src/constants/consts";
import {_} from "src/lib/scripts";

// hooks
import {useFetch, useSelector} from "src/hooks";

// assets
import notFoundSVG from "src/assets/misc/404_img.svg";
import binanceHasTxSVG from "src/assets/misc/binanceHasTx.svg";
Expand Down
1 change: 0 additions & 1 deletion src/components/common/ScrollTop/ScrollTop.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import cn from "classnames/bind";
import styles from "./ScrollTop.scss";
// hooks
import {useScroll} from "src/hooks";

// assets
import scrollTopSVG from "src/assets/common/scroll_top.svg";

Expand Down
1 change: 1 addition & 0 deletions src/components/common/SearchArea/Dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import DisplayIcon from "src/components/common/DisplayIcon";

import symbolNoneSVG from "src/assets/transactions/symbol_none.svg";
import failSVG from "src/assets/transactions/fail_ic.svg";

const cx = cn.bind(styles);

export default function({
Expand Down
4 changes: 1 addition & 3 deletions src/components/common/SearchArea/SearchArea.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import React from "react";
import cn from "classnames/bind";
import styles from "./SearchArea.scss";

// redux
import {useSelector} from "react-redux";

// hooks
import {useSearch, useDelayedInput, useHistory, useCheckOutsideClick} from "src/hooks";
import {useCheckOutsideClick, useDelayedInput, useHistory, useSearch} from "src/hooks";
//components
import {InputBase} from "@material-ui/core";
import Dropdown from "./Dropdown";
Expand Down
1 change: 0 additions & 1 deletion src/components/common/SortButton/SortButton.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import cn from "classnames/bind";
import styles from "./SortButton.scss";

// assets
import arrowBlackSVG from "src/assets/assets/arrow_bk.svg";
import arrowGreySVG from "src/assets/assets/arrow_gr.svg";
Expand Down
1 change: 0 additions & 1 deletion src/components/common/SvgDisplay/SvgDisplay.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from "react";
import styles from "./SvgDisplay.scss";
import cn from "classnames/bind";

// assets
import defaultSVG from "src/assets/common/arrow_ic.svg";

Expand Down
1 change: 0 additions & 1 deletion src/components/common/WindowedList/WindowedList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from "react";
import {FixedSizeList as List} from "react-window";
import AutoSizer from "react-virtualized-auto-sizer";

export default function({data = [{}, {}], Comp, itemCnt}) {
const Row = ({index}) => (
Expand Down
1 change: 1 addition & 0 deletions src/constants/getTxTypeIcon.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import txTypes from "src/constants/txTypes";
import {_} from "src/lib/scripts";

import binanceSVG from "src/assets/common/binance_token.svg";

const SVG = Object.freeze(_.times(7, v => require(`src/assets/transactions/msgsic_${v + 1}.svg`)));

const {COSMOS, DEX, TOKENS, MISC} = txTypes;
Expand Down
4 changes: 2 additions & 2 deletions src/containers/Asset/Asset.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import React from "react";
import cn from "classnames/bind";
import style from "./Asset.scss";
import {useFetch, useHistory, usePrevious} from "src/hooks";
import {empty, nilCheck} from "src/lib/scripts";
import {useFetch, usePrevious} from "src/hooks";
import {nilCheck} from "src/lib/scripts";

import consts from "src/constants/consts";
// components
Expand Down
3 changes: 1 addition & 2 deletions src/containers/AssetList/AssetList.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,13 @@ import {_, empty} from "src/lib/scripts";
import {useDispatch, useSelector} from "react-redux";
import {getCryptoAssets} from "src/store/modules/assets";
// hooks
import {useIncrementalListLoader} from "src/hooks";
import {useFetch, useIncrementalListLoader} from "src/hooks";
// components
import TitleWrapper from "src/components/common/TitleWrapper";
import PageTitle from "src/components/common/PageTitle";
import StatusCard from "src/components/AssetList/StatusCard/StatusCard";
import Table from "src/components/AssetList/Table";
import ScrollTop from "src/components/common/ScrollTop";
import {useFetch} from "src/hooks";
import consts from "src/constants/consts";

const cx = cn.bind(styles);
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import useGetPrices from "./useGetPrices";
import useMultiFetch from "./useMultiFetch";
import useIncrementalListLoader from "./useIncrementalListLoader";
import useCheckOutsideClick from "./useCheckOutsideClick";
import {useSelector, useDispatch} from "react-redux";
import {useDispatch, useSelector} from "react-redux";

export {
useFetch,
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/useIncrementalListLoader.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import {useEffect, useState} from "react";
import {_, empty} from "src/lib/scripts";
import {empty} from "src/lib/scripts";

const LIST_LOAD_DELAY_MS = 100;
const LIST_LOAD_ITEM_SIZE = 10;
Expand Down

0 comments on commit 099b73d

Please sign in to comment.