add publish script and work on registery pages

This commit is contained in:
2023-07-24 12:52:58 +03:30
parent 14b13e1309
commit a9929e8a09
8 changed files with 68 additions and 23 deletions

View File

@@ -1,4 +1,5 @@
import theme from "@/core/utils/theme";
import useLanguage from "@/lib/app/hooks/useLanguage";
import useLoading from "@/lib/app/hooks/useLoading";
import useUser from "@/lib/app/hooks/useUser";
import Head from "next/head";
@@ -6,11 +7,17 @@ import NextNProgress from "nextjs-progressbar";
import { useEffect } from "react";
function AppLayout({ children, isBot }) {
const { languageIsReady } = useLanguage();
const { setLoadingPage } = useLoading();
const { token, isAuth } = useUser();
const { userChangedLanguage, token, isAuth } = useUser();
useEffect(() => {
if (languageIsReady) {
if (token) {
if (isAuth) {
if (userChangedLanguage) {
setLoadingPage(true);
return;
}
setLoadingPage(false);
return;
}
@@ -19,7 +26,14 @@ function AppLayout({ children, isBot }) {
}
setLoadingPage(false);
return;
}, [token, isAuth]);
}
setLoadingPage(true);
}, [languageIsReady, token, isAuth, userChangedLanguage]);
if (!isBot) {
if (userChangedLanguage) return;
if (!languageIsReady) return;
}
return (
<>

View File

@@ -10,9 +10,6 @@ export default function ProfileData() {
alt="User Image"
src={user.user_avatar}
/>
<Typography sx={{ fontSize: 15, fontWeight: 600 }} textAlign="center">
{user.user_username}
</Typography>
</Stack>
);
}