Skip to content

Commit

Permalink
fatcat: add client (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x0ece authored Jan 26, 2025
1 parent 0ca0f2c commit 1b9e254
Show file tree
Hide file tree
Showing 11 changed files with 1,854 additions and 393 deletions.
16 changes: 11 additions & 5 deletions apps/fatcat/next.config.mjs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
experimental: {
// Edge runtime is now configured per-route using config export
}
}
webpack: (config) => {
config.resolve.fallback = {
fs: false, // ignore the 'fs' module
};
return config;
},
experimental: {
// Edge runtime is now configured per-route using config export
},
};

export default nextConfig;
export default nextConfig;
3 changes: 2 additions & 1 deletion apps/fatcat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"lint": "next lint"
},
"dependencies": {
"@glamsystems/glam-sdk": "file:../../anchor",
"@heroicons/react": "^2.1.5",
"@hookform/resolvers": "^3.9.1",
"@metaplex-foundation/mpl-toolbox": "^0.9.4",
Expand All @@ -32,7 +33,7 @@
"@solana/wallet-adapter-react": "^0.15.35",
"@solana/wallet-adapter-react-ui": "^0.9.35",
"@solana/wallet-adapter-wallets": "^0.19.32",
"@solana/web3.js": "^1.95.2",
"@solana/web3.js": "^1.98",
"@types/react": "npm:types-react@rc",
"@types/react-dom": "npm:types-react-dom@rc",
"@vercel/analytics": "^1.4.1",
Expand Down
1,393 changes: 1,320 additions & 73 deletions apps/fatcat/pnpm-lock.yaml

Large diffs are not rendered by default.

155 changes: 108 additions & 47 deletions apps/fatcat/src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,65 +1,126 @@
import { ThemeProviderWrapper } from "../providers/themeProvider";
import { WalletAdapterProvider } from "../providers/walletAdapterProvider";
import { ClientProvider } from "../providers/clientProvider";
import type { Metadata } from "next";
import "./globals.css";
import { UmiProvider } from "../providers/umiProvider";
import { cn } from "../lib/utils";
import {PersistentWarning} from "../components/persistent-warning";
import { GeistSans } from 'geist/font/sans';
import { Analytics } from "@vercel/analytics/react"
import { PersistentWarning } from "../components/persistent-warning";
import { GeistSans } from "geist/font/sans";
import { Analytics } from "@vercel/analytics/react";
import Header from "../components/header";
import { SpeedInsights } from "@vercel/speed-insights/next"

import { SpeedInsights } from "@vercel/speed-insights/next";

export const metadata: Metadata = {
title: "FatCat",
description: "Jupiter Governance Vote Automation.",
title: "FatCat",
description: "Jupiter Governance Vote Automation.",
};

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
children,
}: Readonly<{
children: React.ReactNode;
}>) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<link rel="icon" href="/favicon.ico"/>
<link rel="apple-touch-icon" sizes="57x57" href="/apple-icon-57x57.png"/>
<link rel="apple-touch-icon" sizes="60x60" href="/apple-icon-60x60.png"/>
<link rel="apple-touch-icon" sizes="72x72" href="/apple-icon-72x72.png"/>
<link rel="apple-touch-icon" sizes="76x76" href="/apple-icon-76x76.png"/>
<link rel="apple-touch-icon" sizes="114x114" href="/apple-icon-114x114.png"/>
<link rel="apple-touch-icon" sizes="120x120" href="/apple-icon-120x120.png"/>
<link rel="apple-touch-icon" sizes="144x144" href="/apple-icon-144x144.png"/>
<link rel="apple-touch-icon" sizes="152x152" href="/apple-icon-152x152.png"/>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-icon-180x180.png"/>
<link rel="icon" type="image/png" sizes="192x192" href="/android-icon-192x192.png"/>
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"/>
<link rel="icon" type="image/png" sizes="96x96" href="/favicon-96x96.png"/>
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"/>
<link rel="manifest" href="/manifest.json"/>
</head>
<body
className={cn(GeistSans.className, "min-h-screen bg-background antialiased select-none")}
>
<Analytics/>
return (
<html lang="en" suppressHydrationWarning>
<head>
<link rel="icon" href="/favicon.ico" />
<link
rel="apple-touch-icon"
sizes="57x57"
href="/apple-icon-57x57.png"
/>
<link
rel="apple-touch-icon"
sizes="60x60"
href="/apple-icon-60x60.png"
/>
<link
rel="apple-touch-icon"
sizes="72x72"
href="/apple-icon-72x72.png"
/>
<link
rel="apple-touch-icon"
sizes="76x76"
href="/apple-icon-76x76.png"
/>
<link
rel="apple-touch-icon"
sizes="114x114"
href="/apple-icon-114x114.png"
/>
<link
rel="apple-touch-icon"
sizes="120x120"
href="/apple-icon-120x120.png"
/>
<link
rel="apple-touch-icon"
sizes="144x144"
href="/apple-icon-144x144.png"
/>
<link
rel="apple-touch-icon"
sizes="152x152"
href="/apple-icon-152x152.png"
/>
<link
rel="apple-touch-icon"
sizes="180x180"
href="/apple-icon-180x180.png"
/>
<link
rel="icon"
type="image/png"
sizes="192x192"
href="/android-icon-192x192.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="96x96"
href="/favicon-96x96.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="/favicon-16x16.png"
/>
<link rel="manifest" href="/manifest.json" />
</head>
<body
className={cn(
GeistSans.className,
"min-h-screen bg-background antialiased select-none",
)}
>
<Analytics />
<WalletAdapterProvider>
<ClientProvider>
<UmiProvider>
<ThemeProviderWrapper
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<Header/>
{children}
<PersistentWarning/>
</ThemeProviderWrapper>
<ThemeProviderWrapper
attribute="class"
defaultTheme="system"
enableSystem
disableTransitionOnChange
>
<Header />
{children}
<PersistentWarning />
</ThemeProviderWrapper>
</UmiProvider>
</ClientProvider>
</WalletAdapterProvider>
<SpeedInsights/>
</body>
</html>);
<SpeedInsights />
</body>
</html>
);
}

