Skip to content

Commit

Permalink
perf: nextui 迁移到 heroui
Browse files Browse the repository at this point in the history
  • Loading branch information
baiwumm committed Jan 17, 2025
1 parent 3b0a965 commit d9a8f7f
Show file tree
Hide file tree
Showing 42 changed files with 2,474 additions and 2,474 deletions.
2 changes: 1 addition & 1 deletion .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
public-hoist-pattern[]=*@nextui-org/*
public-hoist-pattern[]=*@heroui/*
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@hookform/resolvers": "^3.9.1",
"@iconify/react": "^5.2.0",
"@internationalized/date": "^3.6.0",
"@nextui-org/react": "^2.6.11",
"@heroui/react": "2.6.13",
"@prisma/client": "^6.2.1",
"@radix-ui/react-collapsible": "^1.1.1",
"@radix-ui/react-dialog": "^1.1.4",
Expand Down Expand Up @@ -83,4 +83,4 @@
"prettier --write"
]
}
}
}
2,342 changes: 1,171 additions & 1,171 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @LastEditTime: 2025-01-08 14:39:23
* @Description: 关于
*/
import { Alert, Card, CardBody, CardHeader, Chip, Divider } from '@nextui-org/react';
import { Alert, Card, CardBody, CardHeader, Chip, Divider } from '@heroui/react';
import { useTranslations } from 'next-intl';

import pkg from '../../../package.json';
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/components/GithubCommit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import 'dayjs/locale/zh-cn';

import { Icon } from '@iconify/react';
import { Avatar, Chip, cn, Listbox, ListboxItem, Tooltip } from '@nextui-org/react';
import { Avatar, Chip, cn, Listbox, ListboxItem, Tooltip } from '@heroui/react';
import { useRequest } from 'ahooks';
import dayjs from 'dayjs';
import relativeTime from 'dayjs/plugin/relativeTime';
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/components/JuejinArticle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'use client';

