Skip to content

Commit

Permalink
Revert "Update wallet routing (#639)" (#640)
Browse files Browse the repository at this point in the history
  • Loading branch information
escobarjonatan authored May 23, 2024
1 parent e521276 commit 8fa7f9c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 26 deletions.
9 changes: 0 additions & 9 deletions apps/mobile-wallet-connector/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,6 @@ const nextConfig = {
// For other options, see https://styled-components.com/docs/tooling#babel-plugin
styledComponents: true,
},
// Adding the rewrites to the config
async rewrites() {
return [
{
source: "/",
destination: "/wallet-connect",
},
];
},
};

const plugins = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { NEWMLogo } from "@newm-web/assets";
import theme from "@newm-web/theme";
import { StyledComponentsRegistry } from "@newm-web/components";
import "./global.css";
import store from "../../store";
import { ConnectWallet, Toast } from "../../components";
import store from "../store";
import { ConnectWallet, Toast } from "../components";

interface RootLayoutProps {
readonly children: ReactNode;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { useRouter } from "next/navigation";
import { Typography } from "@mui/material";
import { Button } from "@newm-web/elements";
import { useConnectWallet } from "@newm.io/cardano-dapp-wallet-connector";
import { useAppDispatch } from "../../common";
import { setIsConnectWalletModalOpen } from "../../modules/ui";
import { useAppDispatch } from "../common";
import { setIsConnectWalletModalOpen } from "../modules/ui";

const Page: FunctionComponent = () => {
const dispatch = useAppDispatch();
Expand All @@ -14,7 +14,7 @@ const Page: FunctionComponent = () => {

useEffect(() => {
if (isConnected) {
router.push("wallet-connect/web-connected");
router.push("/web-connected");
}
}, [isConnected, router]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import ContentCopyIcon from "@mui/icons-material/ContentCopy";
import theme from "@newm-web/theme";
import { NEWMLogo } from "@newm-web/assets";
import { TimeRemaining, getTimeRemaining } from "@newm-web/utils";
import { useAppDispatch, useAppSelector } from "../../../common";
import { selectWallet, setConnectionData } from "../../../modules/wallet";
import { useAppDispatch, useAppSelector } from "../../common";
import { selectWallet, setConnectionData } from "../../modules/wallet";

const Page: FunctionComponent = () => {
const dispatch = useAppDispatch();
Expand All @@ -36,13 +36,13 @@ const Page: FunctionComponent = () => {

useEffect(() => {
if (!isConnected) {
router.replace("/wallet-connect");
router.replace("/");
}
}, [isConnected, router]);

useEffect(() => {
if (!connectionId) {
router.replace("web-connected");
router.replace("/web-connected");
}
}, [connectionId, router]);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,9 @@ import { useRouter } from "next/navigation";
import { Form, Formik, FormikValues } from "formik";
import { useConnectWallet } from "@newm.io/cardano-dapp-wallet-connector";
import { Button, SwitchInputField } from "@newm-web/elements";
import { setToastMessage } from "../../../modules/ui";
import {
selectWallet,
useConnectFromMobileThunk,
} from "../../../modules/wallet";
import { useAppDispatch, useAppSelector } from "../../../common";
import { setToastMessage } from "../../modules/ui";
import { selectWallet, useConnectFromMobileThunk } from "../../modules/wallet";
import { useAppDispatch, useAppSelector } from "../../common";

const Page: FunctionComponent = () => {
const router = useRouter();
Expand Down Expand Up @@ -48,13 +45,13 @@ const Page: FunctionComponent = () => {
if (isConnected) {
setIsFormSubmitDisabled(false);
} else {
router.replace("/wallet-connect");
router.replace("/");
}
}, [isConnected, router]);

useEffect(() => {
if (connectionData.connectionId) {
router.push("scan-code");
router.push("/scan-code");
}
}, [connectionData, router]);

Expand Down

0 comments on commit 8fa7f9c

Please sign in to comment.