Skip to content

Commit

Permalink
feat: staking and claim pages
Browse files Browse the repository at this point in the history
Co-authored-by: Tulun <[email protected]>
Co-authored-by: Dong-Ha Kim <[email protected]>
  • Loading branch information
3 people committed Sep 12, 2022
1 parent 13041e3 commit 5815a0e
Show file tree
Hide file tree
Showing 76 changed files with 3,694 additions and 50 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@across-protocol/across-token": "^0.0.1",
"@across-protocol/contracts-v2": "^0.0.34",
"@across-protocol/sdk-v2": "^0.1.24",
"@datapunt/matomo-tracker-js": "^0.5.1",
Expand Down
25 changes: 24 additions & 1 deletion src/Routes.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
import { useState, useEffect } from "react";
import { Switch, Route, useLocation, useHistory } from "react-router-dom";

import {
Send,
Pool,
About,
MyTransactions,
AllTransactions,
Rewards,
Staking,
Claim,
NotFound,
} from "views";
Expand All @@ -20,6 +22,8 @@ import {
WrongNetworkError,
rewardsBannerWarning,
generalMaintenanceMessage,
stringValueInArray,
getConfig,
} from "utils";
import { ReactComponent as InfoLogo } from "assets/icons/info-24.svg";
import Toast from "components/Toast";
Expand All @@ -36,6 +40,7 @@ function useRoutes() {
const location = useLocation();
const history = useHistory();
const { error, removeError } = useError();
const config = getConfig();
// force the user on /pool page if showMigrationPage is active.
useEffect(() => {
if (enableMigration && location.pathname !== "/pool") {
Expand All @@ -51,6 +56,7 @@ function useRoutes() {
removeError,
location,
isContractAddress,
config,
};
}
// Need this component for useLocation hook
Expand All @@ -61,6 +67,7 @@ const Routes: React.FC = () => {
error,
removeError,
location,
config,
isContractAddress,
} = useRoutes();

Expand Down Expand Up @@ -105,7 +112,23 @@ const Routes: React.FC = () => {
<Route exact path="/pool" component={Pool} />
<Route exact path="/about" component={About} />
<Route exact path="/rewards" component={Rewards} />
<Route exact path="/rewards/claim" component={Claim} />
<Route exact path="/airdrop" component={Claim} />
<Route
exact
path="/rewards/staking/:poolId"
render={({ match }) => {
const poolIdFound = stringValueInArray(
match.params.poolId.toLowerCase(),
config.getPoolSymbols()
);

if (poolIdFound) {
return <Staking />;
} else {
return <NotFound custom404Message="Pool not found." />;
}
}}
/>
<Route exact path="/" component={Send} />
<Route path="*" component={NotFound} />
</Switch>
Expand Down
4 changes: 4 additions & 0 deletions src/assets/acx.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions src/assets/airdrop-gift-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/assets/airdrop-waves-bg.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/airdrop-x.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/check-star-ring-filled.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions src/assets/check-star-ring.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 5815a0e

Please sign in to comment.