Commit d2e00dd1 authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Merge pull request #1183 from blockscout/footer-front-commit

add front commit link
parents 7b8bcdf5 7a655af2
...@@ -25,6 +25,7 @@ import getApiVersionUrl from './utils/getApiVersionUrl'; ...@@ -25,6 +25,7 @@ import getApiVersionUrl from './utils/getApiVersionUrl';
const MAX_LINKS_COLUMNS = 3; const MAX_LINKS_COLUMNS = 3;
const FRONT_VERSION_URL = `https://github.com/blockscout/frontend/tree/${ config.UI.footer.frontendVersion }`; const FRONT_VERSION_URL = `https://github.com/blockscout/frontend/tree/${ config.UI.footer.frontendVersion }`;
const FRONT_COMMIT_URL = `https://github.com/blockscout/frontend/commit/${ config.UI.footer.frontendCommit }`;
const Footer = () => { const Footer = () => {
...@@ -74,6 +75,18 @@ const Footer = () => { ...@@ -74,6 +75,18 @@ const Footer = () => {
}, },
]; ];
const frontendLink = (() => {
if (config.UI.footer.frontendVersion) {
return <Link href={ FRONT_VERSION_URL } target="_blank">{ config.UI.footer.frontendVersion }</Link>;
}
if (config.UI.footer.frontendCommit) {
return <Link href={ FRONT_COMMIT_URL } target="_blank">{ config.UI.footer.frontendCommit }</Link>;
}
return null;
})();
const fetch = useFetch(); const fetch = useFetch();
const { isLoading, data: linksData } = useQuery<unknown, ResourceError<unknown>, Array<CustomLinksGroup>>( const { isLoading, data: linksData } = useQuery<unknown, ResourceError<unknown>, Array<CustomLinksGroup>>(
...@@ -111,9 +124,9 @@ const Footer = () => { ...@@ -111,9 +124,9 @@ const Footer = () => {
Backend: <Link href={ apiVersionUrl } target="_blank">{ backendVersionData?.backend_version }</Link> Backend: <Link href={ apiVersionUrl } target="_blank">{ backendVersionData?.backend_version }</Link>
</Text> </Text>
) } ) }
{ (config.UI.footer.frontendVersion || config.UI.footer.frontendCommit) && ( { frontendLink && (
<Text fontSize="xs"> <Text fontSize="xs">
Frontend: <Link href={ FRONT_VERSION_URL } target="_blank">{ config.UI.footer.frontendVersion }</Link> Frontend: { frontendLink }
</Text> </Text>
) } ) }
</VStack> </VStack>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment