mirror of
https://github.com/perfect-panel/ppanel-web.git
synced 2026-02-16 05:11:10 -05:00
♻️ refactor: Update dependencies and improve code consistency across multiple files
This commit is contained in:
parent
973c06f0fa
commit
e37ae49960
@ -93,7 +93,7 @@ export default function PaymentTable() {
|
|||||||
{
|
{
|
||||||
accessorKey: 'platform',
|
accessorKey: 'platform',
|
||||||
header: t('platform'),
|
header: t('platform'),
|
||||||
cell: ({ row }) => <Badge>{t(row.getValue('platform'))}</Badge>,
|
cell: ({ row }) => <Badge>{t(row.original.platform)}</Badge>,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
accessorKey: 'notify_url',
|
accessorKey: 'notify_url',
|
||||||
|
|||||||
@ -10,35 +10,35 @@
|
|||||||
"start": "next start"
|
"start": "next start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@lottiefiles/dotlottie-react": "^0.12.1",
|
"@lottiefiles/dotlottie-react": "^0.15.1",
|
||||||
"@tanstack/react-query": "^5.63.0",
|
"@tanstack/react-query": "^5.85.5",
|
||||||
"@tanstack/react-query-next-experimental": "^5.63.0",
|
"@tanstack/react-query-next-experimental": "^5.85.5",
|
||||||
"@workspace/ui": "workspace:*",
|
"@workspace/ui": "workspace:*",
|
||||||
"ahooks": "^3.8.4",
|
"ahooks": "^3.9.4",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.11.0",
|
||||||
"js-yaml": "^4.1.0",
|
"js-yaml": "^4.1.0",
|
||||||
"nanoid": "^5.0.9",
|
"nanoid": "^5.1.5",
|
||||||
"next": "^15.1.4",
|
"next": "^15.5.2",
|
||||||
"next-intl": "^3.26.3",
|
"next-intl": "^3.26.3",
|
||||||
"next-runtime-env": "^3.2.2",
|
"next-runtime-env": "^3.3.0",
|
||||||
"next-themes": "^0.4.4",
|
"next-themes": "^0.4.6",
|
||||||
"nextjs-toploader": "^3.7.15",
|
"nextjs-toploader": "^3.8.16",
|
||||||
"radash": "^12.1.0",
|
"radash": "^12.1.1",
|
||||||
"react": "^19.0.0",
|
"react": "^19.1.1",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.1.1",
|
||||||
"react-turnstile": "^1.1.4",
|
"react-turnstile": "^1.1.4",
|
||||||
"universal-cookie": "^7.2.2",
|
"universal-cookie": "^8.0.1",
|
||||||
"zustand": "^5.0.3"
|
"zustand": "^5.0.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/js-yaml": "^4.0.9",
|
"@types/js-yaml": "^4.0.9",
|
||||||
"@types/node": "^22.10.5",
|
"@types/node": "^24.3.0",
|
||||||
"@types/react": "^19.0.4",
|
"@types/react": "^19.1.11",
|
||||||
"@types/react-dom": "^19.0.2",
|
"@types/react-dom": "^19.1.8",
|
||||||
"@types/rtl-detect": "^1.0.3",
|
"@types/rtl-detect": "^1.0.3",
|
||||||
"@workspace/eslint-config": "workspace:*",
|
"@workspace/eslint-config": "workspace:*",
|
||||||
"@workspace/typescript-config": "workspace:*",
|
"@workspace/typescript-config": "workspace:*",
|
||||||
"typescript": "^5.7.3"
|
"typescript": "^5.9.2"
|
||||||
},
|
},
|
||||||
"i18n": {
|
"i18n": {
|
||||||
"entry": "./locales/en-US",
|
"entry": "./locales/en-US",
|
||||||
|
|||||||
@ -65,7 +65,7 @@ function MobileBindDialog({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Dialog open={open} onOpenChange={setOpen}>
|
<Dialog open={open} onOpenChange={setOpen}>
|
||||||
<DialogTrigger>{children}</DialogTrigger>
|
<DialogTrigger asChild>{children}</DialogTrigger>
|
||||||
<DialogContent className='sm:max-w-[425px]'>
|
<DialogContent className='sm:max-w-[425px]'>
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>{t('bindMobile')}</DialogTitle>
|
<DialogTitle>{t('bindMobile')}</DialogTitle>
|
||||||
|
|||||||
@ -61,7 +61,7 @@ export default function Page() {
|
|||||||
</div>
|
</div>
|
||||||
</CardContent>
|
</CardContent>
|
||||||
</Card>
|
</Card>
|
||||||
<ProList<API.UserBalanceLog, Record<string, unknown>>
|
<ProList<API.BalanceLog, Record<string, unknown>>
|
||||||
action={ref}
|
action={ref}
|
||||||
request={async (pagination, filter) => {
|
request={async (pagination, filter) => {
|
||||||
const response = await queryUserBalanceLog({ ...pagination, ...filter });
|
const response = await queryUserBalanceLog({ ...pagination, ...filter });
|
||||||
@ -77,7 +77,7 @@ export default function Page() {
|
|||||||
<ul className='grid grid-cols-2 gap-3 *:flex *:flex-col lg:grid-cols-4'>
|
<ul className='grid grid-cols-2 gap-3 *:flex *:flex-col lg:grid-cols-4'>
|
||||||
<li className='font-semibold'>
|
<li className='font-semibold'>
|
||||||
<span className='text-muted-foreground'>{t('createdAt')}</span>
|
<span className='text-muted-foreground'>{t('createdAt')}</span>
|
||||||
<time>{formatDate(item.created_at)}</time>
|
<time>{formatDate(item.timestamp)}</time>
|
||||||
</li>
|
</li>
|
||||||
<li className='font-semibold'>
|
<li className='font-semibold'>
|
||||||
<span className='text-muted-foreground'>{t('type.0')}</span>
|
<span className='text-muted-foreground'>{t('type.0')}</span>
|
||||||
|
|||||||
@ -86,7 +86,7 @@ export default function Content({ subscription }: { subscription?: API.Subscribe
|
|||||||
console.log(error);
|
console.log(error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}, [params, router, subscription?.id]);
|
}, [params, router]);
|
||||||
|
|
||||||
if (!subscription) {
|
if (!subscription) {
|
||||||
return <div className='p-6 text-center'>{t('subscriptionNotFound')}</div>;
|
return <div className='p-6 text-center'>{t('subscriptionNotFound')}</div>;
|
||||||
|
|||||||
@ -27,6 +27,7 @@ export default function Certification({ platform, children }: CertificationProps
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
router.replace('/auth');
|
router.replace('/auth');
|
||||||
});
|
});
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [pathname]);
|
}, [pathname]);
|
||||||
|
|
||||||
return children;
|
return children;
|
||||||
|
|||||||
@ -8,20 +8,20 @@ import { NextIntlClientProvider } from 'next-intl';
|
|||||||
import { getLocale, getMessages } from 'next-intl/server';
|
import { getLocale, getMessages } from 'next-intl/server';
|
||||||
import { PublicEnvScript } from 'next-runtime-env';
|
import { PublicEnvScript } from 'next-runtime-env';
|
||||||
import { unstable_noStore as noStore } from 'next/cache';
|
import { unstable_noStore as noStore } from 'next/cache';
|
||||||
// import { Geist, Geist_Mono } from 'next/font/google';
|
// import { Geist, Geist_Mono } from "next/font/google";
|
||||||
import { cookies } from 'next/headers';
|
import { cookies } from 'next/headers';
|
||||||
import { Metadata, Viewport } from 'next/types';
|
import { Metadata, Viewport } from 'next/types';
|
||||||
import NextTopLoader from 'nextjs-toploader';
|
import NextTopLoader from 'nextjs-toploader';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
// const fontSans = Geist({
|
// const geistSans = Geist({
|
||||||
// subsets: ['latin'],
|
// variable: "--font-geist-sans",
|
||||||
// variable: '--font-sans',
|
// subsets: ["latin"],
|
||||||
// });
|
// });
|
||||||
|
|
||||||
// const fontMono = Geist_Mono({
|
// const geistMono = Geist_Mono({
|
||||||
// subsets: ['latin'],
|
// variable: "--font-geist-mono",
|
||||||
// variable: '--font-mono',
|
// subsets: ["latin"],
|
||||||
// });
|
// });
|
||||||
|
|
||||||
export async function generateMetadata(): Promise<Metadata> {
|
export async function generateMetadata(): Promise<Metadata> {
|
||||||
@ -106,7 +106,7 @@ export default async function RootLayout({
|
|||||||
</head>
|
</head>
|
||||||
<body
|
<body
|
||||||
suppressHydrationWarning
|
suppressHydrationWarning
|
||||||
// ${fontSans.variable} ${fontMono.variable}
|
// ${geistSans.variable} ${geistMono.variable}
|
||||||
className={`size-full min-h-[calc(100dvh-env(safe-area-inset-top))] font-sans antialiased`}
|
className={`size-full min-h-[calc(100dvh-env(safe-area-inset-top))] font-sans antialiased`}
|
||||||
>
|
>
|
||||||
<NextIntlClientProvider messages={messages}>
|
<NextIntlClientProvider messages={messages}>
|
||||||
|
|||||||
@ -32,6 +32,7 @@ export default function Certification({ platform, children }: CertificationProps
|
|||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
router.replace('/auth');
|
router.replace('/auth');
|
||||||
});
|
});
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [pathname]);
|
}, [pathname]);
|
||||||
|
|
||||||
return children;
|
return children;
|
||||||
|
|||||||
@ -8,7 +8,7 @@ interface SubscribeBillingProps {
|
|||||||
order?: Partial<
|
order?: Partial<
|
||||||
API.OrderDetail & {
|
API.OrderDetail & {
|
||||||
unit_price: number;
|
unit_price: number;
|
||||||
unit_time: number;
|
unit_time: string;
|
||||||
subscribe_discount: number;
|
subscribe_discount: number;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|||||||
@ -10,41 +10,41 @@
|
|||||||
"start": "next start"
|
"start": "next start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@stripe/react-stripe-js": "^3.4.0",
|
"@stripe/react-stripe-js": "^3.9.2",
|
||||||
"@stripe/stripe-js": "^6.0.0",
|
"@stripe/stripe-js": "^7.9.0",
|
||||||
"@tanstack/react-query": "^5.63.0",
|
"@tanstack/react-query": "^5.85.5",
|
||||||
"@tanstack/react-query-next-experimental": "^5.63.0",
|
"@tanstack/react-query-next-experimental": "^5.85.5",
|
||||||
"@workspace/ui": "workspace:*",
|
"@workspace/ui": "workspace:*",
|
||||||
"ahooks": "^3.8.4",
|
"ahooks": "^3.9.4",
|
||||||
"axios": "^1.7.9",
|
"axios": "^1.11.0",
|
||||||
"framer-motion": "^11.16.1",
|
"framer-motion": "^12.23.12",
|
||||||
"gray-matter": "^4.0.3",
|
"gray-matter": "^4.0.3",
|
||||||
"lucide-react": "^0.469.0",
|
"lucide-react": "^0.542.0",
|
||||||
"next": "^15.1.4",
|
"next": "^15.5.2",
|
||||||
"next-intl": "^3.26.3",
|
"next-intl": "^3.26.3",
|
||||||
"next-runtime-env": "^3.2.2",
|
"next-runtime-env": "^3.3.0",
|
||||||
"next-themes": "^0.4.4",
|
"next-themes": "^0.4.6",
|
||||||
"nextjs-toploader": "^3.7.15",
|
"nextjs-toploader": "^3.8.16",
|
||||||
"qrcode.react": "^4.2.0",
|
"qrcode.react": "^4.2.0",
|
||||||
"radash": "^12.1.0",
|
"radash": "^12.1.1",
|
||||||
"react": "^19.0.0",
|
"react": "^19.1.1",
|
||||||
"react-copy-to-clipboard": "^5.1.0",
|
"react-copy-to-clipboard": "^5.1.0",
|
||||||
"react-dom": "^19.0.0",
|
"react-dom": "^19.1.1",
|
||||||
"react-turnstile": "^1.1.4",
|
"react-turnstile": "^1.1.4",
|
||||||
"rtl-detect": "^1.1.2",
|
"rtl-detect": "^1.1.2",
|
||||||
"ua-parser-js": "^2.0.0",
|
"ua-parser-js": "^2.0.4",
|
||||||
"universal-cookie": "^7.2.2",
|
"universal-cookie": "^8.0.1",
|
||||||
"zustand": "^5.0.3"
|
"zustand": "^5.0.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^22.10.5",
|
"@types/node": "^24.3.0",
|
||||||
"@types/react": "^19.0.4",
|
"@types/react": "^19.1.11",
|
||||||
"@types/react-copy-to-clipboard": "^5.0.7",
|
"@types/react-copy-to-clipboard": "^5.0.7",
|
||||||
"@types/react-dom": "^19.0.2",
|
"@types/react-dom": "^19.1.8",
|
||||||
"@types/rtl-detect": "^1.0.3",
|
"@types/rtl-detect": "^1.0.3",
|
||||||
"@workspace/eslint-config": "workspace:*",
|
"@workspace/eslint-config": "workspace:*",
|
||||||
"@workspace/typescript-config": "workspace:*",
|
"@workspace/typescript-config": "workspace:*",
|
||||||
"typescript": "^5.7.3"
|
"typescript": "^5.9.2"
|
||||||
},
|
},
|
||||||
"i18n": {
|
"i18n": {
|
||||||
"entry": "./locales/en-US",
|
"entry": "./locales/en-US",
|
||||||
|
|||||||
10
package.json
10
package.json
@ -48,18 +48,18 @@
|
|||||||
},
|
},
|
||||||
"prettier": "@workspace/prettier-config",
|
"prettier": "@workspace/prettier-config",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@netlify/plugin-nextjs": "^5.11.6",
|
"@netlify/plugin-nextjs": "^5.12.1",
|
||||||
"@umijs/openapi": "^1.13.0",
|
"@umijs/openapi": "^1.13.15",
|
||||||
"@workspace/commitlint-config": "workspace:*",
|
"@workspace/commitlint-config": "workspace:*",
|
||||||
"@workspace/eslint-config": "workspace:*",
|
"@workspace/eslint-config": "workspace:*",
|
||||||
"@workspace/prettier-config": "workspace:*",
|
"@workspace/prettier-config": "workspace:*",
|
||||||
"@workspace/typescript-config": "workspace:*",
|
"@workspace/typescript-config": "workspace:*",
|
||||||
"husky": "^9.1.7",
|
"husky": "^9.1.7",
|
||||||
"lint-staged": "^15.3.0",
|
"lint-staged": "^16.1.5",
|
||||||
"semantic-release": "21.1.2",
|
"semantic-release": "21.1.2",
|
||||||
"semantic-release-config-gitmoji": "^1.5.3",
|
"semantic-release-config-gitmoji": "^1.5.3",
|
||||||
"turbo": "^2.3.3",
|
"turbo": "^2.5.6",
|
||||||
"typescript": "^5.7.3"
|
"typescript": "^5.9.2"
|
||||||
},
|
},
|
||||||
"packageManager": "bun@1.1.43",
|
"packageManager": "bun@1.1.43",
|
||||||
"engines": {
|
"engines": {
|
||||||
|
|||||||
@ -30,7 +30,7 @@ import { ColumnToggle } from '@workspace/ui/custom-components/pro-table/column-t
|
|||||||
import { Pagination } from '@workspace/ui/custom-components/pro-table/pagination';
|
import { Pagination } from '@workspace/ui/custom-components/pro-table/pagination';
|
||||||
import { SortableRow } from '@workspace/ui/custom-components/pro-table/sortable-row';
|
import { SortableRow } from '@workspace/ui/custom-components/pro-table/sortable-row';
|
||||||
import { ProTableWrapper } from '@workspace/ui/custom-components/pro-table/wrapper';
|
import { ProTableWrapper } from '@workspace/ui/custom-components/pro-table/wrapper';
|
||||||
import { cn } from '@workspace/ui/lib/utils.js';
|
import { cn } from '@workspace/ui/lib/utils';
|
||||||
import { useSize } from 'ahooks';
|
import { useSize } from 'ahooks';
|
||||||
import { GripVertical, ListRestart, Loader, RefreshCcw } from 'lucide-react';
|
import { GripVertical, ListRestart, Loader, RefreshCcw } from 'lucide-react';
|
||||||
import React, { Fragment, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
import React, { Fragment, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user