diff --git a/ui/src/components/Footer.tsx b/ui/src/components/Footer.tsx new file mode 100644 index 00000000..133cd84e --- /dev/null +++ b/ui/src/components/Footer.tsx @@ -0,0 +1,70 @@ +import { SVGProps } from 'react' +import { JSX } from 'react/jsx-runtime' + +const navigation = [ + { + name: 'GitHub', + href: 'https://github.com/TxnLab/reti', + icon: (props: JSX.IntrinsicAttributes & SVGProps) => ( + + + + ), + }, + { + name: 'GitBook', + href: 'https://txnlab.gitbook.io/reti-open-pooling', + icon: (props: JSX.IntrinsicAttributes & SVGProps) => ( + + + + ), + }, +] + +export function Footer() { + return ( + + ) +} diff --git a/ui/src/components/Layout.tsx b/ui/src/components/Layout.tsx index c7eacff9..6687d7a2 100644 --- a/ui/src/components/Layout.tsx +++ b/ui/src/components/Layout.tsx @@ -2,6 +2,7 @@ import { Link } from '@tanstack/react-router' import { useWallet } from '@txnlab/use-wallet-react' import { Connect } from '@/components/Connect' import { ConnectedMenu } from '@/components/ConnectedMenu' +import { Footer } from '@/components/Footer' import { GitHub } from '@/components/GitHub' import { Logo } from '@/components/Logo' import { MobileMenu } from '@/components/MobileMenu' @@ -18,7 +19,7 @@ export function Layout({ children }: LayoutProps) { const { activeAddress } = useWallet() return ( -
+
-
{children}
+ {children} + +
) } diff --git a/ui/src/components/Loading.tsx b/ui/src/components/Loading.tsx index 030d3e0f..a6b38049 100644 --- a/ui/src/components/Loading.tsx +++ b/ui/src/components/Loading.tsx @@ -4,9 +4,10 @@ interface LoadingProps { size?: 'sm' | 'md' | 'lg' inline?: boolean className?: string + flex?: boolean } -export function Loading({ size, className = '', inline = false }: LoadingProps) { +export function Loading({ size, className = '', inline = false, flex = false }: LoadingProps) { const getSizeClasses = () => { switch (size) { case 'sm': @@ -52,7 +53,12 @@ export function Loading({ size, className = '', inline = false }: LoadingProps) } return ( -
+
{renderSpinner()}
) diff --git a/ui/src/components/PageHeader.tsx b/ui/src/components/PageHeader.tsx index 6b69cf51..c6601891 100644 --- a/ui/src/components/PageHeader.tsx +++ b/ui/src/components/PageHeader.tsx @@ -10,7 +10,7 @@ export function PageHeader({ title, description, separator = false }: PageHeader if (!title) return null return (
-
+

+
{children}
) diff --git a/ui/src/routes/index.tsx b/ui/src/routes/index.tsx index 928b6cfb..3fd91e57 100644 --- a/ui/src/routes/index.tsx +++ b/ui/src/routes/index.tsx @@ -19,7 +19,7 @@ export const Route = createFileRoute('/')({ queryClient.ensureQueryData(validatorsQueryOptions(queryClient)) }, component: Dashboard, - pendingComponent: () => , + pendingComponent: () => , errorComponent: ({ error }) => { if (error instanceof Error) { return
{error?.message}
diff --git a/ui/tsconfig.json b/ui/tsconfig.json index 284a059d..b765a11b 100644 --- a/ui/tsconfig.json +++ b/ui/tsconfig.json @@ -27,7 +27,7 @@ }, "types": ["vitest/globals"] }, - "include": ["src/**/*.ts", "src/**/*.tsx", "vite.config.ts", "vitest.setup.ts"], + "include": ["src/**/*.ts", "src/**/*.tsx", "vite.config.ts", "vitest.setup.ts", "vite-env.d.ts"], "references": [ { "path": "./tsconfig.node.json" diff --git a/ui/tsconfig.node.json b/ui/tsconfig.node.json index 0efe3a88..0fcfc7b6 100644 --- a/ui/tsconfig.node.json +++ b/ui/tsconfig.node.json @@ -4,6 +4,7 @@ "module": "ESNext", "moduleResolution": "Node", "allowSyntheticDefaultImports": true, + "resolveJsonModule": true, "types": ["node"] }, "include": ["vite.config.ts", "playwright.config.ts"] diff --git a/ui/vite-env.d.ts b/ui/vite-env.d.ts new file mode 100644 index 00000000..54eaa072 --- /dev/null +++ b/ui/vite-env.d.ts @@ -0,0 +1,3 @@ +/// + +declare const __APP_VERSION__: string diff --git a/ui/vite.config.ts b/ui/vite.config.ts index 3ea30fd0..1109260b 100644 --- a/ui/vite.config.ts +++ b/ui/vite.config.ts @@ -4,6 +4,7 @@ import react from '@vitejs/plugin-react' import path from 'path' import { defineConfig } from 'vite' import { nodePolyfills } from 'vite-plugin-node-polyfills' +import { version } from './package.json' export default defineConfig({ plugins: [ @@ -28,6 +29,9 @@ export default defineConfig({ '@': path.resolve(__dirname, './src'), }, }, + define: { + __APP_VERSION__: JSON.stringify(version), + }, test: { name: 'reti-ui', dir: './src',