Skip to content

Commit

Permalink
Merge pull request #2722 from aiidtest/fix-commit-position
Browse files Browse the repository at this point in the history
Make sure commit sha is rendered in the last column
  • Loading branch information
kepae authored Apr 10, 2024
2 parents d478684 + cb8cbb4 commit 3af30a8
Showing 1 changed file with 16 additions and 7 deletions.
23 changes: 16 additions & 7 deletions site/gatsby-site/src/components/layout/Footer.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ import config from '../../../config';
import { LocalizedLink } from 'plugins/gatsby-theme-i18n';
import { Trans, useTranslation } from 'react-i18next';

function CommitSHA() {
return (
<div className="text-muted-gray text-xs" data-cy="commit-sha">
{process.env.GATSBY_COMMIT_SHA.toString().substring(0, 7)}
</div>
);
}

export default function Footer() {
const data = useStaticQuery(graphql`
query FooterQuery {
Expand Down Expand Up @@ -204,13 +212,13 @@ export default function Footer() {
</div>
)}

{i == footerContent.length - 1 && process.env.GATSBY_COMMIT_SHA && (
<li>
<div className="text-muted-gray text-xs" data-cy="commit-sha">
{process.env.GATSBY_COMMIT_SHA.toString().substring(0, 7)}
</div>
</li>
)}
{i == footerContent.length - 1 &&
allPrismicFooter.edges.length > 0 &&
process.env.GATSBY_COMMIT_SHA && (
<li>
<CommitSHA />
</li>
)}
</ul>
</div>
);
Expand Down Expand Up @@ -298,6 +306,7 @@ export default function Footer() {
/>
</a>
</div>
<CommitSHA />
</div>
)}
</footer>
Expand Down

0 comments on commit 3af30a8

Please sign in to comment.