Skip to content

Commit

Permalink
connect improvements (#40)
Browse files Browse the repository at this point in the history
  • Loading branch information
alongoni authored Sep 1, 2023
1 parent 0d807d0 commit c65ea09
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions src/pages/connect.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Button, CardMedia, Typography } from "@mui/material";
import Image from "next/image";
import AccountBalanceWalletIcon from "@mui/icons-material/AccountBalanceWallet";
import { Button, Typography } from "@mui/material";
import { useTheme } from "@mui/material/styles";
import { ReactNode, useState } from "react";

import { RouterRedirectGuard } from "@/components/guards/RouterRedirectGuard";
import { BasicLayout } from "@/components/layout/BasicLayout";
import { MainContentCard } from "@/components/layout/shared/MainContentCard";
import { CRYPTO_WALLET } from "@/config/images";
import { ROUTES } from "@/config/routes";
import { WalletConnectionEvents } from "@/domain/events/WalletConnectionEvents";
import { useRedirectComparison } from "@/hooks/useRedirectComparison";
Expand All @@ -19,6 +19,7 @@ export function getTextInstructions(route: string) {
}
export function ConnectWalletPage() {
const [instructions, setInstructions] = useState<string | undefined>();
const theme = useTheme();

useRedirectComparison({
redirectUrls: [ROUTES.New, ROUTES.Load],
Expand All @@ -34,26 +35,21 @@ export function ConnectWalletPage() {
return (
<RouterRedirectGuard>
<MainContentCard
stylesContainer={{ alignItems: "center" }}
stylesContainer={{
alignItems: "center",
sx: { backgroundColor: theme.palette.background.paper },
}}
title="Connect your Wallet"
paragraph="To continue with the following actions you need to connect your wallet"
paragraph="To continue with the following actions you need to connect your wallet."
>
<CardMedia>
<Image
priority
src={CRYPTO_WALLET}
alt={"Icon wallet"}
width={256}
height={256}
/>
</CardMedia>
{instructions && (
<Typography variant="body1">
{instructions}, you will need a wallet to sign the transaction
{instructions}, you will need a wallet to sign the transaction.
</Typography>
)}
<Button size="large" onClick={disptachConnect}>
<Typography variant="h3">Connect your wallet</Typography>
<Button variant="contained" onClick={disptachConnect}>
<AccountBalanceWalletIcon />
Connect your wallet
</Button>
</MainContentCard>
</RouterRedirectGuard>
Expand Down

0 comments on commit c65ea09

Please sign in to comment.