add frontent build date
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"buildTime": null
|
||||||
|
}
|
||||||
@@ -306,6 +306,15 @@
|
|||||||
width: var(--side-bar-width);
|
width: var(--side-bar-width);
|
||||||
transform: translateX(0);
|
transform: translateX(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.build-versions {
|
||||||
|
position: absolute;
|
||||||
|
/* margin-top: 20px;
|
||||||
|
margin-left: 5px; */
|
||||||
|
bottom: 10px;
|
||||||
|
left: 10px;
|
||||||
|
color: #fffc;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar-close-button {
|
.sidebar-close-button {
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { useRef } from 'react';
|
|||||||
import { useClickOutside } from '@/app/hooks/useClickOutside';
|
import { useClickOutside } from '@/app/hooks/useClickOutside';
|
||||||
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
|
import { fetchReferralUserStats } from '@/app/actions/referralsActions';
|
||||||
import { useQuery } from '@tanstack/react-query';
|
import { useQuery } from '@tanstack/react-query';
|
||||||
|
import { env } from 'process';
|
||||||
|
|
||||||
export default function NavLinks() {
|
export default function NavLinks() {
|
||||||
const {
|
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 pathname = usePathname().replace('/en/', '/').replace('/ru/', '/');
|
||||||
const t = useTranslations('Global');
|
const t = useTranslations('Global');
|
||||||
|
|
||||||
@@ -133,6 +158,17 @@ export default function NavLinks() {
|
|||||||
<p className="">{t('exit')}</p>
|
<p className="">{t('exit')}</p>
|
||||||
</Link>
|
</Link>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
<div className="build-versions">
|
||||||
|
{!frontendBuildDate && (
|
||||||
|
<div className="">
|
||||||
|
front: {frontendBuildDate}
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
{/* <div>
|
||||||
|
back:
|
||||||
|
</div> */}
|
||||||
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user