From d2a1643f00697eccf3993a69c6f6acb171519529 Mon Sep 17 00:00:00 2001
From: Linden <65407488+thelindat@users.noreply.github.com>
Date: Wed, 22 Jan 2025 01:36:38 +1100
Subject: [PATCH] update our team
---
components/DisplayMembers.tsx | 65 +++++++++++++++++++++++++++++++++++
components/DonateLink.tsx | 18 ----------
components/MemberLink.tsx | 24 +++++++++++++
pages/_meta.json | 4 +--
pages/index.mdx | 19 +++++-----
5 files changed, 99 insertions(+), 31 deletions(-)
create mode 100644 components/DisplayMembers.tsx
delete mode 100644 components/DonateLink.tsx
create mode 100644 components/MemberLink.tsx
diff --git a/components/DisplayMembers.tsx b/components/DisplayMembers.tsx
new file mode 100644
index 0000000000..494a7d3278
--- /dev/null
+++ b/components/DisplayMembers.tsx
@@ -0,0 +1,65 @@
+import { useState, useEffect } from 'react'
+import MemberLink from './MemberLink';
+
+interface GithubMember {
+ login: string;
+ avatar_url: string;
+}
+
+interface MemberData {
+ data: GithubMember[];
+ etag: string | null;
+ timestamp: number;
+}
+
+const cacheKey = 'overextendedMembers';
+const cacheExpiry = 24 * 60 * 60 * 1000;
+
+const sponsor = {
+ thelindat: `thelindat`,
+ LukeWasTakenn: `lukewastaken`,
+ DokaDoka: `dokadoka`,
+}
+
+async function FetchMembers() {
+ const raw = localStorage.getItem(cacheKey);
+ const members: MemberData = raw ? JSON.parse(raw) : {};
+ const isCacheExpired = members.timestamp ? new Date().getTime() - members.timestamp > cacheExpiry : true;
+
+ if (!isCacheExpired) return members;
+
+ const headers = {}
+
+ if (members.etag) headers['If-None-Match'] = members.etag;
+
+ const response = await fetch(`https://api.github.com/orgs/overextended/members`, {
+ headers: headers
+ })
+
+ if (response.status === 304) return members;
+
+ members.data = await response.json();
+ members.etag = response.headers.get('ETag');
+ members.timestamp = new Date().getTime();
+
+ localStorage.setItem(cacheKey, JSON.stringify(members));
+ console.log(`fetched data and set cache (etag ${members.etag})`, members.timestamp)
+
+ return members;
+}
+
+const DisplayMembers = () => {
+ const [members, setMembers] = useState(null);
+
+ useEffect(() => {
+ (async() => setMembers(await FetchMembers()))()
+ }, [])
+
+ //@ts-ignore ???
+ return (members?.data ?
+ {members.data
+ .map((member) => MemberLink({ image: member.avatar_url, name: member.name ?? member.login, sponsor: sponsor[member.login] }))}
+
: "")
+};
+
+export default DisplayMembers;
diff --git a/components/DonateLink.tsx b/components/DonateLink.tsx
deleted file mode 100644
index ad12fb6b2d..0000000000
--- a/components/DonateLink.tsx
+++ /dev/null
@@ -1,18 +0,0 @@
-import { IconCoffee } from '@tabler/icons-react';
-
-const DonateLink: React.FC<{ image: string; name: string; kofiName: string }> = ({ image, name, kofiName }) => {
- return (
-
- );
-};
-
-export default DonateLink;
diff --git a/components/MemberLink.tsx b/components/MemberLink.tsx
new file mode 100644
index 0000000000..5fc2cb933e
--- /dev/null
+++ b/components/MemberLink.tsx
@@ -0,0 +1,24 @@
+import { IconCoffee } from '@tabler/icons-react';
+
+const MemberLink: React.FC<{ image: string; name: string; sponsor?: string }> = ({ image, name, sponsor }) => {
+ return (
+
+ );
+};
+
+
+export default MemberLink;
diff --git a/pages/_meta.json b/pages/_meta.json
index 623de99577..d67308498b 100644
--- a/pages/_meta.json
+++ b/pages/_meta.json
@@ -11,11 +11,11 @@
"creator_codes": {
"title": "Creator codes",
"type": "page",
- "href": "https://overextended.dev/#creator-codes"
+ "href": "/#creator-codes"
},
"support": {
"title": "Support us",
"type": "page",
- "href": "https://overextended.dev/#support-our-team"
+ "href": "/#support-our-team"
}
}
diff --git a/pages/index.mdx b/pages/index.mdx
index 8f20ef84cf..24b74da037 100644
--- a/pages/index.mdx
+++ b/pages/index.mdx
@@ -2,27 +2,24 @@
title: Introduction
---
-import DonateLink from '@components/DonateLink';
+import DisplayMembers from '@components/DisplayMembers';
import CreatorCode from '@components/CreatorCode';
import CreatorCodes from '@components/CreatorCodes';
# Introduction
-Here you can find all of the official documentation for resources developed by the Overextended team.
+Overextended is a small group working to create open-source resources for FiveM, with a focus on quality, security, performance and stability.
+You can find all of the official documentation for resources developed by the Overextended team on this website.
-If you feel like the documentation is lacking in some department then feel free to go onto that page and click the "Edit this page" at the bottom and submit a Pull Request.
+If you feel like our documentation is lacking, please leat us know or suggest improvements by using the links in the sidebar.
-## Support our team
+## Our team
-We enjoy being able to create and share _free and open-source_ work, but they often require considerable time and effort to maintain and support.
+We're a small team made up of both hobby and professional programmers. We enjoy being able to create and share [free and open-source](https://opensource.org/osd) resources, but it can often require considerable time and investment to maintain and support them.
-If you frequently use our resources and love what we do, consider supporting us so we can continue our work.
+Our team members volunteer to help keep things running smoothly; feel free to check out their work or show your appreciation by supporting them below.
-
-
-
-
-
+
## Fivemanage