Compare commits

..

3 Commits

Author SHA1 Message Date
hamster1963
2ab1fc7710 update: v1.2.7 2024-11-08 11:22:50 +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.
import { MotionProvider } from "@/components/motion/motion-provider";
import getEnv from "@/lib/env-entry";
import { cn } from "@/lib/utils";
import "@/styles/globals.css";
@ -64,6 +65,7 @@ export default async function LocaleLayout({
fontSans.variable,
)}
>
<MotionProvider>
<ThemeProvider
attribute="class"
defaultTheme="system"
@ -74,6 +76,7 @@ export default async function LocaleLayout({
{children}
</NextIntlClientProvider>
</ThemeProvider>
</MotionProvider>
</body>
</html>
);

BIN
bun.lockb

Binary file not shown.

View File

@ -1,7 +1,7 @@
"use client";
import { cn } from "@/lib/utils";
import { motion } from "framer-motion";
import { m } from "framer-motion";
import { useTranslations } from "next-intl";
import React, { createRef, useEffect, useRef } from "react";
@ -74,7 +74,7 @@ export default function Switch({
)}
>
{nowTag === tag && (
<motion.div
<m.div
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"
style={{

View File

@ -1,7 +1,7 @@
"use client";
import { cn } from "@/lib/utils";
import { motion } from "framer-motion";
import { m } from "framer-motion";
import { useTranslations } from "next-intl";
import React from "react";
@ -30,7 +30,7 @@ export default function TabSwitch({
)}
>
{currentTab === tab && (
<motion.div
<m.div
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"
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",
"version": "1.2.6",
"version": "1.2.7",
"private": true,
"scripts": {
"dev": "next dev -p 3020",
@ -32,7 +32,7 @@
"framer-motion": "^12.0.0-alpha.1",
"lucide-react": "^0.454.0",
"luxon": "^3.5.0",
"next": "^15.0.2",
"next": "^15.0.3",
"next-auth": "^5.0.0-beta.25",
"next-intl": "^3.24.0",
"next-runtime-env": "^3.2.2",