Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export default function Home() {
<main className="min-h-screen">
<Navbar />
<Hero />

<Features />
<HowItWorks />
<Benefits />
Expand Down
324 changes: 251 additions & 73 deletions components/navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,128 +1,306 @@
'use client'
// // 'use client'

import Link from 'next/link'
import { Button } from '@/components/ui/button'
import { Menu, X, Wallet } from 'lucide-react'
import { useState, useEffect } from 'react'
import Image from 'next/image'
import { ThemeToggle } from './ui/ThemeToggle'
// // import Link from 'next/link'
// // import { Button } from '@/components/ui/button'
// // import { Menu, X, Wallet } from 'lucide-react'
// // import { useState, useEffect } from 'react'
// // import Image from 'next/image'
// // import { ThemeToggle } from './ui/ThemeToggle'

// // export function Navbar() {
// // const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
// // const [address, setAddress] = useState<string | null>(null)

// // useEffect(() => {
// // const savedAddress = localStorage.getItem('stellar_wallet_address')
// // if (savedAddress && savedAddress !== address) {
// // // eslint-disable-next-line react-hooks/set-state-in-effect
// // setAddress(savedAddress)
// // }
// // }, [address])

// // const formatAddress = (addr: string) => {
// // if (!addr || addr.length <= 10) return addr;
// // return `${addr.substring(0, 5)}...${addr.substring(addr.length - 4)}`
// // }

// // return (
// // <nav className="fixed top-0 left-0 right-0 z-50 border-b border-border/40 backdrop-blur-xl bg-background/80">
// // <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
// // <div className="flex h-16 items-center justify-between">
// // <div className="flex items-center gap-2">
// // <Image
// // src='/assets/logo2.png'
// // alt="Logo"
// // width={20}
// // height={20}
// // className="h-10 w-10 object-cover"
// // />
// // <span className="text-xl font-bold text-foreground">TaskChain</span>
// // </div>

// // <div className="hidden md:flex items-center gap-8">
// // <Link href="#features" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
// // Features
// // </Link>
// // <Link href="#how-it-works" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
// // How It Works
// // </Link>
// // <Link href="#benefits" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
// // Benefits
// // </Link>
// // <Link href="#testimonials" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
// // Testimonials
// // </Link>
// // </div>

// // <div className="hidden md:flex items-center gap-4">
// // {address ? (
// // <Button variant="outline" asChild>
// // <Link href="/login">
// // <Wallet className="w-4 h-4 mr-2" />
// // {formatAddress(address)}
// // </Link>
// // </Button>
// // ) : (
// // <>
// // <Button variant="ghost" asChild>
// // <Link href="/login">Login</Link>
// // </Button>
// // <Button asChild>
// // <Link href="/signup">Get Started</Link>
// // </Button>
// // <ThemeToggle />
// // </>
// // )}


// // </div>

// // <button
// // className="md:hidden p-2 text-muted-foreground hover:text-foreground"
// // onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
// // >
// // {mobileMenuOpen ? <X className="h-6 w-6" /> : <Menu className="h-6 w-6" />}
// // </button>
// // </div>
// // </div>

// // {mobileMenuOpen && (
// // <div className="md:hidden border-t border-border/40 bg-background/95 backdrop-blur-xl">
// // <div className="px-4 py-6 space-y-4">
// // <Link href="#features" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
// // Features
// // </Link>
// // <Link href="#how-it-works" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
// // How It Works
// // </Link>
// // <Link href="#benefits" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
// // Benefits
// // </Link>
// // <Link href="#testimonials" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
// // Testimonials
// // </Link>
// // <div className="pt-4 space-y-2">
// // {address ? (
// // <Button variant="outline" className="w-full" asChild>
// // <Link href="/login">
// // <Wallet className="w-4 h-4 mr-2" />
// // {formatAddress(address)}
// // </Link>
// // </Button>
// // ) : (
// // <>
// // <Button variant="ghost" className="w-full" asChild>
// // <Link href="/login">Login</Link>
// // </Button>
// // <Button className="w-full" asChild>
// // <Link href="/signup">Get Started</Link>
// // </Button>
// // </>
// // )}
// // </div>
// // </div>
// // </div>
// // )}
// // </nav>
// // )
// // }

// 'use client'

// import Link from 'next/link'
// import { Button } from '@/components/ui/button'
// import { Menu, X } from 'lucide-react'
// import { useState } from 'react'
// import Image from 'next/image'
// import { ThemeToggle } from './ui/ThemeToggle'
// import { WalletConnect } from '@/components/wallet-connect'

// export function Navbar() {
// const [mobileMenuOpen, setMobileMenuOpen] = useState(false)

// return (
// <nav className="fixed top-0 left-0 right-0 z-50 border-b border-border/40 backdrop-blur-xl bg-background/80">
// <div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
// <div className="flex h-16 items-center justify-between">
// <div className="flex items-center gap-2">
// <Image
// src='/assets/logo2.png'
// alt="Logo"
// width={20}
// height={20}
// className="h-10 w-10 object-cover"
// />
// <span className="text-xl font-bold text-foreground">TaskChain</span>
// </div>

// <div className="hidden md:flex items-center gap-8">
// <Link href="#features" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
// Features
// </Link>
// <Link href="#how-it-works" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
// How It Works
// </Link>
// <Link href="#benefits" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
// Benefits
// </Link>
// <Link href="#testimonials" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
// Testimonials
// </Link>
// </div>

// <div className="hidden md:flex items-center gap-4">
// <WalletConnect />
// <ThemeToggle />
// </div>

// <button
// className="md:hidden p-2 text-muted-foreground hover:text-foreground"
// onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
// >
// {mobileMenuOpen ? <X className="h-6 w-6" /> : <Menu className="h-6 w-6" />}
// </button>
// </div>
// </div>

// {mobileMenuOpen && (
// <div className="md:hidden border-t border-border/40 bg-background/95 backdrop-blur-xl">
// <div className="px-4 py-6 space-y-4">
// <Link href="#features" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
// Features
// </Link>
// <Link href="#how-it-works" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
// How It Works
// </Link>
// <Link href="#benefits" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
// Benefits
// </Link>
// <Link href="#testimonials" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
// Testimonials
// </Link>
// <div className="pt-4 flex flex-col gap-2">
// <WalletConnect />
// <ThemeToggle />
// </div>
// </div>
// </div>
// )}
// </nav>
// )
// }

"use client";

import Link from "next/link";
import { Button } from "@/components/ui/button";
import { Menu, X } from "lucide-react";
import { useState } from "react";
import Image from "next/image";
import { ThemeToggle } from "./ui/ThemeToggle";
import { WalletConnect } from "@/components/wallet-connect";

export function Navbar() {
const [mobileMenuOpen, setMobileMenuOpen] = useState(false)
const [address, setAddress] = useState<string | null>(null)

useEffect(() => {
const savedAddress = localStorage.getItem('stellar_wallet_address')
if (savedAddress && savedAddress !== address) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setAddress(savedAddress)
}
}, [address])

const formatAddress = (addr: string) => {
if (!addr || addr.length <= 10) return addr;
return `${addr.substring(0, 5)}...${addr.substring(addr.length - 4)}`
}
const [mobileMenuOpen, setMobileMenuOpen] = useState(false);

return (
<nav className="fixed top-0 left-0 right-0 z-50 border-b border-border/40 backdrop-blur-xl bg-background/80">
<div className="mx-auto max-w-7xl px-4 sm:px-6 lg:px-8">
<div className="flex h-16 items-center justify-between">
{/* Logo */}
<div className="flex items-center gap-2">
<Image
src='/assets/logo2.png'
src="/assets/logo2.png"
alt="Logo"
width={20}
height={20}
className="h-10 w-10 object-cover"
/>
<span className="text-xl font-bold text-foreground">TaskChain</span>
<span className="text-xl font-bold text-foreground">
TaskChain
</span>
</div>

{/* Desktop Links */}
<div className="hidden md:flex items-center gap-8">
<Link href="#features" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
<Link href="#features" className="text-sm text-muted-foreground hover:text-foreground">
Features
</Link>
<Link href="#how-it-works" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
<Link href="#how-it-works" className="text-sm text-muted-foreground hover:text-foreground">
How It Works
</Link>
<Link href="#benefits" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
<Link href="#benefits" className="text-sm text-muted-foreground hover:text-foreground">
Benefits
</Link>
<Link href="#testimonials" className="text-sm text-muted-foreground hover:text-foreground transition-colors">
<Link href="#testimonials" className="text-sm text-muted-foreground hover:text-foreground">
Testimonials
</Link>
</div>

{/* Desktop Actions */}
<div className="hidden md:flex items-center gap-4">
{address ? (
<Button variant="outline" asChild>
<Link href="/login">
<Wallet className="w-4 h-4 mr-2" />
{formatAddress(address)}
</Link>
</Button>
) : (
<>
<Button variant="ghost" asChild>
<Link href="/login">Login</Link>
</Button>
<Button asChild>
<Link href="/signup">Get Started</Link>
</Button>
<ThemeToggle />
</>
)}


<WalletConnect />
<ThemeToggle />
</div>

{/* Mobile Menu Button */}
<button
className="md:hidden p-2 text-muted-foreground hover:text-foreground"
onClick={() => setMobileMenuOpen(!mobileMenuOpen)}
>
{mobileMenuOpen ? <X className="h-6 w-6" /> : <Menu className="h-6 w-6" />}
{mobileMenuOpen ? (
<X className="h-6 w-6" />
) : (
<Menu className="h-6 w-6" />
)}
</button>
</div>
</div>

{/* Mobile Menu */}
{mobileMenuOpen && (
<div className="md:hidden border-t border-border/40 bg-background/95 backdrop-blur-xl">
<div className="px-4 py-6 space-y-4">
<Link href="#features" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
<Link href="#features" onClick={() => setMobileMenuOpen(false)}>
Features
</Link>
<Link href="#how-it-works" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
<Link href="#how-it-works" onClick={() => setMobileMenuOpen(false)}>
How It Works
</Link>
<Link href="#benefits" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
<Link href="#benefits" onClick={() => setMobileMenuOpen(false)}>
Benefits
</Link>
<Link href="#testimonials" className="block text-sm text-muted-foreground hover:text-foreground transition-colors">
<Link href="#testimonials" onClick={() => setMobileMenuOpen(false)}>
Testimonials
</Link>
<div className="pt-4 space-y-2">
{address ? (
<Button variant="outline" className="w-full" asChild>
<Link href="/login">
<Wallet className="w-4 h-4 mr-2" />
{formatAddress(address)}
</Link>
</Button>
) : (
<>
<Button variant="ghost" className="w-full" asChild>
<Link href="/login">Login</Link>
</Button>
<Button className="w-full" asChild>
<Link href="/signup">Get Started</Link>
</Button>
</>
)}

<div className="pt-4 flex flex-col gap-2">
<WalletConnect />
<ThemeToggle />
</div>
</div>
</div>
)}
</nav>
)
}
);
}
Loading
Loading