From 2d8952f67a51a28067961c385f09f3e223cc4484 Mon Sep 17 00:00:00 2001 From: Gracing47 Date: Fri, 27 Dec 2024 17:59:49 +0100 Subject: [PATCH] feat: enhance landing page UI/UX --- packages/react-app/app/page.tsx | 114 +++++++++++++++++++++++++++++--- 1 file changed, 105 insertions(+), 9 deletions(-) diff --git a/packages/react-app/app/page.tsx b/packages/react-app/app/page.tsx index 853e527a..2f50f132 100644 --- a/packages/react-app/app/page.tsx +++ b/packages/react-app/app/page.tsx @@ -1,13 +1,36 @@ 'use client'; import { useEffect, useState } from 'react'; +import { useAccount, useChainId } from 'wagmi'; +import { ArrowRightIcon, BeakerIcon, RocketLaunchIcon, CommandLineIcon } from '@heroicons/react/24/outline'; +import Link from 'next/link'; -import { useAccount } from 'wagmi'; +const features = [ + { + name: 'Faucet', + description: 'Get testnet tokens to start building', + icon: BeakerIcon, + href: 'https://faucet.celo.org/alfajores', + }, + { + name: 'Deploy', + description: 'Launch your dApp on Celo', + icon: RocketLaunchIcon, + href: 'https://github.com/celo-org/celo-composer/blob/main/docs/DEPLOYMENT_GUIDE.md', + }, + { + name: 'Develop', + description: 'Build with powerful tools', + icon: CommandLineIcon, + href: 'https://github.com/celo-org/celo-composer', + }, +]; export default function Home() { const [userAddress, setUserAddress] = useState(''); const [isMounted, setIsMounted] = useState(false); const { address, isConnected } = useAccount(); + const chainId = useChainId(); useEffect(() => { setIsMounted(true); @@ -19,20 +42,93 @@ export default function Home() { } }, [address, isConnected]); + const getNetworkBadge = () => { + // Celo Mainnet: 42220, Alfajores Testnet: 44787 + const isMainnet = chainId === 42220; + return ( + + {isMainnet ? 'Mainnet' : 'Testnet'} + + ); + }; + if (!isMounted) { return null; } return ( -
-
- There you go... a canvas for your next Celo project! +
+ {/* Gradient Background */} +
+ + {/* Content */} +
+

+ Welcome to Celo Composer +

+ +

+ Build. Deploy. Scale. +

+ +
+ + Get Started + + + + Documentation + +
+ + {/* Feature Grid */} +
+ {features.map((feature) => ( + +
+ +

{feature.name}

+

{feature.description}

+
+ + ))} +
+ + {/* Wallet Status */} + {isConnected ? ( +
+
+ Connected: + {userAddress} + {getNetworkBadge()} +
+
+ ) : ( +
+ Connect your wallet to get started +
+ )}
- {isConnected ? ( -
Your address: {userAddress}
- ) : ( -
No Wallet Connected
- )} + + {/* Updated bottom gradient */} +
); }