Skip to content

Commit

Permalink
[ADD] version tag name on footer site
Browse files Browse the repository at this point in the history
  • Loading branch information
vgeruso committed Sep 11, 2024
1 parent f58447f commit 2388b2e
Showing 1 changed file with 27 additions and 2 deletions.
29 changes: 27 additions & 2 deletions src/components/Footer/index.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
import React, { FC, useState } from "react";
import React, { FC, useEffect, useState } from "react";

import { ContainerDark } from "./styles";

import GitHub from '../../assets/gh.svg';
import BlueSky from '../../assets/bsky.svg';
import LinkedIn from '../../assets/linkedin.svg';
import { useYear } from "../../hooks/useYear";
import { graphql, useStaticQuery } from "gatsby";

const Footer: FC = () => {
const data = useStaticQuery(graphql`
query GithubSiteVersion {
github {
repository(name: "geruso-site", owner: "vgeruso") {
releases(last: 1) {
edges {
node {
id
tag {
name
}
}
}
}
}
}
}
`);
const { year } = useYear();

const [version, setVersion] = useState<string>('');

useEffect(() => {
setVersion(data.github.repository.releases.edges[0].node.tag.name);
}, []);

return (
<ContainerDark>
<div className="centralize">
Expand All @@ -27,7 +52,7 @@ const Footer: FC = () => {
<p className="justify">
<a href="mailto:[email protected]">[email protected]</a>
</p>
<span className="justify">Created by Victor Geruso - {year}</span>
<span className="justify">Created by Victor Geruso - {year} - v{version}</span>
</div>
</ContainerDark>
);
Expand Down

0 comments on commit 2388b2e

Please sign in to comment.