Skip to content

Commit

Permalink
add existing user modal
Browse files Browse the repository at this point in the history
  • Loading branch information
nikos-koukis committed Oct 14, 2023
1 parent d61bdc3 commit 40e2eb0
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 0 deletions.
44 changes: 44 additions & 0 deletions src/views/Home/components/ExistingUser/ExistingUserModal.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/* eslint-disable jsx-a11y/alt-text */
import React, { useState } from 'react';
import {
Box,
Flex,
Text,
ModalBody,
ModalCloseButton,
Center,
Grid,
VStack,
} from '@chakra-ui/react';
import MyModal from "@/components/Modal/Modal";
import ExistingUser from "../ExistingUser/ExistingUser";

export default function ExistingUserModal({ onClick, email, address, secretWords, sub } :
{ onClick: () => void, email: string, address: string, secretWords: string[], sub: string}) {

return (
<MyModal
isOpen={true}
onClose={onClick}
size={"6xl"}
overlayProps={{
backdropFilter: "blur(6px)",
background: "transparent",
}}
background={"white"}
borderRadius={"20px"}
py={25}
isCentered={true}
justifyItems="center"
alignItems="center"
>
<ModalCloseButton />
<ModalBody>
<Text>
<ExistingUser email={email} address={address || ""} secretWords={secretWords || []} userGid={sub}/>
</Text>
</ModalBody>
</MyModal>
);
}

12 changes: 12 additions & 0 deletions src/views/Home/components/LandingPage/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import Particles from "react-particles";
import type { Container, Engine } from "tsparticles-engine";
import { IconButton } from '@chakra-ui/react'
import CreateWalletModal from '../NewUserForm/CreateWalletModal';
import ExistingUserModal from '../ExistingUser/ExistingUserModal';
import { useGetUserInfo } from "@/views/Home/hooks/hooks";

interface FeatureCardProps {
Expand All @@ -19,6 +20,7 @@ export default function LandingPage() {

const { data: session } = useSession();
const [showCreateWallet, setshowCreateWallet] = useState(false);
const [showExistingUser, setshowExistingUsert] = useState(false);
const [clickedSubmit, setClickedSubmit] = useState(false);

let platform = "google";
Expand Down Expand Up @@ -262,6 +264,7 @@ export default function LandingPage() {
ml={3} // Add margin to the right of the button
colorScheme="teal"
variant="outline"
onClick={() => setshowExistingUsert(true)}
>
Access Existing
</Button>
Expand Down Expand Up @@ -337,6 +340,15 @@ export default function LandingPage() {
setClickedSubmit={setClickedSubmit}
/>
)}
{showExistingUser && (
<ExistingUserModal
onClick={() => setshowExistingUsert(false)}
email={email}
address={userInfo?.address || ""}
secretWords={userInfo?.secretWords || []}
sub={session?.user?.sub || ""}
/>
)}
</Box>
);
}

0 comments on commit 40e2eb0

Please sign in to comment.