This commit is contained in:
parent
c092d938bc
commit
02cc043f33
|
|
@ -123,6 +123,29 @@ export default async function ChatIndexPage({ params: { locale } }: { params: {
|
||||||
const avatarUrl = session?.user?.image
|
const avatarUrl = session?.user?.image
|
||||||
const id = nanoid()
|
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 (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* <Web3Provider> */}
|
{/* <Web3Provider> */}
|
||||||
|
|
|
||||||
|
|
@ -66,9 +66,7 @@ export function Footer({ className, ...props }: React.ComponentProps<'p'>) {
|
||||||
|
|
||||||
const onFinish = async (values: any) => {
|
const onFinish = async (values: any) => {
|
||||||
console.log('Finish:', values);
|
console.log('Finish:', values);
|
||||||
|
|
||||||
if (isLoading) return
|
if (isLoading) return
|
||||||
|
|
||||||
setIsLoading(true);
|
setIsLoading(true);
|
||||||
await service.post('/api/v1/customer/subscribe', {
|
await service.post('/api/v1/customer/subscribe', {
|
||||||
"first_name": values.first_name,
|
"first_name": values.first_name,
|
||||||
|
|
@ -84,28 +82,20 @@ export function Footer({ className, ...props }: React.ComponentProps<'p'>) {
|
||||||
// 'Authorization': token
|
// 'Authorization': token
|
||||||
}
|
}
|
||||||
}).then(function (result: any) {
|
}).then(function (result: any) {
|
||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
setIsSubscribe(true)
|
setIsSubscribe(true)
|
||||||
}, 800);
|
}, 800);
|
||||||
console.log("result:", result)
|
console.log("result:", result)
|
||||||
|
|
||||||
if (result && result.header.code != 0) {
|
if (result && result.header.code != 0) {
|
||||||
|
|
||||||
toast.error(result.header.message)
|
toast.error(result.header.message)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
toast.success(t('footer.subscribe_success'))
|
toast.success(t('footer.subscribe_success'))
|
||||||
|
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
setIsLoading(false);
|
setIsLoading(false);
|
||||||
console.log(err);
|
console.log(err);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const [userData, setUserData] = useLocalStorage(
|
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 (
|
return (
|
||||||
<Container as="footer" className="bg-secondary w-full max-w-full py-20">
|
<Container as="footer" className="bg-secondary w-full max-w-full py-20">
|
||||||
|
|
||||||
{/* <MobileLinks className="lg:hidden" />
|
{/* <MobileLinks className="lg:hidden" />
|
||||||
<DesktopLinks className="hidden lg:flex" /> */}
|
<DesktopLinks className="hidden lg:flex" /> */}
|
||||||
<FadeIn>
|
<FadeIn>
|
||||||
<div className='lg:max-w-[1440px] mx-auto lg:px-20 lg:flex items-stretch justify-between'>
|
<div className='lg:max-w-[1440px] mx-auto lg:px-20 lg:flex items-stretch justify-between'>
|
||||||
{/* <div></div> */}
|
{/* <div></div> */}
|
||||||
|
|
||||||
<div id='subscribe-target' className='gap-2 xl:gap-6 lg:gap-4 w-full'>
|
<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>
|
<h3 className='text-left text-2xl font-bold py-4'>{t("footer.h3")}</h3>
|
||||||
{!userData.auth_token ?
|
{!userData.auth_token ?
|
||||||
|
|
@ -308,7 +264,6 @@ export function Footer({ className, ...props }: React.ComponentProps<'p'>) {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div className=" flex items-end justify-end lg:justify-between">
|
<div className=" flex items-end justify-end lg:justify-between">
|
||||||
<LanguageChanger />
|
<LanguageChanger />
|
||||||
</div >
|
</div >
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue