mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
Compare commits
4 Commits
f9b798c406
...
fb226a6af9
Author | SHA1 | Date | |
---|---|---|---|
|
fb226a6af9 | ||
|
af7556c42a | ||
|
6a8e14e9bc | ||
|
4116e12237 |
@ -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>
|
||||||
);
|
);
|
||||||
|
@ -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={{
|
||||||
|
@ -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={{
|
||||||
|
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",
|
"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",
|
||||||
|
Loading…
Reference in New Issue
Block a user