Skip to content

Commit 92713da

Browse files
committed
tmp
1 parent 686e609 commit 92713da

File tree

7 files changed

+30
-268
lines changed

7 files changed

+30
-268
lines changed

app/[locale]/dapps/_components/dapps.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import React, {
88
useRef,
99
useState,
1010
} from "react"
11-
import { useRouter } from "next/router"
11+
import { useSearchParams } from "next/navigation"
1212
import { useLocale } from "next-intl"
1313

1414
import type { ChildOnlyProp } from "@/lib/types"
@@ -287,17 +287,16 @@ interface Categories {
287287

288288
const DappsPage = () => {
289289
const { t } = useTranslation(["page-dapps", "common"])
290-
const { query } = useRouter()
290+
const searchParams = useSearchParams()
291291
const locale = useLocale()
292292

293293
const [selectedCategory, setCategory] = useState<CategoryType>(
294294
CategoryType.FINANCE
295295
)
296296
const explore = useRef<HTMLDivElement>(null)
297297

298+
const queryParamCategories = searchParams.get("category") || ""
298299
useEffect(() => {
299-
// Fetch category on load
300-
const queryParamCategories = (query.category as string) || ""
301300
const selectedCategory = queryParamCategories
302301
? (queryParamCategories.split(",")[0] as CategoryType)
303302
: CategoryType.FINANCE // Default to finance category if empty
@@ -319,7 +318,7 @@ const DappsPage = () => {
319318
behavior: "smooth",
320319
})
321320
}
322-
}, [query.category])
321+
}, [queryParamCategories])
323322

324323
const updatePath = (
325324
selectedCategory: CategoryType,

app/[locale]/layout.tsx

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pick from "lodash.pick"
2+
import { IBM_Plex_Mono, Inter } from "next/font/google"
23
import { notFound } from "next/navigation"
34
import { getMessages, setRequestLocale } from "next-intl/server"
45

@@ -14,6 +15,20 @@ import "@/styles/global.css"
1415
import { routing } from "@/i18n/routing"
1516
import { BaseLayout } from "@/layouts/BaseLayout"
1617

18+
const inter = Inter({
19+
subsets: ["latin"],
20+
display: "swap",
21+
variable: "--font-inter",
22+
preload: true,
23+
})
24+
25+
const ibmPlexMono = IBM_Plex_Mono({
26+
subsets: ["latin"],
27+
weight: ["400"],
28+
display: "swap",
29+
variable: "--font-mono",
30+
})
31+
1732
export default async function LocaleLayout({
1833
children,
1934
params: { locale },
@@ -38,7 +53,11 @@ export default async function LocaleLayout({
3853
)
3954

4055
return (
41-
<html lang={locale} suppressHydrationWarning>
56+
<html
57+
lang={locale}
58+
className={`${inter.variable} ${ibmPlexMono.variable}`}
59+
suppressHydrationWarning
60+
>
4261
<body>
4362
<Providers locale={locale} messages={messages}>
4463
<BaseLayout lastDeployLocaleTimestamp={lastDeployLocaleTimestamp}>

src/components/RadialChart/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
"use client"
22

33
import { type ReactNode, useEffect, useState } from "react"
4-
import { useRouter } from "next/router"
4+
import { useLocale } from "next-intl"
55
import { MdInfoOutline } from "react-icons/md"
66
import { PolarAngleAxis, RadialBar, RadialBarChart } from "recharts"
77

@@ -53,7 +53,7 @@ const RadialChart = ({
5353
displayValue,
5454
}: RadialChartProps) => {
5555
const { t } = useTranslation("common")
56-
const { locale } = useRouter()
56+
const locale = useLocale()
5757
const [isMounted, setIsMounted] = useState(false)
5858

5959
useEffect(() => {

src/components/Resources/useResources.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { useEffect, useState } from "react"
2-
import { useRouter } from "next/router"
2+
import { useLocale } from "next-intl"
33

44
import { Lang } from "@/lib/types"
55

@@ -60,7 +60,7 @@ const formatSmallUSD = (value: number, locale: string): string =>
6060

6161
export const useResources = ({ txCostsMedianUsd }): DashboardSection[] => {
6262
const { t } = useTranslation("page-resources")
63-
const { locale } = useRouter()
63+
const locale = useLocale()
6464
const localeForNumberFormat = getLocaleForNumberFormat(locale! as Lang)
6565

6666
const medianTxCost =

src/styles/fonts.css

Lines changed: 0 additions & 256 deletions
This file was deleted.

src/styles/global.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
@import "@docsearch/css";
66
@import "@/styles/colors.css";
77
@import "@/styles/semantic-tokens.css";
8-
@import "@/styles/fonts.css";
98
@import "@/styles/docsearch.css";
109

1110
@layer base {
@@ -81,7 +80,7 @@
8180

8281
@layer base {
8382
* {
84-
@apply border-border scroll-smooth;
83+
@apply scroll-smooth border-border;
8584
}
8685

8786
body {

tailwind.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ const config = {
1515
body: "var(--font-inter)",
1616
monospace: "var(--font-mono)",
1717
mono: "var(--font-mono)",
18+
sans: "var(--font-inter)",
1819
},
1920
fontSize: {
2021
"7xl": ["4rem", "1.1"], // [7xl, 6xs]

0 commit comments

Comments
 (0)