Skip to content

Commit

Permalink
Merge pull request blockscout#1183 from blockscout/footer-front-commit
Browse files Browse the repository at this point in the history
add front commit link
  • Loading branch information
isstuev authored Sep 19, 2023
2 parents 7b8bcdf + 7a655af commit d2e00dd
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions ui/snippets/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import getApiVersionUrl from './utils/getApiVersionUrl';
const MAX_LINKS_COLUMNS = 3;

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 = () => {

Expand Down Expand Up @@ -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 { isLoading, data: linksData } = useQuery<unknown, ResourceError<unknown>, Array<CustomLinksGroup>>(
Expand Down Expand Up @@ -111,9 +124,9 @@ const Footer = () => {
Backend: <Link href={ apiVersionUrl } target="_blank">{ backendVersionData?.backend_version }</Link>
</Text>
) }
{ (config.UI.footer.frontendVersion || config.UI.footer.frontendCommit) && (
{ frontendLink && (
<Text fontSize="xs">
Frontend: <Link href={ FRONT_VERSION_URL } target="_blank">{ config.UI.footer.frontendVersion }</Link>
Frontend: { frontendLink }
</Text>
) }
</VStack>
Expand Down

0 comments on commit d2e00dd

Please sign in to comment.