add frontent build date
This commit is contained in:
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"buildTime": null
|
||||
}
|
||||
@@ -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([
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user