Skip to content

Commit

Permalink
info toasts
Browse files Browse the repository at this point in the history
  • Loading branch information
nikos-koukis committed Oct 14, 2023
1 parent 40e2eb0 commit ae330d6
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions src/views/Home/components/LandingPage/LandingPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { IconButton } from '@chakra-ui/react'
import CreateWalletModal from '../NewUserForm/CreateWalletModal';
import ExistingUserModal from '../ExistingUser/ExistingUserModal';
import { useGetUserInfo } from "@/views/Home/hooks/hooks";
import { useToast } from '@chakra-ui/react'

interface FeatureCardProps {
icon: React.ComponentType; // Specify the type for the 'icon' prop
Expand All @@ -18,6 +19,7 @@ interface FeatureCardProps {

export default function LandingPage() {

const toast = useToast()
const { data: session } = useSession();
const [showCreateWallet, setshowCreateWallet] = useState(false);
const [showExistingUser, setshowExistingUsert] = useState(false);
Expand All @@ -42,7 +44,6 @@ export default function LandingPage() {
userExists = true;
}


function handleSetshowCreateWallet() {
loggedInUser ? (
setshowCreateWallet(true)
Expand All @@ -51,6 +52,20 @@ export default function LandingPage() {
);
}

function handleSetshowExistingUser() {
userExists ? (
setshowExistingUsert(true)
) : (
toast({
title: 'You haven\'t create account yet.',
description: "Try creating an account and you will be able to access your account information.",
status: 'info',
duration: 5000,
isClosable: true,
})
);
}

const particlesInit = useCallback(async (engine: Engine) => {
await loadSlim(engine);
}, []);
Expand Down Expand Up @@ -264,7 +279,7 @@ export default function LandingPage() {
ml={3} // Add margin to the right of the button
colorScheme="teal"
variant="outline"
onClick={() => setshowExistingUsert(true)}
onClick={() => handleSetshowExistingUser()}
>
Access Existing
</Button>
Expand Down

0 comments on commit ae330d6

Please sign in to comment.