From b7f57b0eeca082981152c8b5ad5d44a1040e19cb Mon Sep 17 00:00:00 2001 From: sripwoud Date: Mon, 14 Oct 2024 12:42:58 +0200 Subject: [PATCH] chore: improve next font integration with tailwind --- apps/client/package.json | 4 ++-- apps/client/src/app/globals.css | 16 ++++------------ apps/client/src/app/layout.tsx | 18 +++++++----------- apps/client/src/components/Dashboard.tsx | 10 ++++++++-- apps/client/src/lib/config.ts | 7 +++++++ apps/client/tailwind.config.ts | 5 ++++- bun.lockb | Bin 636312 -> 636312 bytes yarn.lock | 2 +- 8 files changed, 33 insertions(+), 29 deletions(-) diff --git a/apps/client/package.json b/apps/client/package.json index c33e058..e631973 100644 --- a/apps/client/package.json +++ b/apps/client/package.json @@ -26,11 +26,11 @@ "wagmi": "^2.12.17" }, "devDependencies": { - "typescript": "^5", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", "postcss": "^8", - "tailwindcss": "^3.4.1" + "tailwindcss": "^3.4.1", + "typescript": "^5" } } diff --git a/apps/client/src/app/globals.css b/apps/client/src/app/globals.css index 5a7a7eb..2bfc255 100644 --- a/apps/client/src/app/globals.css +++ b/apps/client/src/app/globals.css @@ -2,18 +2,6 @@ @tailwind components; @tailwind utilities; -/* :root { */ -/* --background: #ffffff; */ -/* --foreground: #171717; */ -/* } */ - -/* @media (prefers-color-scheme: dark) { */ -/* :root { */ -/* --background: #0a0a0a; */ -/* --foreground: #ededed; */ -/* } */ -/* } */ - @layer base { a { @apply hover:underline hover:text-crayola; @@ -30,6 +18,10 @@ button:hover { border-radius: 0.75rem; } + + code { + @apply text-base; + } } /* body { */ diff --git a/apps/client/src/app/layout.tsx b/apps/client/src/app/layout.tsx index eafc7ca..f36a0cb 100644 --- a/apps/client/src/app/layout.tsx +++ b/apps/client/src/app/layout.tsx @@ -1,19 +1,17 @@ -import type { Metadata } from 'next' -import { Teko } from 'next/font/google' +import { Fira_Mono, Teko } from 'next/font/google' import './globals.css' import { cookieToInitialState } from '@account-kit/core' import { Layout } from 'client/c/Layout' +import config from 'client/l/config' import { alchemyConfig } from 'client/lib/account-kit' import { Providers } from 'client/p' import { headers } from 'next/headers' import type { ReactNode } from 'react' -const teko = Teko({ subsets: ['latin'] }) +const firaMono = Fira_Mono({ display: 'swap', subsets: ['latin'], variable: '--font-fira-mono', weight: '400' }) +const teko = Teko({ display: 'swap', subsets: ['latin'], variable: '--font-teko' }) -export const metadata: Metadata = { - title: 'Rideau', - description: 'Anonymous survey and feedback platform', -} +export const metadata = config.metadata export default function RootLayout({ children, @@ -23,10 +21,8 @@ export default function RootLayout({ const initialState = cookieToInitialState(alchemyConfig, headers().get('cookie') ?? undefined) return ( - - + + {/* @ts-ignore FIXME */} diff --git a/apps/client/src/components/Dashboard.tsx b/apps/client/src/components/Dashboard.tsx index 0f03e37..afa2524 100644 --- a/apps/client/src/components/Dashboard.tsx +++ b/apps/client/src/components/Dashboard.tsx @@ -12,8 +12,14 @@ export const Dashboard = () => { return (

Dashboard

-

Account: {account?.address}

- {semaphoreId.andThenSync(({ commitment }) =>

Semaphore commitment: {commitment.toString()}

)} +

+ Account: {account?.address} +

+ {semaphoreId.andThenSync(({ commitment }) => ( +

+ Semaphore commitment: {commitment.toString()} +

+ ))}
) } diff --git a/apps/client/src/lib/config.ts b/apps/client/src/lib/config.ts index 5e16ec9..974024c 100644 --- a/apps/client/src/lib/config.ts +++ b/apps/client/src/lib/config.ts @@ -1,6 +1,8 @@ import { isEnvVarDefined, sharedConfig, type SharedConfigI } from 'config' +import type { Metadata } from 'next' interface ClientConfigI { + metadata: Metadata serverUrl: string } @@ -10,6 +12,11 @@ isEnvVarDefined(serverUrl, 'NEXT_PUBLIC_SERVER_URL') const clientConfig: SharedConfigI & ClientConfigI = { ...sharedConfig, + metadata: { + title: 'Rideau', + description: 'Anonymous survey and feedback platform', + }, + serverUrl, } diff --git a/apps/client/tailwind.config.ts b/apps/client/tailwind.config.ts index a1ad640..700632f 100644 --- a/apps/client/tailwind.config.ts +++ b/apps/client/tailwind.config.ts @@ -3,7 +3,6 @@ import type { Config } from 'tailwindcss' const config: Config = { content: [ - './src/pages/**/*.{js,ts,jsx,tsx,mdx}', './src/components/**/*.{js,ts,jsx,tsx,mdx}', './src/app/**/*.{js,ts,jsx,tsx,mdx}', ], @@ -18,6 +17,10 @@ const config: Config = { blue: '#99e1d9', wenge: '#5d576b', }, + fontFamily: { + mono: ['var(--font-fira-mono)'], + sans: ['var(--font-teko)'], + }, }, }, plugins: [], diff --git a/bun.lockb b/bun.lockb index f096d0a4c8a6a433983e9c8b404551a7d1023931..41af7796eb5be852e35192ebfbeb947973ae3021 100755 GIT binary patch delta 43 xcmbR7T5ZN_wT2eP7N!>F7M2#)Eo_|E*%{+Z^o;ck+6At&0Wte_f$JO{_W)MV4_*KO delta 43 ucmbR7T5ZN_wT2eP7N!>F7M2#)Eo_|E*_jx?pk3fP8xXT^7r4&RaSs4LVh#=f diff --git a/yarn.lock b/yarn.lock index 2a5b4da..c1f49d6 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5485,7 +5485,7 @@ cli-width@^4.1.0: "@account-kit/infra" "^4.0.0-beta.9" "@account-kit/react" "^4.0.0-beta.9" "@hazae41/option" "^1.1.4" - "@semaphore-protocol/core" "" + "@semaphore-protocol/core" "^4.3.0" "@tanstack/react-query" "^5.59.8" "@trpc/client" "^10.45.2" encoding "^0.1.13"