Skip to content

Commit

Permalink
feat: shows version in the navbar and hash in the footer
Browse files Browse the repository at this point in the history
  • Loading branch information
claymcleod committed Jan 31, 2021
1 parent 262a5be commit ce2e1f7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 11 deletions.
13 changes: 12 additions & 1 deletion src/components/docs/doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,19 @@ class BaseLayout extends Component {
</main>
<footer className="my-10 flex flex-col items-center justify-center">
<div>
© {new Date().getFullYear()} St. Jude Children's Research Hospital
© {new Date().getFullYear()} St. Jude Children's Research Hospital.
</div>
{process.env.GATSBY_DOCS_HASH && (
<div>
{` `}Built from{` `}
<Link
to={`https://github.com/stjudecloud/university/commit/${process.env.GATSBY_DOCS_HASH}`}
>
{process.env.GATSBY_DOCS_HASH}
</Link>
.
</div>
)}
<div>
Questions?{" "}
<a href="mailto:support@stjude.cloud">support@stjude.cloud</a>
Expand Down
35 changes: 25 additions & 10 deletions src/components/navbar/MenuBlockRight.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@ import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import { faGithub } from "@fortawesome/free-brands-svg-icons"
import Menu from "../../images/icons/menu.svg"
import { PropTypes } from "prop-types"
import { Link } from "gatsby"

const MenuBlockRight = ({ enableGitHub = true, enableMenu = false }) => {
const docsVersion = process.env.GATSBY_DOCS_VERSION

return (
<div className="flex flex-1 items-center justify-end">
<div
Expand All @@ -14,16 +17,28 @@ const MenuBlockRight = ({ enableGitHub = true, enableMenu = false }) => {
style={{ marginRight: "10px" }}
>
{enableGitHub && (
<a
href="https://github.com/stjudecloud/university"
className="text-white cursor-pointer"
style={{ paddingRight: "10px" }}
>
<FontAwesomeIcon
icon={faGithub}
style={{ width: "35px", height: "35px" }}
/>
</a>
<div className="flex items-between">
<a
href="https://github.com/stjudecloud/university"
className="text-white cursor-pointer"
style={{ paddingRight: "10px" }}
>
<FontAwesomeIcon
icon={faGithub}
style={{ width: "35px", height: "35px" }}
className="hover:opacity-80"
/>
{docsVersion && (
<div className="flex items-center text-xs font-bold mt-0.5 hover:opacity-80">
<Link
to={`https://github.com/stjudecloud/university/releases/tag/${docsVersion}`}
>
{docsVersion}
</Link>
</div>
)}
</a>
</div>
)}
</div>
{enableMenu && (
Expand Down

1 comment on commit ce2e1f7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.