This commit is contained in:
hailin 2025-03-14 16:28:48 +08:00
parent c092d938bc
commit 02cc043f33
2 changed files with 23 additions and 45 deletions

View File

@ -123,6 +123,29 @@ export default async function ChatIndexPage({ params: { locale } }: { params: {
const avatarUrl = session?.user?.image
const id = nanoid()
return (
<>
{/* <Web3Provider> */}
<Header />
<div className=' '>
<Article />
</div>
<Footer />
{/* </Web3Provider> */}
</>
)
}
function ChatIndexPage_bak({ params: { locale } }: { params: { locale: string } }) {
const session = await auth()
const avatarUrl = session?.user?.image
const id = nanoid()
return (
<>
{/* <Web3Provider> */}

View File

@ -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<WindowSize>({
// 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 (
<Container as="footer" className="bg-secondary w-full max-w-full py-20">
{/* <MobileLinks className="lg:hidden" />
<DesktopLinks className="hidden lg:flex" /> */}
<FadeIn>
<div className='lg:max-w-[1440px] mx-auto lg:px-20 lg:flex items-stretch justify-between'>
{/* <div></div> */}
<div id='subscribe-target' className='gap-2 xl:gap-6 lg:gap-4 w-full'>
<h3 className='text-left text-2xl font-bold py-4'>{t("footer.h3")}</h3>
{!userData.auth_token ?
@ -308,7 +264,6 @@ export function Footer({ className, ...props }: React.ComponentProps<'p'>) {
</div>
</div>
<div className=" flex items-end justify-end lg:justify-between">
<LanguageChanger />
</div >