add frontent build date

This commit is contained in:
smanylov
2026-02-11 20:47:40 +07:00
parent 74579fa53e
commit 953f2f22a9
4 changed files with 49 additions and 1 deletions
+3
View File
@@ -0,0 +1,3 @@
{
"buildTime": null
}
+1 -1
View File
@@ -1,7 +1,7 @@
import { QueryClient } from '@tanstack/react-query';
import { getUserData, getUserFilesInfo } from '@/app/actions/action';
import { getUserFilesData } from '@/app/actions/fileEntity';
import {fetchReferralUserStats} from '@/app/actions/referralsActions';
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
export async function prefetchLayoutQueries(queryClient: QueryClient) {
await Promise.all([
+9
View File
@@ -306,6 +306,15 @@
width: var(--side-bar-width);
transform: translateX(0);
}
.build-versions {
position: absolute;
/* margin-top: 20px;
margin-left: 5px; */
bottom: 10px;
left: 10px;
color: #fffc;
}
}
.sidebar-close-button {
+36
View File
@@ -13,6 +13,7 @@ import { useRef } from 'react';
import { useClickOutside } from '@/app/hooks/useClickOutside';
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
import { useQuery } from '@tanstack/react-query';
import { env } from 'process';
export default function NavLinks() {
const {
@@ -34,6 +35,30 @@ export default function NavLinks() {
}
});
const {
data: frontendBuildDate,
} = useQuery({
queryKey: ['frontendBuildDate'],
queryFn: async () => {
try {
const response = await fetch('/build-info.json');
if (!response.ok) {
return null;
}
return response.json();
} catch (error) {
return null;
}
},
select: (data) => {
if (data?.buildTime) {
return data.buildTime;
}
return null;
},
retry: false // Не повторять запрос при ошибке
});
const pathname = usePathname().replace('/en/', '/').replace('/ru/', '/');
const t = useTranslations('Global');
@@ -133,6 +158,17 @@ export default function NavLinks() {
<p className="">{t('exit')}</p>
</Link>
</ul>
<div className="build-versions">
{!frontendBuildDate && (
<div className="">
front: {frontendBuildDate}
</div>
)}
{/* <div>
back:
</div> */}
</div>
</nav>
);
}