Skip to content

Commit

Permalink
feat(dashboard): commit name on footer
Browse files Browse the repository at this point in the history
  • Loading branch information
EliotAmn committed Jan 21, 2025
1 parent 8fd3260 commit 1d796f4
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 25 deletions.
24 changes: 2 additions & 22 deletions web/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import SyncPage from "./pages/SyncPage";
import AuthPage from "./pages/AuthPage";
import FullError from "./comps/FullError";
import {vars} from "./api/api";
import Footer from "./comps/Footer";

function App() {

Expand Down Expand Up @@ -43,28 +44,7 @@ function App() {
</Routes>
</div>
<div>
<footer className={"bg-gray-800 text-white p-2"}>
<p className={"text-center"}>
Made with ❤️ by
<a
href="https://github.com/EliotAmn"
target="_blank"
rel="noopener noreferrer"
className={"no-underline text-inherit ml-1"}
>
Eliot
</a>
{" & "}
<a
href="https://justmael.me"
target="_blank"
rel="noopener noreferrer"
className={"no-underline text-inherit ml-1"}
>
Maël
</a>
</p>
</footer>
<Footer/>
</div>

</div>
Expand Down
44 changes: 44 additions & 0 deletions web/src/comps/Footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
import React from "react";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faCodeBranch, faTree, faXmarkCircle} from "@fortawesome/free-solid-svg-icons";
import GithubLogo from "../assets/githublogo.svg";

export default function Footer(): React.ReactElement {

const commit_hash = process.env.REACT_APP_COMMIT_HASH || "dev";

return <footer className={"flex flex-row justify-between bg-gray-800 text-white p-2"}>

<div className={"flex flex-row items-center text-gray-400 cursor-pointer gap-0.5"} onClick={() => {
window.open("https://github.com/EliotAmn/tekbetter-server", "_blank");
}}>
<FontAwesomeIcon icon={faCodeBranch}/>
<p>
{commit_hash}
</p>

</div>


<p className={"text-center"}>
Made with ❤️ by
<a
href="https://github.com/EliotAmn"
target="_blank"
rel="noopener noreferrer"
className={"no-underline text-inherit ml-1"}
>
Eliot
</a>
{" & "}
<a
href="https://justmael.me"
target="_blank"
rel="noopener noreferrer"
className={"no-underline text-inherit ml-1"}
>
Maël
</a>
</p>
</footer>
}
3 changes: 1 addition & 2 deletions web/src/comps/TopBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ import {getSyncStatus} from "../api/global.api";
function NavElement(props: { text: string, icon: any, link: string }) {
const navigate = useNavigate();
const is_active = window.location.pathname.startsWith(props.link);
const commit_hash = process.env.REACT_APP_COMMIT_HASH || "dev";
console.log(commit_hash)

return (
<div
className={"flex items-center text-white cursor-pointer px-5 h-full hover:bg-blue-900 transition " + (is_active ? "bg-blue-900" : "")}
Expand Down
1 change: 0 additions & 1 deletion web/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import {BrowserRouter} from "react-router-dom";
ReactDOM.render(
<React.StrictMode>
<BrowserRouter>

<App/>
</BrowserRouter>
</React.StrictMode>,
Expand Down

0 comments on commit 1d796f4

Please sign in to comment.