Skin onboarding app #33
@ -1,13 +1,13 @@
|
||||
import React, { useEffect } from "react";
|
||||
import {useLocation, useNavigate, useSearchParams } from "react-router-dom";
|
||||
import { useLocation, useNavigate, useSearchParams } from "react-router-dom";
|
||||
|
||||
import { Button, Box, Container, Typography, colors } from "@mui/material";
|
||||
import { Button, Box, Container } from "@mui/material";
|
||||
|
||||
import { useWalletConnectContext } from "../context/WalletConnectContext";
|
||||
import { WALLET_DISCLAIMER_MSG } from "../constants";
|
||||
|
||||
const ConnectWallet = () => {
|
||||
const { connect, session, signClient, checkPersistedState } = useWalletConnectContext();
|
||||
const { connect, session, signClient, checkPersistedState } =
|
||||
useWalletConnectContext();
|
||||
|
||||
const navigate = useNavigate();
|
||||
const location = useLocation();
|
||||
@ -28,13 +28,11 @@ const ConnectWallet = () => {
|
||||
|
||||
if (redirectTo) {
|
||||
navigate(`/${redirectTo}`, {
|
||||
state: location.state
|
||||
state: location.state,
|
||||
});
|
||||
}
|
||||
|
||||
else {
|
||||
} else {
|
||||
navigate("/sign-with-nitro-key", {
|
||||
state: location.state
|
||||
state: location.state,
|
||||
});
|
||||
}
|
||||
}, [session, navigate, redirectTo, location.state]);
|
||||
@ -44,37 +42,16 @@ const ConnectWallet = () => {
|
||||
};
|
||||
|
||||
return (
|
||||
<Container maxWidth="lg">
|
||||
<Box
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
alignItems="center"
|
||||
justifyContent="center"
|
||||
marginTop={10}
|
||||
sx={{
|
||||
border: 1,
|
||||
borderColor: 'grey.500',
|
||||
}}
|
||||
padding={5}
|
||||
>
|
||||
<Typography variant="h5" component="h1" gutterBottom color={colors.red[400]}>
|
||||
Disclaimer
|
||||
</Typography>
|
||||
<Typography variant="body1">
|
||||
{WALLET_DISCLAIMER_MSG}
|
||||
</Typography>
|
||||
</Box>
|
||||
<Container maxWidth="lg" sx={{ height: "75%" }}>
|
||||
<Box
|
||||
display="flex"
|
||||
flexDirection="column"
|
||||
alignItems="center"
|
||||
padding={5}
|
||||
justifyContent="center"
|
||||
height="100%"
|
||||
>
|
||||
<Button
|
||||
variant="contained"
|
||||
onClick={handler}
|
||||
>
|
||||
<Button variant="contained" onClick={handler}>
|
||||
Connect Wallet
|
||||
</Button>
|
||||
</Box>
|
||||
|
Loading…
Reference in New Issue
Block a user