Skip to content

Commit

Permalink
style: metadata and removed buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Agilulfo1820 committed Dec 13, 2024
1 parent 189adb9 commit 31d3f09
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 54 deletions.
55 changes: 55 additions & 0 deletions apps/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,61 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/x-icon" href="/src/assets/logo.png" />
<title>VeChain Smart Account Factory</title>
<meta
name="description"
content="Create and manage your smart accounts on VeChain"
/>

<!-- Icons and Theme Meta Tags -->
<link
rel="icon"
type="image/png"
href="%VITE_BASE_URL%/images/favicon.png"
/>
<link
rel="apple-touch-icon"
sizes="57x57"
href="%VITE_BASE_URL%/images/favicon.png"
/>
<meta
name="msapplication-TileImage"
content="%VITE_BASE_URL%/images/favicon.png"
/>

<!-- Facebook Meta Tags -->
<meta name="title" property="og:title" content="VeChain Smart Account Factory" />
<meta name="type" property="og:type" content="website" />
<meta name="url" property="og:url" content="%VITE_BASE_URL%" />
<meta
name="description"
property="og:description"
content="Create and manage your smart accounts on VeChain"
/>
<meta property="og:site_name" content="VeChain Smart Account Factory" />
<meta
name="image"
property="og:image"
content="%VITE_BASE_URL%/images/favicon.png"
/>
<meta property="og:image:type" content="image/png" />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta property="og:image:alt" content="VeChain Smart Account Factory" />

<!-- Twitter Meta Tags -->
<meta name="twitter:card" content="summary_large_image" />
<meta property="twitter:url" content="%VITE_BASE_URL%" />
<meta name="twitter:title" content="VeChain Smart Account Factory" />
<meta
name="twitter:description"
content="Create and manage your smart accounts on VeChain"
/>
<meta
name="twitter:image"
content="%VITE_BASE_URL%/images/favicon.png"
/>
<meta name="twitter:image:alt" content="VeChain Smart Account Factory" />

</head>
<body>
<div id="root"></div>
Expand Down
Binary file added apps/frontend/public/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,15 @@ export const AbstractedAccounts = () => {
</CardHeader>

<CardBody>
{!testnetAccountAddress && !mainnetAccountAddress ? (
{!account ? (
<VStack spacing={4}>
<Heading size={"md"}>No accounts found, create one</Heading>
<Heading size={"md"}>
Connect your wallet to see your smart accounts
</Heading>
</VStack>
) : !testnetAccountAddress && !mainnetAccountAddress ? (
<VStack spacing={4}>
<Heading size={"md"}>No smart account found</Heading>
</VStack>
) : (
<VStack spacing={4}>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,15 @@
import {
Button,
Card,
CardBody,
CardFooter,
CardHeader,
HStack,
Heading,
Text,
VStack,
useToast,
} from "@chakra-ui/react";
import { AddressButtonGhostVariant } from "../../../../components";
import {
useAccountCreatedEvents,
useCreateAccount,
useGetAccountAddress,
} from "../../../../hooks";
import { useAccountCreatedEvents } from "../../../../hooks";
import { EnvConfig } from "@repo/config/contracts";
import { useWallet } from "@vechain/dapp-kit-react";
import { useCallback } from "react";
import { getConfig } from "@repo/config";
import { useContractVersion } from "../../../../hooks/useContractVersion";

type ContractAddressAndBalanceCardProps = {
Expand All @@ -33,35 +23,11 @@ export const ContractInfo = ({
address,
env,
}: ContractAddressAndBalanceCardProps) => {
const { account } = useWallet();
const toast = useToast();

const config = getConfig(import.meta.env.VITE_APP_ENV);
const isCorrectNetwork = config.network.name === env;

const { data: contractVersion } = useContractVersion(address, env);

const { data: accountsCreatedEvents, isLoading: isLoadingCreatedAccoounts } =
useAccountCreatedEvents(env);

const { data: accountAddress } = useGetAccountAddress(account ?? "", env);

const createAccountMutation = useCreateAccount({
onSuccess: () => {
toast({
title: "Success",
description: "Account created",
status: "success",
duration: 9000,
isClosable: true,
});
},
});

const onCreateAccount = useCallback(() => {
createAccountMutation.sendTransaction({ owner: account ?? "", env });
}, [createAccountMutation, account, env]);

return (
<Card w="full" borderRadius={"2xl"} p={2}>
<CardHeader>
Expand Down Expand Up @@ -96,19 +62,6 @@ export const ContractInfo = ({
</HStack>
</VStack>
</CardBody>
<CardFooter>
{!accountAddress && (
<Button
w="full"
colorScheme="blue"
variant="outline"
onClick={onCreateAccount}
isDisabled={!account || !!accountAddress || !isCorrectNetwork}
>
{!isCorrectNetwork ? `Switch to ${env} network` : "Create Account"}
</Button>
)}
</CardFooter>
</Card>
);
};
5 changes: 1 addition & 4 deletions turbo.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@
},
"build:prod": {
"cache": false,
"dependsOn": [
"^compile",
"@repo/contracts#check-contracts-deployment:mainnet"
],
"dependsOn": ["^compile"],
"outputs": [".next/**", "!.next/cache/**"]
},
"lint": {
Expand Down

0 comments on commit 31d3f09

Please sign in to comment.