Skip to content

Commit

Permalink
Fix/login (#64)
Browse files Browse the repository at this point in the history
* Fix login redirect
* Upgrade dependencies
* Change circleci image
  • Loading branch information
sarah-thong authored Jun 21, 2022
1 parent e620bec commit fa982e8
Show file tree
Hide file tree
Showing 6 changed files with 379 additions and 299 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ jobs:
deploy:
docker:
# image with node, npm and yarn installed
- image: circleci/node:14.18.2-buster
- image: cimg/node:14.19.0-browsers
resource_class: large
steps:

Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@cosmjs/encoding": "^0.26.5",
"@cosmjs/stargate": "^0.26.5",
"@cosmjs/tendermint-rpc": "^0.26.5",
"@cosmjs/encoding": "^0.28.7",
"@cosmjs/stargate": "^0.28.7",
"@cosmjs/tendermint-rpc": "^0.28.7",
"@loadable/component": "^5.15.2",
"@material-ui/core": "^4.11.3",
"@material-ui/lab": "^4.0.0-alpha.57",
Expand All @@ -22,7 +22,7 @@
"@types/react-router-dom": "^5.1.7",
"@types/redux-logger": "^3.0.8",
"bignumber.js": "^9.0.1",
"carbon-js-sdk": "^0.1.91",
"carbon-js-sdk": "^0.1.98",
"chart.js": "^3.2.0",
"eslint": "^7.23.0",
"gsap": "^3.6.1",
Expand Down Expand Up @@ -75,8 +75,8 @@
},
"devDependencies": {
"@types/loadable__component": "^5.13.4",
"@typescript-eslint/eslint-plugin": "^4.19.0",
"@typescript-eslint/parser": "^4.19.0",
"@typescript-eslint/eslint-plugin": "^5.6.0",
"@typescript-eslint/parser": "^5.6.0",
"eslint-plugin-react": "^7.22.0"
}
}
18 changes: 10 additions & 8 deletions src/@demex-info/constants/links.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
import { Discord, Facebook, GitHub, LinkedIn, Medium, Reddit, Telegram, Twitter, Youtube } from "@demex-info/assets/logos";
import { CarbonSDK } from "carbon-js-sdk";

export enum LoginPage {
Ledger = "ledger", // eslint-disable-line no-unused-vars
Keplr = "keplr", // eslint-disable-line no-unused-vars
Metamask = "metamask", // eslint-disable-line no-unused-vars
EncryptedKey = "encryptedKey", // eslint-disable-line no-unused-vars
Register = "register", // eslint-disable-line no-unused-vars
Reset = "reset", // eslint-disable-line no-unused-vars
Main = "main", // eslint-disable-line no-unused-vars
}

export const Paths = {
Home: "/",

Login: {
Main: "/login",
Ledger: "/login/ledger",
MetaMask: "/login/metamask",
EncryptedKey: "/login/encrypted_key",
Keplr: "/login/keplr",
},

PasswordReset: "/reset_password",
Register: "/register",

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CloseIcon, MenuIcon } from "@demex-info/assets/icons";
import { DemexLogo } from "@demex-info/assets/logos";
import { getDemexLink, Paths } from "@demex-info/constants";
import { getDemexLink, LoginPage, Paths } from "@demex-info/constants";
import { RootState } from "@demex-info/store/types";
import { lazy } from "@loadable/component";
import { Box, Button, Hidden, IconButton, makeStyles, Theme, useMediaQuery } from "@material-ui/core";
Expand Down Expand Up @@ -57,7 +57,7 @@ const Header: React.FC = () => {
<Button
className={classes.loginBtn}
color="secondary"
onClick={() => goToLink(getDemexLink(Paths.Login.Main, network))}
onClick={() => goToLink(getDemexLink(`${Paths.Trade}?loginType=${LoginPage.Main}`, network))}
>
{widthXs ? "Connect" : "Connect Wallet"}
</Button>
Expand Down
10 changes: 5 additions & 5 deletions src/@demex-info/views/ReadyToTrade/ReadyToTrade.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { CaretRight, HomeBorder2 as HomeBorderLeft, HomeBorder3 as HomeBorderRight } from "@demex-info/assets/icons";
import { EncryptedKey, Keplr, Ledger, MetaMask } from "@demex-info/assets/logos";
import { TypographyLabel, withLightTheme } from "@demex-info/components";
import { getDemexLink, Paths } from "@demex-info/constants";
import { getDemexLink, LoginPage, Paths } from "@demex-info/constants";
import { RootState } from "@demex-info/store/types";
import { Box, Button, makeStyles, Theme, Typography } from "@material-ui/core";
import clsx from "clsx";
Expand Down Expand Up @@ -44,7 +44,7 @@ const ReadyToTrade: React.FC = () => {
label: classes.buttonLbl,
}}
color="secondary"
onClick={() => goToLink(getDemexLink(Paths.Login.Ledger, network))}
onClick={() => goToLink(getDemexLink(`${Paths.Trade}?loginType=${LoginPage.Ledger}`, network))}
>
<Ledger className={classes.ledgerIcon} />
Ledger
Expand All @@ -55,7 +55,7 @@ const ReadyToTrade: React.FC = () => {
label: classes.buttonLbl,
}}
color="secondary"
onClick={() => goToLink(getDemexLink(Paths.Login.Keplr, network))}
onClick={() => goToLink(getDemexLink(`${Paths.Trade}?loginType=${LoginPage.Keplr}`, network))}
>
<Keplr className={classes.keyIcon} />
Keplr
Expand All @@ -66,7 +66,7 @@ const ReadyToTrade: React.FC = () => {
label: classes.buttonLbl,
}}
color="secondary"
onClick={() => goToLink(getDemexLink(Paths.Login.MetaMask, network))}
onClick={() => goToLink(getDemexLink(`${Paths.Trade}?loginType=${LoginPage.Metamask}`, network))}
>
<MetaMask className={classes.metamaskIcon} />
Metamask
Expand All @@ -77,7 +77,7 @@ const ReadyToTrade: React.FC = () => {
label: classes.buttonLbl,
}}
color="secondary"
onClick={() => goToLink(getDemexLink(Paths.Login.EncryptedKey, network))}
onClick={() => goToLink(getDemexLink(`${Paths.Trade}?loginType=${LoginPage.EncryptedKey}`, network))}
>
<EncryptedKey className={classes.keyIcon} />
Encrypted Key
Expand Down
Loading

0 comments on commit fa982e8

Please sign in to comment.