diff --git a/apps/user/app/(main)/page.tsx b/apps/user/app/(main)/page.tsx index 45ee755..dbee382 100644 --- a/apps/user/app/(main)/page.tsx +++ b/apps/user/app/(main)/page.tsx @@ -10,7 +10,6 @@ import { redirect } from 'next/navigation'; import FooterCopyright from '@/components/main/FooterCopyright'; import FullScreenVideoBackground from '@/components/main/FullScreenVideoBackground'; import HomeContent from '@/components/main/HomeContent'; -import Image from 'next/image'; export default async function Home() { const Authorization = (await cookies()).get('Authorization')?.value; @@ -39,14 +38,6 @@ export default async function Home() { - logo ); } diff --git a/apps/user/app/auth/EmailAuthDialog/EmailAuthDialog.tsx b/apps/user/app/auth/EmailAuthDialog/EmailAuthDialog.tsx new file mode 100644 index 0000000..3f9e5f0 --- /dev/null +++ b/apps/user/app/auth/EmailAuthDialog/EmailAuthDialog.tsx @@ -0,0 +1,40 @@ +import EmailAuthForm from '@/app/auth/email/auth-form'; +import CloseSvg from '@/components/CustomIcon/icons/close.svg'; +import { Dialog, DialogContent, DialogTitle } from '@workspace/ui/components/dialog'; +import Image from 'next/image'; +import { forwardRef, useImperativeHandle, useState } from 'react'; + +export interface EmailAuthDialogRef { + show: () => void; + hide: () => void; +} + +const EmailAuthDialog = forwardRef((props, ref) => { + const [open, setOpen] = useState(false); + + useImperativeHandle(ref, () => ({ + show: () => setOpen(true), + hide: () => setOpen(false), + })); + + return ( + + } + closeClassName={ + 'right-[40px] top-[30px] font-bold text-black opacity-100 focus:ring-0 focus:ring-offset-0' + } + > + title +
+ +
+
+
+ ); +}); + +export default EmailAuthDialog; diff --git a/apps/user/app/auth/page.tsx b/apps/user/app/auth/auth-page.tsx similarity index 100% rename from apps/user/app/auth/page.tsx rename to apps/user/app/auth/auth-page.tsx diff --git a/apps/user/app/auth/email/login-form.tsx b/apps/user/app/auth/email/login-form.tsx index ece2a19..4bda980 100644 --- a/apps/user/app/auth/email/login-form.tsx +++ b/apps/user/app/auth/email/login-form.tsx @@ -49,15 +49,21 @@ export default function LoginForm({ return ( <> +
账户验证
- + ( - + - + @@ -67,9 +73,14 @@ export default function LoginForm({ control={form.control} name='password' render={({ field }) => ( - + - + @@ -80,7 +91,7 @@ export default function LoginForm({ control={form.control} name='cf_token' render={({ field }) => ( - + @@ -89,27 +100,39 @@ export default function LoginForm({ )} /> )} - +
+ + +
+ +
+ +
-
- - -
); } diff --git a/apps/user/app/auth/email/register-form.tsx b/apps/user/app/auth/email/register-form.tsx index fba20ce..14bf83a 100644 --- a/apps/user/app/auth/email/register-form.tsx +++ b/apps/user/app/auth/email/register-form.tsx @@ -87,132 +87,156 @@ export default function RegisterForm({ return ( <> +
注册账户
+ {auth.register.stop_register ? ( {t('message')} ) : (
- - ( - - - - - - - )} - /> - ( - - - - - - - )} - /> - ( - - - - - - - )} - /> - {auth.email.enable_verify && ( + +
( -
- - -
+
)} /> - )} - ( - - - - - - - )} - /> - {verify.enable_register_verify && ( ( - + )} /> - )} - + ( + + + + + + + )} + /> + {auth.email.enable_verify && ( + ( + + +
+ + +
+
+ +
+ )} + /> + )} + ( + + + + + + + )} + /> + {verify.enable_register_verify && ( + ( + + + + + + + )} + /> + )} +
+ +
+ {t('existingAccount')}  + +
+
+ +
)} -
- {t('existingAccount')}  - -
); } diff --git a/apps/user/app/auth/email/reset-form.tsx b/apps/user/app/auth/email/reset-form.tsx index c5bc9c2..887c563 100644 --- a/apps/user/app/auth/email/reset-form.tsx +++ b/apps/user/app/auth/email/reset-form.tsx @@ -54,92 +54,112 @@ export default function ResetForm({ return ( <> +
找回账户
- - ( - - - - - - - )} - /> - ( - - -
- - -
-
- -
- )} - /> - ( - - - - - - - )} - /> - {verify.enable_reset_password_verify && ( + +
( - + )} /> - )} - + ( + + +
+ + +
+
+ +
+ )} + /> + ( + + + + + + + )} + /> + {verify.enable_reset_password_verify && ( + ( + + + + + + + )} + /> + )} +
+
+ {t('existingAccount')}  + +
+
+ +
-
- {t('existingAccount')}  - -
); } diff --git a/apps/user/app/auth/send-code.tsx b/apps/user/app/auth/send-code.tsx index a9e426d..fcdf987 100644 --- a/apps/user/app/auth/send-code.tsx +++ b/apps/user/app/auth/send-code.tsx @@ -81,7 +81,14 @@ export default function SendCode({ type, params }: SendCodeProps) { (type === 'email' ? !params.email : !params.telephone || !params.telephone_area_code); return ( - ); diff --git a/apps/user/app/bind/[platform]/certification.tsx b/apps/user/app/bind/[platform]/certification.tsx index 7c43d8f..f572d2d 100644 --- a/apps/user/app/bind/[platform]/certification.tsx +++ b/apps/user/app/bind/[platform]/certification.tsx @@ -25,7 +25,7 @@ export default function Certification({ platform, children }: CertificationProps router.refresh(); }) .catch((error) => { - router.replace('/auth'); + router.replace('/'); }); }, [pathname]); diff --git a/apps/user/app/oauth/[platform]/certification.tsx b/apps/user/app/oauth/[platform]/certification.tsx index 5bc0748..b3366ff 100644 --- a/apps/user/app/oauth/[platform]/certification.tsx +++ b/apps/user/app/oauth/[platform]/certification.tsx @@ -30,7 +30,7 @@ export default function Certification({ platform, children }: CertificationProps router.refresh(); }) .catch((error) => { - router.replace('/auth'); + router.replace('/'); }); }, [pathname]); diff --git a/apps/user/components/CustomIcon/icons/close.svg b/apps/user/components/CustomIcon/icons/close.svg new file mode 100644 index 0000000..4bea31a --- /dev/null +++ b/apps/user/components/CustomIcon/icons/close.svg @@ -0,0 +1,3 @@ + + + diff --git a/apps/user/components/Header/NewHeader.tsx b/apps/user/components/Header/NewHeader.tsx index 1f8a8fc..4a2569d 100644 --- a/apps/user/components/Header/NewHeader.tsx +++ b/apps/user/components/Header/NewHeader.tsx @@ -8,44 +8,56 @@ import Image from 'next/legacy/image'; import Link from 'next/link'; import LanguageSwitch from '../language-switch'; // import ThemeSwitch from '../theme-switch'; +import EmailAuthDialog, { EmailAuthDialogRef } from '@/app/auth/EmailAuthDialog/EmailAuthDialog'; +import { useRef } from 'react'; import { UserNav } from '../user-nav'; import ImageLogo from './image.png'; -export default function Header() { +export default function Header(props) { const t = useTranslations('common'); const { user } = useGlobalStore(); const Logo = ( - - logo + + logo ); + + const dialogRef = useRef(null); + return ( -
-
- -
- - {/**/} - - {!user && ( - +
+
+
+ +
+ + {/**/} + + {!user && ( + dialogRef.current?.show()} + className={cn( + buttonVariants({ + size: 'lg', + variant: 'outline', + }), + 'h-full rounded-[50px] border-0 border-[#0F2C53] bg-[#0F2C53] px-5 text-xl font-bold text-white transition hover:bg-[#225BA9] hover:text-white md:px-14 md:text-2xl', + )} + > + {t('login')} + )} - > - {t('login')} - - )} +
+
-
-
+ + {/* 登录注册弹窗 */} + + ); } diff --git a/apps/user/components/Header/header.tsx b/apps/user/components/Header/header.tsx index 19ab244..658df64 100644 --- a/apps/user/components/Header/header.tsx +++ b/apps/user/components/Header/header.tsx @@ -34,7 +34,7 @@ export default function Header() { {!user && ( -
- {site.site_name} © All rights reserved. -
- - {t('tos')} - - - {t('privacyPolicy')} - +
+ logo +
+ {site.site_name} © All rights reserved. +
+ + {t('tos')} + + + {t('privacyPolicy')} + +
diff --git a/apps/user/components/main/HomeContent.tsx b/apps/user/components/main/HomeContent.tsx index fe0ad8b..6ccca2d 100644 --- a/apps/user/components/main/HomeContent.tsx +++ b/apps/user/components/main/HomeContent.tsx @@ -1,10 +1,16 @@ +'use client'; + import { Button } from '@workspace/ui/components/button'; +import { useRef } from 'react'; +import OfferDialog, { OfferDialogRef } from './OfferDialog/index'; export default function HomeContent() { + const dialogRef = useRef(null); + return (
{/* 大标题 */} -

+

连接
任何时间 @@ -12,19 +18,24 @@ export default function HomeContent() { 任何地点

{/* 副标题 */} -
-

- +

+

+ AiroPort 提供极稳,极简,极速的网络服务

-

获取订阅地址,开始顶级的私密网络体验

+

获取订阅地址,开始顶级的私密网络体验

{/* 按钮 */} - + +
); } diff --git a/apps/user/components/main/OfferDialog/index.tsx b/apps/user/components/main/OfferDialog/index.tsx new file mode 100644 index 0000000..bbba377 --- /dev/null +++ b/apps/user/components/main/OfferDialog/index.tsx @@ -0,0 +1,39 @@ +import CloseSvg from '@/components/CustomIcon/icons/close.svg'; +import { Dialog, DialogContent, DialogTitle } from '@workspace/ui/components/dialog'; +import Image from 'next/image'; +import { forwardRef, useImperativeHandle, useState } from 'react'; + +export interface OfferDialogRef { + show: () => void; + hide: () => void; +} + +const OfferDialog = forwardRef((props, ref) => { + const [open, setOpen] = useState(false); + + useImperativeHandle(ref, () => ({ + show: () => setOpen(true), + hide: () => setOpen(false), + })); + + return ( + + } + closeClassName={ + 'right-[40px] top-[30px] font-bold text-black opacity-100 focus:ring-0 focus:ring-offset-0' + } + > + + 选择套餐 + +
套餐内容
+
+
+ ); +}); + +export default OfferDialog; diff --git a/apps/user/components/main/hero.tsx b/apps/user/components/main/hero.tsx index e4ebdf7..7ab7bf4 100644 --- a/apps/user/components/main/hero.tsx +++ b/apps/user/components/main/hero.tsx @@ -38,7 +38,7 @@ export function Hero() { className='*:text-muted-foreground mb-8 max-w-xl' /> )} - + , React.ComponentPropsWithoutRef ->(({ className, children, ...props }, ref) => ( +>(({ className, closeClassName, closeIcon, children, ...props }, ref) => ( {children} - - + + {closeIcon || } Close