mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Merge branch 'hamster1963:main' into main
This commit is contained in:
commit
53b5b33f53
@ -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,16 +65,18 @@ export default async function LocaleLayout({
|
||||
fontSans.variable,
|
||||
)}
|
||||
>
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
{children}
|
||||
</NextIntlClientProvider>
|
||||
</ThemeProvider>
|
||||
<MotionProvider>
|
||||
<ThemeProvider
|
||||
attribute="class"
|
||||
defaultTheme="system"
|
||||
enableSystem
|
||||
disableTransitionOnChange
|
||||
>
|
||||
<NextIntlClientProvider messages={messages}>
|
||||
{children}
|
||||
</NextIntlClientProvider>
|
||||
</ThemeProvider>
|
||||
</MotionProvider>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
@ -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={{
|
||||
|
@ -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={{
|
||||
|
1
components/motion/framer-lazy-feature.ts
Normal file
1
components/motion/framer-lazy-feature.ts
Normal file
@ -0,0 +1 @@
|
||||
export { domMax as default } from "framer-motion";
|
14
components/motion/motion-provider.tsx
Normal file
14
components/motion/motion-provider.tsx
Normal 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>
|
||||
);
|
||||
};
|
@ -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",
|
||||
|
Loading…
Reference in New Issue
Block a user