import { Icon } from '@iconify/react';
import { Chip, cn, Pagination, User } from '@nextui-org/react';
import { Chip, cn, Pagination, User } from '@heroui/react';
import { useRequest } from 'ahooks';
import dayjs from 'dayjs';
import { useTranslations } from 'next-intl';
Expand Down
4 changes: 2 additions & 2 deletions src/app/dashboard/components/PageViewCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
* @Description: 访问量
*/
import { Icon } from '@iconify/react';
import { cn } from '@nextui-org/react';
import { Card, CardBody, CardFooter, CardHeader } from '@nextui-org/react';
import { cn } from '@heroui/react';
import { Card, CardBody, CardFooter, CardHeader } from '@heroui/react';
import { useMount, useSetState } from 'ahooks';
import dayjs from 'dayjs';
import { useTranslations } from 'next-intl';
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/components/PaymentNumberCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Description: 支付笔数
*/
import { Icon } from '@iconify/react';
import { Card, CardBody, CardFooter, CardHeader } from '@nextui-org/react';
import { Card, CardBody, CardFooter, CardHeader } from '@heroui/react';
import { useMount, useSetState } from 'ahooks';
import dayjs from 'dayjs';
import { useTranslations } from 'next-intl';
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/components/SaleCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
'use client';
import { Icon } from '@iconify/react';
import { Card, CardBody, CardFooter, CardHeader, Divider } from '@nextui-org/react';
import { Card, CardBody, CardFooter, CardHeader, Divider } from '@heroui/react';
import { useMount, useSetState } from 'ahooks';
import { useTranslations } from 'next-intl';
import { ReactNode, useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/app/dashboard/components/SatisfactionCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Description: 客户满意度
*/
import { Icon } from '@iconify/react';
import { Card, CardBody, CardFooter, CardHeader } from '@nextui-org/react';
import { Card, CardBody, CardFooter, CardHeader } from '@heroui/react';
import { useMount, useSetState } from 'ahooks';
import dayjs from 'dayjs';
import { useTranslations } from 'next-intl';
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/captcha/components/PointCaptcha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @LastEditTime: 2025-01-08 15:40:20
* @Description: 点选验证码
*/
import { Alert, Button } from '@nextui-org/react';
import { Alert, Button } from '@heroui/react';
import { useMount, useSetState } from 'ahooks';
import { FC, type MouseEvent, RefObject, useImperativeHandle, useRef } from 'react';

Expand Down
2 changes: 1 addition & 1 deletion src/app/features/captcha/components/RotateCaptcha.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* @Description: 图片旋转验证码
*/
import { Icon } from '@iconify/react';
import { cn, Image } from '@nextui-org/react';
import { cn, Image } from '@heroui/react';
import { useMount, useSetState } from 'ahooks';
import dayjs from 'dayjs';
import { CSSProperties, FC, type MouseEventHandler, RefObject, useImperativeHandle, useRef } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/captcha/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
'use client';

import { Button, Card, CardBody, CardFooter, CardHeader, Divider, Input } from '@nextui-org/react';
import { Button, Card, CardBody, CardFooter, CardHeader, Divider, Input } from '@heroui/react';
import { useMount } from 'ahooks';
import { useTranslations } from 'next-intl';
import { createRef, useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/app/features/viewer/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
'use client';

import { Card, CardBody, CardHeader, Divider, Image, Link } from '@nextui-org/react';
import { Card, CardBody, CardHeader, Divider, Image, Link } from '@heroui/react';
import { useMount } from 'ahooks';
import dynamic from 'next/dynamic';
import { useTranslations } from 'next-intl';
Expand Down
102 changes: 51 additions & 51 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,51 +1,51 @@
/*
* @Author: 白雾茫茫丶<baiwumm.com>
* @Date: 2024-12-06 10:05:33
* @LastEditors: 白雾茫茫丶<baiwumm.com>
* @LastEditTime: 2025-01-03 17:09:47
* @Description: 布局文件
*/
import './globals.scss';

import { NextUIProvider } from '@nextui-org/react';
import type { Metadata } from 'next';
import { NextIntlClientProvider } from 'next-intl';
import { getLocale, getMessages } from 'next-intl/server';

import UmamiAnalytics from '@/components/Analytics/UmamiAnalytics'; // Umami Analytics
import FullLoading from '@/components/FullLoading'; // 全局 Loading
import GlobalLayout from '@/components/GlobalLayout'; // 全局布局
import ThemeProvider from '@/components/ThemeProvider';
import { Toaster } from '@/components/ui/sonner';

export const metadata: Metadata = {
title: process.env.NEXT_PUBLIC_PROJECT_NAME,
description: process.env.NEXT_PUBLIC_PROJECT_DESC,
};

export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const locale = await getLocale();
const messages = await getMessages();
return (
<html lang={locale} suppressHydrationWarning>
{/* umami - 站点统计分析 */}
<UmamiAnalytics />
<body>
<NextUIProvider>
<NextIntlClientProvider messages={messages}>
<ThemeProvider attribute="class" defaultTheme="light">
{/* 全局 Loading */}
<FullLoading />
<GlobalLayout>{children}</GlobalLayout>
</ThemeProvider>
</NextIntlClientProvider>
<Toaster position="top-center" />
</NextUIProvider>
</body>
</html>
);
}
/*
* @Author: 白雾茫茫丶<baiwumm.com>
* @Date: 2024-12-06 10:05:33
* @LastEditors: 白雾茫茫丶<baiwumm.com>
* @LastEditTime: 2025-01-03 17:09:47
* @Description: 布局文件
*/
import './globals.scss';

import { HeroUIProvider } from '@heroui/react';
import type { Metadata } from 'next';
import { NextIntlClientProvider } from 'next-intl';
import { getLocale, getMessages } from 'next-intl/server';

import UmamiAnalytics from '@/components/Analytics/UmamiAnalytics'; // Umami Analytics
import FullLoading from '@/components/FullLoading'; // 全局 Loading
import GlobalLayout from '@/components/GlobalLayout'; // 全局布局
import ThemeProvider from '@/components/ThemeProvider';
import { Toaster } from '@/components/ui/sonner';

export const metadata: Metadata = {
title: process.env.NEXT_PUBLIC_PROJECT_NAME,
description: process.env.NEXT_PUBLIC_PROJECT_DESC,
};

export default async function RootLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {
const locale = await getLocale();
const messages = await getMessages();
return (
<html lang={locale} suppressHydrationWarning>
{/* umami - 站点统计分析 */}
<UmamiAnalytics />
<body>
<HeroUIProvider>
<NextIntlClientProvider messages={messages}>
<ThemeProvider attribute="class" defaultTheme="light">
{/* 全局 Loading */}
<FullLoading />
<GlobalLayout>{children}</GlobalLayout>
</ThemeProvider>
</NextIntlClientProvider>
<Toaster position="top-center" />
</HeroUIProvider>
</body>
</html>
);
}
2 changes: 1 addition & 1 deletion src/app/loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @LastEditTime: 2024-12-19 16:31:39
* @Description: 页面 Loading
*/
import { Spinner } from '@nextui-org/react';
import { Spinner } from '@heroui/react';

export default function Loading() {
return (
Expand Down
2 changes: 1 addition & 1 deletion src/app/login/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Description: 登录页
*/
import { Icon } from '@iconify/react';
import { Button, Card, CardBody, CardHeader, Divider, User } from '@nextui-org/react';
import { Button, Card, CardBody, CardHeader, Divider, User } from '@heroui/react';

import { signIn } from '@/auth';

Expand Down
2 changes: 1 addition & 1 deletion src/app/not-found.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Description: 404页面
*/

import { Button } from '@nextui-org/react';
import { Button } from '@heroui/react';
import Link from 'next/link';

export default function NotFound() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
import { Icon } from '@iconify/react';
import { parseDate } from '@internationalized/date';
import { Button, DateRangePicker, Input, Spinner } from '@nextui-org/react';
import { Button, DateRangePicker, Input, Spinner } from '@heroui/react';
import { SetState } from 'ahooks/es/useSetState';
import dayjs from 'dayjs';
import { useTranslations } from 'next-intl';
Expand Down
2 changes: 1 addition & 1 deletion src/app/system-manage/menu-manage/components/SaveModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {
ModalHeader,
Select,
SelectItem,
} from '@nextui-org/react';
} from '@heroui/react';
import { useRequest } from 'ahooks';
import { SetState } from 'ahooks/es/useSetState';
import { useTranslations } from 'next-intl';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import {
TableColumn,
TableHeader,
TableRow,
} from '@nextui-org/react';
} from '@heroui/react';
import dayjs from 'dayjs';
import { useTranslations } from 'next-intl';
import { Key, ReactNode, useCallback, useMemo } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/app/system-manage/menu-manage/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
'use client';

import { Icon } from '@iconify/react';
import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, useDisclosure } from '@nextui-org/react';
import { Button, Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, useDisclosure } from '@heroui/react';
import { useRequest, useSetState } from 'ahooks';
import { useTranslations } from 'next-intl';
import { useState } from 'react';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* @Description: 顶部搜索
*/
import { Icon } from '@iconify/react';
import { Button, Input, Spinner } from '@nextui-org/react';
import { Button, Input, Spinner } from '@heroui/react';
import { SetState } from 'ahooks/es/useSetState';
import { useTranslations } from 'next-intl';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import {
TableHeader,
TableRow,
User,
} from '@nextui-org/react';
} from '@heroui/react';
import dayjs from 'dayjs';
import { useTranslations } from 'next-intl';
import { Key, ReactNode, useCallback, useMemo, useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/components/BackTop/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
'use client';

import { CircularProgress, Tooltip } from '@nextui-org/react';
import { CircularProgress, Tooltip } from '@heroui/react';
import { useMount } from 'ahooks';
import { useMotionValueEvent, useScroll } from 'framer-motion';
import { useTranslations } from 'next-intl';
Expand Down
2 changes: 1 addition & 1 deletion src/components/ContentLoading/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @LastEditTime: 2024-12-20 17:03:06
* @Description: 内容盒子 Loading
*/
import { Spinner } from '@nextui-org/react';
import { Spinner } from '@heroui/react';

type ContentLoadingProps = {
loading: boolean;
Expand Down
2 changes: 1 addition & 1 deletion src/components/FullScreen/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
'use client';
import { Icon } from '@iconify/react';
import { Button, cn, Tooltip } from '@nextui-org/react';
import { Button, cn, Tooltip } from '@heroui/react';
import { useFullscreen } from 'ahooks';
import { useTranslations } from 'next-intl';

Expand Down
2 changes: 1 addition & 1 deletion src/components/GlobalFooter/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
'use client';
import { Icon } from '@iconify/react';
import { Button, Image, Link, Spacer, Tooltip } from '@nextui-org/react';
import { Button, Image, Link, Spacer, Tooltip } from '@heroui/react';
import { useTranslations } from 'next-intl';

export default function GlobalFooter() {
Expand Down
4 changes: 2 additions & 2 deletions src/components/GlobalHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
*/
'use client';

import { BreadcrumbItem, Breadcrumbs } from '@nextui-org/react';
import { Divider } from '@nextui-org/react';
import { BreadcrumbItem, Breadcrumbs } from '@heroui/react';
import { Divider } from '@heroui/react';
import { useSelectedLayoutSegments } from 'next/navigation';
import { useTranslations } from 'next-intl';

Expand Down
2 changes: 1 addition & 1 deletion src/components/LangSwitch/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
'use client';

import { Button, cn, Tooltip } from '@nextui-org/react';
import { Button, cn, Tooltip } from '@heroui/react';
import { useLocale } from 'next-intl';
import { useTranslations } from 'next-intl';

Expand Down
2 changes: 1 addition & 1 deletion src/components/Multitab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @LastEditTime: 2025-01-16 17:36:15
* @Description: 多标签页
*/
import { Tab, Tabs } from '@nextui-org/react';
import { Tab, Tabs } from '@heroui/react';
import { usePathname, useRouter } from 'next/navigation';
import { useTranslations } from 'next-intl';
import { useEffect, useState } from 'react';
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavUser/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
'use client';
import { Icon } from '@iconify/react';
import { Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Spinner, User } from '@nextui-org/react';
import { Dropdown, DropdownItem, DropdownMenu, DropdownTrigger, Spinner, User } from '@heroui/react';
import { signOut, useSession } from 'next-auth/react';
import { useTranslations } from 'next-intl';

Expand Down
2 changes: 1 addition & 1 deletion src/components/ThemeModeButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/
'use client';
import { Icon } from '@iconify/react';
import { Tooltip } from '@nextui-org/react';
import { Tooltip } from '@heroui/react';
import { useTranslations } from 'next-intl';
import { useTheme } from 'next-themes';
import { MouseEventHandler } from 'react';
Expand Down
Loading

0 comments on commit d9a8f7f

Please sign in to comment.