Skip to content

Commit

Permalink
😍
Browse files Browse the repository at this point in the history
  • Loading branch information
nerderlyne committed Feb 19, 2024
1 parent 8dd0c04 commit 7c56984
Show file tree
Hide file tree
Showing 18 changed files with 384 additions and 9,895 deletions.
8 changes: 7 additions & 1 deletion ui/styles/globals.css → ui/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,14 @@ html,
body {
padding: 0;
margin: 0;
font-family: 'JetBrains Mono', monospace !important;
background-color: black;
font-family: 'VT323', monospace !important;
}

.default-font {
font-family: "VT323", monospace;
font-weight: 400;
font-style: normal;
}

a {
Expand Down
81 changes: 81 additions & 0 deletions ui/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
import { Metadata, Viewport } from "next";

import { siteConfig } from "@/lib/site";

import "@/app/globals.css";
import "@rainbow-me/rainbowkit/styles.css";

import { cn } from "@/lib/utils";
import { Providers } from "@/components/providers";

export const metadata: Metadata = {
title: { default: "Intents Engine", template: `%s | ${siteConfig.name}` },
description: siteConfig.description,
authors: [
{
name: siteConfig.author,
url: siteConfig.githubUrl,
},
],
generator: "Next.js",
keywords: siteConfig.keywords,
icons: {
icon: "/logo.webp",
apple: "/apple-touch-icon.png",
},
metadataBase: new URL(siteConfig.baseUrl),
openGraph: {
type: "website",
title: siteConfig.name,
description: siteConfig.description,
url: siteConfig.baseUrl,
siteName: siteConfig.name,
},
twitter: {
card: "summary_large_image",
site: siteConfig.baseUrl,
siteId: siteConfig.twitterId,
creator: siteConfig.author,
creatorId: siteConfig.twitterId,
description: siteConfig.description,
title: siteConfig.name,
},
};

export const viewport: Viewport = {
width: "device-width", // This will make the width of the page follow the screen-width of the device (which will vary depending on the device).
height: "device-height", // Similar to the above, but for height.
initialScale: 1, // This defines the ratio between the device width (device-width in portrait mode or device-height in landscape mode) and the viewport size.
minimumScale: 1, // This defines the minimum zoom level to which the user can zoom out. Keeping this as 1 disallows the user to zoom out beyond the initial scale.
maximumScale: 1, // This defines the maximum zoom level to which the user can zoom in. This can be set as per your requirement.
userScalable: false, // This allows the user to zoom in or out on the webpage. 'no' will prevent the user from zooming.
viewportFit: "cover", // This can be set to 'auto', 'contain', or 'cover'. 'cover' implies that the viewport should cover the whole screen.
interactiveWidget: "resizes-visual", // This can be set to 'resizes-visual', 'resizes-content', or 'overlays-content'. 'resizes-visual' implies that the widget can resize the visual viewport.
};

export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html
lang="en"
className={cn(
"min-h-full bg-black text-white w-screen",
"default-font",
)}
suppressHydrationWarning
>
<head>
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
<link href="https://fonts.googleapis.com/css2?family=VT323&display=swap" rel="stylesheet" />

</head>
<body>
<Providers>{children}</Providers>
</body>
</html>
);
}
13 changes: 13 additions & 0 deletions ui/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Shell } from "@/components/shell";
import { Header } from "@/components/header";

const Home = () => {
return (
<main className="p-1">
<Header />
<Shell />
</main>
);
};

export default Home;
Binary file added ui/bun.lockb
Binary file not shown.
40 changes: 40 additions & 0 deletions ui/components/account.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
"use client";
import { useConnectModal } from "@rainbow-me/rainbowkit";
import { useAccount, useSwitchChain } from "wagmi";

export const Account = () => {
const { isConnected, isReconnecting, chain } = useAccount();
const { chains, switchChain } = useSwitchChain();
const { openConnectModal, connectModalOpen } = useConnectModal();

if (!isConnected)
return (
<button
className="italic hover:underline focus:outline-none"
onClick={openConnectModal}
>
Connect
</button>
);

if (connectModalOpen) return <p className="animate-spin"></p>;

if (isReconnecting) return <p>Reconnecting...</p>;

return (
<p>
Connected to{" "}
<select
defaultValue={chain?.id}
className="text-black"
onChange={(e) => switchChain({ chainId: Number(e.target.value) })}
>
{chains.map((chain) => (
<option key={chain.id} value={chain.id}>
{chain.name}
</option>
))}
</select>
</p>
);
};
11 changes: 11 additions & 0 deletions ui/components/header.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { Account } from "./account";

export const Header = () => {
return (
<div className="mb-3">
<p>Nani Intents Shell {"[ Version 1.0.0 ]"}</p>
<p className="mb-2">(c) 2024 Nani Kotoba DAO LLC. All rights reserved.</p>
<Account />
</div>
);
};
30 changes: 30 additions & 0 deletions ui/components/providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"use client";

import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { WagmiProvider } from "wagmi";
import { mainnet, sepolia } from "wagmi/chains";
import { getDefaultConfig, RainbowKitProvider } from "@rainbow-me/rainbowkit";
import { siteConfig } from "@/lib/site";

const config = getDefaultConfig({
appName: siteConfig.name,
appDescription: siteConfig.description,
projectId: process.env.NEXT_PUBLIC_WC_ID!,
chains: [
mainnet,
...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === "true" ? [sepolia] : []),
],
ssr: true,
});

const client = new QueryClient();

export function Providers({ children }: { children: React.ReactNode }) {
return (
<WagmiProvider config={config}>
<QueryClientProvider client={client}>
<RainbowKitProvider>{children}</RainbowKitProvider>
</QueryClientProvider>
</WagmiProvider>
);
}
15 changes: 15 additions & 0 deletions ui/components/shell-history.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client'
import useShellStore from "@/lib/use-shell-store"

export const ShellHistory = () => {
const history = useShellStore(state => state.history)

return (
<div>
{history.map((line, i) => (
<div className="mt-1" key={i}>{line}</div>
))}
</div>
)
}

Loading

0 comments on commit 7c56984

Please sign in to comment.