Skip to content

Commit

Permalink
Make sure commit sha is rendered in the last column
Browse files Browse the repository at this point in the history
  • Loading branch information
cesarvarela committed Apr 9, 2024
1 parent bd21bd3 commit cb8cbb4
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 cb8cbb4

Please sign in to comment.