Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const withMDX = createMDX();
const config = {
reactStrictMode: true,
experimental: {
optimizePackageImports: ["@phosphor-icons/react"],
optimizePackageImports: ["@phosphor-icons/react", "lucide-react"],
},
turbopack: {
root: __dirname,
Expand Down
Binary file removed public/fonts/PPMori-Regular.otf
Binary file not shown.
Binary file removed public/fonts/THICCCBOI-Bold.woff2
Binary file not shown.
Binary file removed public/fonts/THICCCBOI-Medium.woff2
Binary file not shown.
Binary file removed public/fonts/THICCCBOI-Regular.woff2
Binary file not shown.
Binary file removed public/fonts/THICCCBOI-SemiBold.woff2
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-Black.woff
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-Bold.woff
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-ExtraBold.woff
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-ExtraLight.woff
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-ExtraLight.woff2
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-Light.woff
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-Light.woff2
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-Medium.woff
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-Regular.woff
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-SemiBold.woff
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-Thin.woff
Binary file not shown.
Binary file removed public/fonts/delight/Web-TT/Delight-Thin.woff2
Binary file not shown.
24 changes: 6 additions & 18 deletions src/app/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,47 @@
/* Delight Font Family */
@font-face {
font-family: "Delight";
src:
url("/fonts/delight/Web-TT/Delight-Regular.woff2") format("woff2"),
url("/fonts/delight/Web-TT/Delight-Regular.woff") format("woff");
src: url("/fonts/delight/Web-TT/Delight-Regular.woff2") format("woff2");
font-weight: 400;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Delight";
src:
url("/fonts/delight/Web-TT/Delight-Medium.woff2") format("woff2"),
url("/fonts/delight/Web-TT/Delight-Medium.woff") format("woff");
src: url("/fonts/delight/Web-TT/Delight-Medium.woff2") format("woff2");
font-weight: 500;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Delight";
src:
url("/fonts/delight/Web-TT/Delight-SemiBold.woff2") format("woff2"),
url("/fonts/delight/Web-TT/Delight-SemiBold.woff") format("woff");
src: url("/fonts/delight/Web-TT/Delight-SemiBold.woff2") format("woff2");
font-weight: 600;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Delight";
src:
url("/fonts/delight/Web-TT/Delight-Bold.woff2") format("woff2"),
url("/fonts/delight/Web-TT/Delight-Bold.woff") format("woff");
src: url("/fonts/delight/Web-TT/Delight-Bold.woff2") format("woff2");
font-weight: 700;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Delight";
src:
url("/fonts/delight/Web-TT/Delight-ExtraBold.woff2") format("woff2"),
url("/fonts/delight/Web-TT/Delight-ExtraBold.woff") format("woff");
src: url("/fonts/delight/Web-TT/Delight-ExtraBold.woff2") format("woff2");
font-weight: 800;
font-style: normal;
font-display: swap;
}

@font-face {
font-family: "Delight";
src:
url("/fonts/delight/Web-TT/Delight-Black.woff2") format("woff2"),
url("/fonts/delight/Web-TT/Delight-Black.woff") format("woff");
src: url("/fonts/delight/Web-TT/Delight-Black.woff2") format("woff2");
font-weight: 900;
font-style: normal;
font-display: swap;
Expand Down
2 changes: 1 addition & 1 deletion src/components/helpers/network-toggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import type { NexusNetwork } from "@avail-project/nexus-core";
import { useEffect, useState } from "react";

import { useAnalytics } from "@/hooks/use-analytics";
import { NETWORK_KEY } from "@/lib/constants";
import { getItem, setItem } from "@/lib/local-storage";
import { NETWORK_KEY } from "@/providers/Web3Provider";
import { useNexus } from "../nexus/NexusProvider";
import {
Select,
Expand Down
7 changes: 7 additions & 0 deletions src/components/mdx/themed-image.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ export function ThemedImage({
light,
dark,
alt,
priority = false,
}: {
light: string;
dark: string;
alt: string;
/** Set to true for hero/above-fold images to avoid delaying LCP */
priority?: boolean;
}) {
const dialogRef = useRef<HTMLDialogElement>(null);

Expand All @@ -26,6 +29,8 @@ export function ThemedImage({
<img
src={light}
alt={alt}
loading={priority ? "eager" : "lazy"}
decoding={priority ? "sync" : "async"}
className="w-full border border-border rounded-md"
/>
</button>
Expand All @@ -38,6 +43,8 @@ export function ThemedImage({
<img
src={dark}
alt={alt}
loading={priority ? "eager" : "lazy"}
decoding={priority ? "sync" : "async"}
className="w-full border border-border rounded-md"
/>
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/showcase/showcase-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { Check, X } from "@phosphor-icons/react";
import type React from "react";
import { useEffect, useState } from "react";
import { NETWORK_KEY } from "@/lib/constants";
import { getItem } from "@/lib/local-storage";
import { NETWORK_KEY } from "@/providers/Web3Provider";
import NetworkToggle from "../helpers/network-toggle";
import { PreviewPanel } from "../helpers/preview-panel";
import { Toggle } from "../ui/toggle";
Expand Down
2 changes: 1 addition & 1 deletion src/hooks/use-posthog-identify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ import {
track,
unsetSuperProperties,
} from "@/lib/analytics/posthog";
import { NETWORK_KEY } from "@/lib/constants";
import { getItem } from "@/lib/local-storage";
import { NETWORK_KEY } from "@/providers/Web3Provider";

/**
* Hash a wallet address using SHA-256 for privacy-preserving identification
Expand Down
2 changes: 2 additions & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** localStorage key for the Nexus network selection (mainnet/testnet) */
export const NETWORK_KEY = "nexus-elements-network-key";
7 changes: 6 additions & 1 deletion src/providers/PostHogProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@ interface PostHogProviderProps {
*/
export function PostHogProvider({ children }: PostHogProviderProps) {
useEffect(() => {
initPostHog();
// Defer PostHog init until browser is idle to avoid competing with hydration
if ("requestIdleCallback" in window) {
requestIdleCallback(() => initPostHog());
} else {
setTimeout(() => initPostHog(), 2000);
}
}, []);

// Don't wrap with provider if PostHog is not configured
Expand Down
2 changes: 1 addition & 1 deletion src/providers/Web3Provider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
import { PostHogIdentify } from "@/components/analytics/PostHogIdentify";
import NexusProvider from "@/components/nexus/NexusProvider";
import { Skeleton } from "@/components/ui/skeleton";
import { NETWORK_KEY } from "@/lib/constants";
import { getItem, setItem } from "@/lib/local-storage";

const hyperEVM = defineChain({
Expand Down Expand Up @@ -128,7 +129,6 @@ const defaultConfig = getDefaultConfig({
});

const wagmiConfig = createConfig(defaultConfig);
export const NETWORK_KEY = "nexus-elements-network-key";

function NexusContainer({ children }: Readonly<{ children: React.ReactNode }>) {
const [network, setNetwork] = useState<NexusNetwork>("mainnet");
Expand Down
22 changes: 22 additions & 0 deletions vercel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"headers": [
{
"source": "/fonts/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
},
{
"source": "/img/(.*)",
"headers": [
{
"key": "Cache-Control",
"value": "public, max-age=31536000, immutable"
}
]
}
]
}