Compare commits

..

4 Commits

Author SHA1 Message Date
hamster1963
fb226a6af9 update: v1.2.7 2024-11-08 11:22:28 +08:00
hamster1963
af7556c42a Merge branch 'main' into cloudflare 2024-11-08 11:21:59 +08:00
hamster1963
6a8e14e9bc chore(deps): bump next.js version to 15.0.3 2024-11-08 11:21:43 +08:00
hamster1963
4116e12237 perf: use LazyMotion 2024-11-08 11:21:19 +08:00
7 changed files with 34 additions and 16 deletions

View File

@ -1,4 +1,5 @@
// @auto-i18n-check. Please do not delete the line. // @auto-i18n-check. Please do not delete the line.
import { MotionProvider } from "@/components/motion/motion-provider";
import getEnv from "@/lib/env-entry"; import getEnv from "@/lib/env-entry";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import "@/styles/globals.css"; import "@/styles/globals.css";
@ -64,6 +65,7 @@ export default async function LocaleLayout({
fontSans.variable, fontSans.variable,
)} )}
> >
<MotionProvider>
<ThemeProvider <ThemeProvider
attribute="class" attribute="class"
defaultTheme="system" defaultTheme="system"
@ -74,6 +76,7 @@ export default async function LocaleLayout({
{children} {children}
</NextIntlClientProvider> </NextIntlClientProvider>
</ThemeProvider> </ThemeProvider>
</MotionProvider>
</body> </body>
</html> </html>
); );

BIN
bun.lockb

Binary file not shown.

View File

@ -1,7 +1,7 @@
"use client"; "use client";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { motion } from "framer-motion"; import { m } from "framer-motion";
import { useTranslations } from "next-intl"; import { useTranslations } from "next-intl";
import React, { createRef, useEffect, useRef } from "react"; import React, { createRef, useEffect, useRef } from "react";
@ -74,7 +74,7 @@ export default function Switch({
)} )}
> >
{nowTag === tag && ( {nowTag === tag && (
<motion.div <m.div
layoutId="nav-item" layoutId="nav-item"
className="absolute inset-0 z-10 h-full w-full content-center bg-white shadow-lg shadow-black/5 dark:bg-stone-700 dark:shadow-white/5" className="absolute inset-0 z-10 h-full w-full content-center bg-white shadow-lg shadow-black/5 dark:bg-stone-700 dark:shadow-white/5"
style={{ style={{

View File

@ -1,7 +1,7 @@
"use client"; "use client";
import { cn } from "@/lib/utils"; import { cn } from "@/lib/utils";
import { motion } from "framer-motion"; import { m } from "framer-motion";
import { useTranslations } from "next-intl"; import { useTranslations } from "next-intl";
import React from "react"; import React from "react";
@ -30,7 +30,7 @@ export default function TabSwitch({
)} )}
> >
{currentTab === tab && ( {currentTab === tab && (
<motion.div <m.div
layoutId="tab-switch" layoutId="tab-switch"
className="absolute inset-0 z-10 h-full w-full content-center bg-white shadow-lg shadow-black/5 dark:bg-stone-700 dark:shadow-white/5" className="absolute inset-0 z-10 h-full w-full content-center bg-white shadow-lg shadow-black/5 dark:bg-stone-700 dark:shadow-white/5"
style={{ style={{

View File

@ -0,0 +1 @@
export { domMax as default } from "framer-motion";

View File

@ -0,0 +1,14 @@
"use client";
import { LazyMotion } from "framer-motion";
const loadFeatures = () =>
import("./framer-lazy-feature").then((res) => res.default);
export const MotionProvider = ({ children }: { children: React.ReactNode }) => {
return (
<LazyMotion features={loadFeatures} strict key="framer">
{children}
</LazyMotion>
);
};

View File

@ -1,6 +1,6 @@
{ {
"name": "nezha-dash", "name": "nezha-dash",
"version": "1.2.6", "version": "1.2.7",
"private": true, "private": true,
"scripts": { "scripts": {
"dev": "next dev -p 3020", "dev": "next dev -p 3020",
@ -32,7 +32,7 @@
"framer-motion": "^12.0.0-alpha.1", "framer-motion": "^12.0.0-alpha.1",
"lucide-react": "^0.454.0", "lucide-react": "^0.454.0",
"luxon": "^3.5.0", "luxon": "^3.5.0",
"next": "^15.0.2", "next": "^15.0.3",
"next-auth": "^5.0.0-beta.25", "next-auth": "^5.0.0-beta.25",
"next-intl": "^3.24.0", "next-intl": "^3.24.0",
"next-runtime-env": "^3.2.2", "next-runtime-env": "^3.2.2",