diff --git a/apps/blogai/app/[locale]/page.tsx b/apps/blogai/app/[locale]/page.tsx index 9e8c065..aae3da3 100644 --- a/apps/blogai/app/[locale]/page.tsx +++ b/apps/blogai/app/[locale]/page.tsx @@ -123,6 +123,29 @@ export default async function ChatIndexPage({ params: { locale } }: { params: { const avatarUrl = session?.user?.image const id = nanoid() + return ( + <> + {/* */} + + + + + + + {/* */} + > + + + ) +} + + + +function ChatIndexPage_bak({ params: { locale } }: { params: { locale: string } }) { + const session = await auth() + const avatarUrl = session?.user?.image + const id = nanoid() + return ( <> {/* */} diff --git a/apps/blogai/components/footer.tsx b/apps/blogai/components/footer.tsx index d0f698a..e4539c3 100644 --- a/apps/blogai/components/footer.tsx +++ b/apps/blogai/components/footer.tsx @@ -66,9 +66,7 @@ export function Footer({ className, ...props }: React.ComponentProps<'p'>) { const onFinish = async (values: any) => { console.log('Finish:', values); - if (isLoading) return - setIsLoading(true); await service.post('/api/v1/customer/subscribe', { "first_name": values.first_name, @@ -84,28 +82,20 @@ export function Footer({ className, ...props }: React.ComponentProps<'p'>) { // 'Authorization': token } }).then(function (result: any) { - setTimeout(() => { setIsLoading(false); setIsSubscribe(true) }, 800); console.log("result:", result) - if (result && result.header.code != 0) { - toast.error(result.header.message) return } - toast.success(t('footer.subscribe_success')) - }).catch((err) => { setIsLoading(false); console.log(err); - }); - - }; const [userData, setUserData] = useLocalStorage( @@ -153,47 +143,13 @@ export function Footer({ className, ...props }: React.ComponentProps<'p'>) { }; } }, []); - - - // const isWindow = typeof window !== "undefined" - - // //console.log("isWindow ", isWindow) - - // const [windowSize, setWindowSize] = useState({ - // windowWidth: window.innerWidth, - // windowHeight: window.innerHeight - // }); - - // useEffect(() => { - - // if (isWindow) { - // const handleResize = () => { - - // console.log(window.innerWidth, window.innerHeight) - // setWindowSize({ - // windowWidth: window.innerWidth, - // windowHeight: window.innerHeight - // }); - // }; - - // window.addEventListener('resize', handleResize); - - // return () => { - // window.removeEventListener('resize', handleResize); - // }; - // } - - // }, []); - return ( - {/* */} {/* */} - {t("footer.h3")} {!userData.auth_token ? @@ -308,7 +264,6 @@ export function Footer({ className, ...props }: React.ComponentProps<'p'>) { -