174 changes: 95 additions & 79 deletions apps/fatcat/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,86 +1,102 @@
'use client'
"use client";

import Image from 'next/image'
import Link from 'next/link'
import { useWallet } from '@solana/wallet-adapter-react'
import { useEffect } from 'react'
import { useRouter } from 'next/navigation'
import Header from '@/components/header'
import { motion } from "framer-motion"
import { Button } from "@/components/ui/button"
import { FaqDialog } from "@/components/faq-dialog"
import {AnimatedNumber} from "@/components/animated-number";
import Image from "next/image";
import Link from "next/link";
import { useWallet } from "@solana/wallet-adapter-react";
import { useEffect } from "react";
import { useRouter } from "next/navigation";
import Header from "@/components/header";
import { motion } from "framer-motion";
import { Button } from "@/components/ui/button";
import { FaqDialog } from "@/components/faq-dialog";
import { AnimatedNumber } from "@/components/animated-number";

export default function Home() {
const { connected } = useWallet()
const router = useRouter()
const { connected } = useWallet();
const router = useRouter();

useEffect(() => {
if (connected) {
router.push('/dashboard')
}
}, [connected, router])
useEffect(() => {
if (connected) {
router.push("/dashboard");
}
}, [connected, router]);

return (
<motion.div
className="min-h-screen flex flex-col"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.5, ease: "linear" }}
>
<main className="flex-grow flex flex-col items-center justify-start p-4 sm:p-8 md:p-8 lg:p-4 mt-24 md:mt-32">
<div className="flex flex-col items-center justify-center space-y-8 md:space-y-4 max-w-6xl w-full">
{/*<h1 className="text-2xl sm:text-3xl md:text-4xl text-center opacity-90">Welcome to FatCat</h1>*/}
<div className="relative w-full sm:w-3/4 md:w-2/3 lg:w-1/2 xl:w-2/5 2xl:w-2/3 aspect-video overflow-hidden">
<motion.div
className="absolute inset-0"
initial={{opacity: 0}}
animate={{scale: 1.01, x: 0, y: -1, rotate: -1, opacity: 1}}
transition={{duration: 1, ease: "easeInOut"}}
>
<Image
src="/cat-final.png"
alt="FatCat"
fill
className="object-cover w-full h-full"
priority
/>
</motion.div>
</div>
<p className="text-xl sm:text-xl md:text-xl text-center max-w-2xl font-light text-muted-foreground">
Put your JUP votes on autopilot.
</p>
<div className="flex flex-col sm:flex-row gap-4 pb-4 pt-4 mt-8 w-full justify-center">
<div className="w-full order-2 sm:order-1">
return (
<motion.div
className="min-h-screen flex flex-col"
initial={{ opacity: 0 }}
animate={{ opacity: 1 }}
transition={{ duration: 0.5, ease: "linear" }}
>
<main className="flex-grow flex flex-col items-center justify-start p-4 sm:p-8 md:p-8 lg:p-4 mt-24 md:mt-32">
<div className="flex flex-col items-center justify-center space-y-8 md:space-y-4 max-w-6xl w-full">
{/*<h1 className="text-2xl sm:text-3xl md:text-4xl text-center opacity-90">Welcome to FatCat</h1>*/}
<div className="relative w-full sm:w-3/4 md:w-2/3 lg:w-1/2 xl:w-2/5 2xl:w-2/3 aspect-video overflow-hidden">
<motion.div
className="absolute inset-0"
initial={{ opacity: 0 }}
animate={{ scale: 1.01, x: 0, y: -1, rotate: -1, opacity: 1 }}
transition={{ duration: 1, ease: "easeInOut" }}
>
<Image
src="/cat-final.png"
alt="FatCat"
fill
className="object-cover w-full h-full"
priority
/>
</motion.div>
</div>
<p className="text-xl sm:text-xl md:text-xl text-center max-w-2xl font-light text-muted-foreground">
Put your JUP votes on autopilot.
</p>
<div className="flex flex-col sm:flex-row gap-4 pb-4 pt-4 mt-8 w-full justify-center">
<div className="w-full order-2 sm:order-1"></div>
<div className="order-1 sm:order-2 flex flex-col w-full justify-center items-center">
<AnimatedNumber
value={123456}
className="text-5xl font-mono text-primary mb-4"
/>
<span className="text-muted-foreground text-sm font-mono">
JUP Delegated
</span>
</div>
<div className="w-full order-3"></div>
</div>
<div className="flex flex-col sm:flex-row gap-4 mt-8 w-full justify-center pb-24 sm:pb-4">
<Link
href="https://github.com/glamsystems/fatcat"
passHref
target="_blank"
rel="noopener noreferrer"
className="w-full order-2 sm:order-1"
>
<Button
variant="ghost"
className="opacity-80 hover:opacity-100 transition-opacity w-full"
>
View the Code
</Button>
</Link>
<FaqDialog className="order-1 sm:order-2" />

</div>
<div className="order-1 sm:order-2 flex flex-col w-full justify-center items-center">
<AnimatedNumber
value={123456}
className="text-5xl font-mono text-primary mb-4"
/>
<span className="text-muted-foreground text-sm font-mono">JUP Delegated</span>
</div>
<div className="w-full order-3">

</div>
</div>
<div className="flex flex-col sm:flex-row gap-4 mt-8 w-full justify-center pb-24 sm:pb-4">
<Link href="https://github.com/glamsystems/fatcat" passHref target="_blank" rel="noopener noreferrer" className="w-full order-2 sm:order-1">
<Button variant="ghost" className="opacity-80 hover:opacity-100 transition-opacity w-full">
View the Code
</Button>
</Link>
<FaqDialog className="order-1 sm:order-2"/>

<Link href="https://glam.systems" passHref target="_blank" rel="noopener noreferrer" className="w-full order-3">
<Button variant="ghost" className="opacity-80 hover:opacity-100 transition-opacity w-full">
Powered by GLAM *.+
</Button>
</Link>
</div>
</div>
</main>
</motion.div>)
<Link
href="https://glam.systems"
passHref
target="_blank"
rel="noopener noreferrer"
className="w-full order-3"
>
<Button
variant="ghost"
className="opacity-80 hover:opacity-100 transition-opacity w-full"
>
Powered by GLAM *.+
</Button>
</Link>
</div>
</div>
</main>
</motion.div>
);
}

Loading

0 comments on commit 1b9e254

Please sign in to comment.