Skip to content

Commit

Permalink
Merge pull request #158 from OctoFi/v4.3
Browse files Browse the repository at this point in the history
v4.3 Updates
  • Loading branch information
nathanjessen authored Jul 14, 2021
2 parents de558b4 + 9f7d7af commit df6aec6
Show file tree
Hide file tree
Showing 294 changed files with 13,324 additions and 13,682 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
/.pnp
.pnp.js
.eslintcache
/.vscode

# testing
/coverage
Expand All @@ -18,9 +19,11 @@
.env.development.local
.env.test.local
.env.production.local
.env*

npm-debug.log*
yarn-debug.log*
yarn-error.log*

.idea/
.idea/
.vscode/
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "octofi-app-aquafarm",
"version": "4.2.1",
"version": "4.3.0",
"private": true,
"homepage": "https://app.octo.fi",
"dependencies": {
Expand Down Expand Up @@ -40,19 +40,25 @@
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@transak/transak-sdk": "^1.0.28",
"@types/aos": "^3.0.4",
"@types/dompurify": "^2.2.2",
"@types/jest": "^25.2.1",
"@types/lodash.flatmap": "^4.5.6",
"@types/luxon": "^1.24.4",
"@types/multicodec": "^1.0.0",
"@types/node": "^13.13.5",
"@types/qs": "^6.9.2",
"@types/react": "^16.9.34",
"@types/react-bootstrap-table-next": "^4.0.14",
"@types/react-csv": "^1.1.2",
"@types/react-dom": "^16.9.7",
"@types/react-redux": "^7.1.8",
"@types/react-router-dom": "^5.0.0",
"@types/react-slick": "^0.23.5",
"@types/react-virtualized-auto-sizer": "^1.0.0",
"@types/react-window": "^1.8.2",
"@types/rebass": "^4.0.5",
"@types/remarkable": "^2.0.2",
"@types/styled-components": "^5.1.0",
"@types/testing-library__cypress": "^5.0.5",
"@types/wcag-contrast": "^3.0.0",
Expand Down Expand Up @@ -242,5 +248,9 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"jest": {
"resetMocks": false,
"resetModules": false
}
}
24 changes: 16 additions & 8 deletions public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"menu": {
"Account": "Account",
"menu": "Menu",
"buy": "Buy / Swap",
"buy": "Buy",
"crypto": "Crypto with fiat",
"giftCards": "Gift Cards & more",
"swap": "Swaptopus",
Expand All @@ -36,17 +36,21 @@
"spot": "Spot Trading",
"marketMaker": "Market Making",
"margin": "Margin Trading",
"exchange": "Exchange",
"invest": "Invest",
"pools": "Liquidity Pools",
"tokenSets": "Tokensets",
"pools": "Pools",
"tokenSets": "TokenSets",
"tokens": "Top Tokens",
"loans": "Loans",
"nft": "NFT",
"nft": "NFT Marketplace",
"tools": "Tools",
"more": "More",
"governance": "Governance",
"rankings": "Rankings",
"explore": "Explore",
"dashboard": "Dashboard",
"wallet": "Wallet",
"profile": "Profile",
"history": "History",
"disconnect": "Disconnect from OctoFi",
"connect": "Connect",
Expand All @@ -60,7 +64,7 @@
"connect": "Connect to wallet",
"notConnected": "Wallet Not Connected",
"connected": "Wallet Connected",
"connectedTo": "You connected to",
"connectedTo": "You are connected to",
"viewOrChange": "View or change account",
"title": "Wallet"
},
Expand Down Expand Up @@ -123,6 +127,7 @@
"buyButton": "Buy Crypto Asset"
},
"exchange": {
"title": "Exchange",
"selectCrypto": "Select your Crypto",
"selectFiat": "Select your Currency",
"selectPair": "Select a pair",
Expand All @@ -147,8 +152,8 @@
"pending": "Pending...",
"failed": "Transaction failed",
"orderSubmitted": "Your order submitted successfully!",
"fromLabel": "You Pay",
"toLabel": "You Receive",
"fromLabel": "Pay",
"toLabel": "Receive",
"exchangeSearch": "Our tentacles are searching in {{ loaded }} of {{ all }} exchanges",
"orderId": "Order ID",
"address": "ADDRESS",
Expand Down Expand Up @@ -216,6 +221,7 @@
"tokensets": {
"portfolios": "Portfolios",
"rebalancingSets": "Rebalancing Sets",
"otherSets": "Other",
"oneDay": "1 Day",
"week": "1 Week",
"month": "1 Month",
Expand Down Expand Up @@ -266,10 +272,12 @@
"more": "More",
"totalAssets": "Total Assets",
"totalDebts": "Total Debts",
"totalDeposits": "Total Deposits",
"netWorth": "Net Worth",
"platforms": "Platforms",
"accountOverview": "Account Overview",
"dashboard": " ",
"dashboard": "Dashboard",
"profile": "Profile",
"blockNumber": "Block Number",
"transactionHash": "Transaction Hash",
"download": "Download {{ file }}",
Expand Down
4 changes: 3 additions & 1 deletion src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import TransactionUpdater from "./state/transactions/updater";
import UserUpdater from "./state/user/updater";
import Routes from "./Routes";
import "./global.scss";
import "slick-carousel/slick/slick.css";
import "slick-carousel/slick/slick-theme.css";
import Web3ReactManager from "./components/Web3ReactManager";
import TransactionHandler from "./components/TransactionHandler";
import { useIsDarkMode } from "./state/user/hooks";
Expand Down Expand Up @@ -54,7 +56,7 @@ function App() {
/>
<TransactionHandler />
<SkeletonTheme
color={darkMode ? "#1e1f24" : "rgb(212, 218, 242)"}
color={darkMode ? "#1e1f24" : "#d4daf2"}
highlightColor={darkMode ? "#232429" : "#F3F5FD"}
>
<ThemedGlobalStyle />
Expand Down
42 changes: 37 additions & 5 deletions src/App.test.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,40 @@
import { render, screen } from "@testing-library/react";
import { render } from "./testing/customRender";
import App from "./App";

test("renders learn react link", () => {
render(<App />);
const linkElement = screen.getByText(/learn react/i);
expect(linkElement).toBeInTheDocument();
jest.mock("./theme", () => ({
FixedGlobalStyle: () => "FixedGlobalStyle",
ThemedGlobalStyle: () => "ThemedGlobalStyle",
}));

jest.mock("./components/RouteChanger/routeChanger", () => () => <div>RouteChanger</div>);
jest.mock("./components/WalletModal", () => () => <div>WalletModal</div>);
jest.mock("./state/lists/updater", () => () => <div>ListsUpdater</div>);
jest.mock("./state/application/updater", () => () => <div>ApplicationUpdater</div>);
jest.mock("./state/multicall/updater", () => () => <div>MultiCallUpdater</div>);
jest.mock("./state/transactions/updater", () => () => <div>TransactionUpdater</div>);
jest.mock("./state/user/updater", () => () => <div>UserUpdater</div>);
jest.mock("./Routes", () => () => <div>Routes</div>);
jest.mock("./components/Web3ReactManager", () => ({ children }) => <div>Web3ReactManager {children}</div>);
jest.mock("./components/TransactionHandler", () => () => <div>TransactionHandler</div>);

let state = {
initialState: {
user: {
userDarkMode: false,
},
},
};

test("smoke test light mode", () => {
render(<App />, state);
});

test("smoke test dark mode", () => {
state.initialState.user.userDarkMode = true;
render(<App />, state);
});

test("requires user state", () => {
state.initialState.user = null;
expect(() => render(<App />, state)).toThrow();
});
83 changes: 36 additions & 47 deletions src/Routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,40 @@ import { Switch, Route, Redirect } from "react-router-dom";
import { useEffect, lazy, Suspense } from "react";
import { useDispatch, useSelector } from "react-redux";

import { useActiveWeb3React } from "./hooks";
// import { useActiveWeb3React } from "./hooks";
import SplashScreen from "./components/SplashScreen";
import { fetchCurrencies } from "./state/currency/actions";
import HomePage from "./pages/Home";
import { useDarkModeManager } from "./state/user/hooks";
import Page from "./components/Page";
import WrongNetwork from "./components/WrongNetwork";
// import Page from "./components/Page";
// import WrongNetwork from "./components/WrongNetwork";

import HomePage from "./pages/Home";
const Dashboard = lazy(() => import("./pages/Dashboard"));
const Platform = lazy(() => import("./pages/Platform"));
const Pools = lazy(() => import("./pages/Pools"));
const Swap = lazy(() => import("./pages/Swap"));
const InstantSwap = lazy(() => import("./pages/InstantSwap"));
const Exchange = lazy(() => import("./pages/Exchange"));
const Explore = lazy(() => import("./pages/Explore"));
const ExploreTypeList = lazy(() => import("./pages/ExploreTypeList"));
const CoinDetails = lazy(() => import("./pages/CoinDetails"));
const MarketsExplore = lazy(() => import("./pages/MarketsExplore"));
const CoinDetailsPage = lazy(() => import("./pages/CoinDetailsPage"));
const Governance = lazy(() => import("./pages/Governance"));
const CreateProposal = lazy(() => import("./pages/CreateProposal"));
const Proposals = lazy(() => import("./pages/Proposals"));
const Vote = lazy(() => import("./pages/Vote"));
const History = lazy(() => import("./pages/History"));
const Wallet = lazy(() => import("./pages/Wallet"));
const FiatOff = lazy(() => import("./pages/FiatOff"));
const FiatOn = lazy(() => import("./pages/FiatOn"));
const NFT = lazy(() => import("./pages/NFT"));
const Borrow = lazy(() => import("./pages/Borrow"));
const TokenSets = lazy(() => import("./pages/TokenSets"));
const Launchpad = lazy(() => import("./pages/Launchpad"));
const LaunchpadItem = lazy(() => import("./pages/LaunchpadItem"));
const NewLaunchpad = lazy(() => import("./pages/NewLaunchpad"));;
const NewLaunchpad = lazy(() => import("./pages/NewLaunchpad"));
const CrossRouteHandler = lazy(() => import("./CrossRouteHandler"));


const Routes = (props) => {
const [darkMode] = useDarkModeManager();
const { account, chainId } = useActiveWeb3React();
// const { account, chainId } = useActiveWeb3React();

const selectedCurrency = useSelector((state) => state.currency.selected);
const dispatch = useDispatch();
Expand All @@ -58,47 +56,38 @@ const Routes = (props) => {
<>
<Suspense fallback={<SplashScreen />}>
<Switch>
<Route path={"/"} component={HomePage} exact />
<Route path={'/cross'} component={CrossRouteHandler}/>
{chainId && chainId !== 1 ? (
{/* {chainId && chainId !== 1 ? (
<Route path={'/'}>
<Page>
<WrongNetwork/>
</Page>
</Route>
) : (
<Switch>
<Route path={"/platforms/:platform"} component={Platform} />
<Route path={"/fiat/off-cards"} component={FiatOff} />
<Route path={"/fiat/on"} component={FiatOn} />
<Route path={"/invest/pools"} component={Pools} />
<Route exact path={"/invest/nft"} component={NFT} />
<Route path={"/invest/loans"} component={Borrow} />
<Route path={"/invest/tokensets"} component={TokenSets} />
<Route path={"/invest/launchpad"} exact component={Launchpad}/>
<Route path={"/invest/launchpad/new"} exact component={NewLaunchpad}/>
<Route path={'/invest/launchpad/:address'} exact component={LaunchpadItem}/>
<Route path={"/swap/uni"} component={Swap} />
<Route path={"/swap/all"} component={InstantSwap} />
<Route path={"/tools/governance"} exact component={Governance} />
<Route path={"/tools/governance/:space/create"} exact component={CreateProposal} />
<Route path={"/tools/governance/:space"} exact component={Proposals} />
<Route path={"/tools/governance/:space/proposal/:id"} exact component={Vote} />
<Route path={"/tools/explore"} exact component={Explore} />
<Route path={"/tools/explore/:type"} exact component={ExploreTypeList} />
<Route path={"/tools/market/:id"} exact component={CoinDetails} />
<Route path={"/coins/:id"} exact component={CoinDetails} />
{account && (
<>
<Route path={"/account/history"} exact component={History} />
<Route path={"/account/wallet"} exact component={Wallet} />
<Route path={"/dashboard"} component={Dashboard} />
</>
)}

<Redirect to={"/?error=1"} />
</Switch>
)}
) : ()} */}
<Route path={"/"} exact component={HomePage} />
<Route path={"/dashboard"} component={Dashboard} />
<Route path={"/history"} exact component={History} />
<Route path={"/exchange"} component={Exchange} />
<Route path={"/uniswap"} component={Swap} />
<Route path={"/onramp"} component={FiatOn} />
<Route path={"/offramp"} component={FiatOff} />
<Route path={"/invest"} exact component={Explore} />
<Route path={"/invest/pools"} component={Pools} />
<Route path={"/invest/tokens"} component={MarketsExplore} />
<Route path={"/invest/tokensets"} component={TokenSets} />
<Route path={"/invest/loans"} component={Borrow} />
<Route path={"/platforms/:platform"} component={Platform} />
<Route path={"/nft"} exact component={NFT} />
<Route path={"/governance"} exact component={Governance} />
<Route path={"/governance/:space/create"} exact component={CreateProposal} />
<Route path={"/governance/:space"} exact component={Proposals} />
<Route path={"/governance/:space/proposal/:id"} exact component={Vote} />
<Route path={"/launchpad"} exact component={Launchpad} />
<Route path={"/launchpad/new"} exact component={NewLaunchpad} />
<Route path={"/launchpad/:address"} exact component={LaunchpadItem} />
<Route path={"/market/:id"} exact component={CoinDetailsPage} />
<Route path={"/coins/:id"} exact component={CoinDetailsPage} />
<Route path={"/cross"} component={CrossRouteHandler} />
<Redirect to={"/?error=1"} />
</Switch>
</Suspense>
</>
Expand Down
9 changes: 9 additions & 0 deletions src/assets/images/account/assets.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions src/assets/images/account/copy.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit df6aec6

Please sign in to comment.