Skip to content

Commit 6c77481

Browse files
committed
Added a footer for quick access to some data
1 parent 80bd450 commit 6c77481

7 files changed

Lines changed: 86 additions & 1 deletion

File tree

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const { execSync } = require("child_process");
2+
const fs = require("fs");
3+
const path = require("path");
4+
5+
try {
6+
const rawDate = execSync('git log -1 --format="%cd"').toString().trim();
7+
const date = new Date(rawDate);
8+
9+
// Format to 12-hour format with full date
10+
const formatted = new Intl.DateTimeFormat('en-US', {
11+
dateStyle: 'medium', // e.g., May 24, 2025
12+
timeStyle: 'short', // e.g., 9:05 PM
13+
hour12: true
14+
}).format(date);
15+
16+
const outputPath = path.join(__dirname, "public", "last-updated.txt");
17+
fs.writeFileSync(outputPath, formatted, "utf8");
18+
19+
console.log(`✅ Last updated written as: ${formatted}`);
20+
} catch (err) {
21+
console.error("❌ Failed to write last updated date:", err);
22+
}

docs/website/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8+
"prebuild": "node generate-last-updated.cjs",
89
"build": "tsc -b && vite build",
910
"lint": "eslint .",
1011
"preview": "vite preview"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
May 24, 2025, 6:37 PM

docs/website/src/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import ExtrasPage from "./pages/ExtrasPage.tsx";
1616
import VersionsPage from "./pages/VersionsPage.tsx";
1717
import { useState } from "react";
1818
import HomePage from "./pages/HomePage.tsx";
19+
import Footer from "./ui/Footer/Footer.tsx";
1920

2021
function App() {
2122
const [version,setVersion]=useState(1.59)
@@ -37,6 +38,7 @@ function App() {
3738
<Route path="*" element={<p className="page">Page Not Found</p>} />
3839
</Routes>
3940
</main>
41+
<Footer/>
4042
<Analytics />
4143
</>
4244
)

docs/website/src/assets/css/quick-styles.css

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,15 @@ span.code.green {
158158
span.code.yellow {
159159
color: #dfdf1a;
160160
}
161+
161162
span.code.yellow-shade {
162163
color: rgb(251, 225, 172);
163164
}
164165

165166
span.code.green-shade {
166167
color: #71f171;
167168
}
169+
168170
.opacity-0 {
169171
opacity: 0;
170172
}
@@ -177,4 +179,6 @@ span.code.green-shade {
177179
white-space: pre-line;
178180
}
179181

180-
.align-self-end {}
182+
.text-align-center {
183+
text-align: center;
184+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import { useEffect, useState } from 'react';
2+
import { Link } from 'react-router'
3+
import "./footer.css"
4+
/**
5+
* Footer component for the documentation website.
6+
* Displays last updated date and links to support the project.
7+
*
8+
* @returns {JSX.Element} The footer element.
9+
*/
10+
export default function Footer(): JSX.Element {
11+
const [date, setDate] = useState('');
12+
13+
useEffect(() => {
14+
fetch('/last-updated.txt')
15+
.then(res => res.text())
16+
.then(text => setDate(new Date(text).toLocaleString()));
17+
}, []);
18+
return (
19+
<footer className='flex fd-column justify-content-cen text-align-center footer'>
20+
{/* <h2 className='footer-title'>Laner Documentation</h2>
21+
<p className='footer-subtitle'>A comprehensive guide to using Laner</p> */}
22+
{/* <p>Made with ❤️ using <Link to='https://react.dev/'>React</Link> and <Link to='https://vitejs.dev/'>Vite</Link></p> */}
23+
{/* <p>Documentation hosted on <Link to='https://vercel.com/'>Vercel</Link></p> */}
24+
25+
<p>Thoroughly Tested and supported by <Link to='https://github.com/Fector101/laner'>Laner</Link> </p>
26+
<div className='support-links-box flex fd-column justify-content-cen text-align-center'>
27+
<p>Find this project helpful?</p>
28+
<p> consider buying me a <Link to='https://www.buymeacoffee.com/fector101' className="buy-me-a-coffee">Coffee ☕️</Link></p>
29+
<p> Or a star on 🌟<Link to='https://github.com/Fector101/android_notify'>GitHub.</Link></p>
30+
<p>Your support helps maintain and improve the project.</p>
31+
</div>
32+
<p>Last Updated: {date}, © 2023 Fector101</p>
33+
</footer>
34+
)
35+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
footer{
2+
padding: 2rem 15px;
3+
background-color: #171716;
4+
font-size: 13px;
5+
gap: 5px;
6+
color: white;
7+
}
8+
footer .support-links-box{
9+
align-self: center;
10+
gap: 5px;
11+
background-color: #b5d4b019;
12+
padding: 10px;
13+
border-radius: 5px;
14+
border-top-width: 1px;
15+
border-bottom-width: 1px;
16+
border-style: solid;
17+
border-color: rgb(70, 71, 71);
18+
width: max-content;
19+
max-width: 100%;
20+
}

0 commit comments

Comments
 (0)