diff --git a/src/app/faq/page.jsx b/src/app/faq/page.jsx index 48d57fa..1ba2aec 100644 --- a/src/app/faq/page.jsx +++ b/src/app/faq/page.jsx @@ -11,7 +11,7 @@ export default function FaqPage() {

A: PGP:

- 0FA334385D0B689F - available via WKD (gpg --locate-keys gpg@nexy7574.co.uk), or the full (armoured) key is available + 0FA334385D0B689F - available via WKD (gpg --locate-keys gpg@nexy7574.co.uk), or the full (armoured) key is available here. The key is also available on several keyservers, however Ubuntu's keyserver diff --git a/src/app/globals.css b/src/app/globals.css index 0690d1c..67ecf75 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -172,3 +172,12 @@ so I've had to resort to stealing (copying and pasting from their docs) font-size: 0.875rem; /* 14px */ line-height: 1.25rem; /* 20px */ } + +.icon-48 { + width: 48px; + height: 48px; +} +.icon-64 { + width: 64px; + height: 64px; +} diff --git a/src/app/page.jsx b/src/app/page.jsx index 783fe14..cb4ba77 100644 --- a/src/app/page.jsx +++ b/src/app/page.jsx @@ -1,5 +1,4 @@ import Image from "next/image"; -import Link from "next/link"; import styles from './page.module.css'; // Image imports @@ -42,9 +41,10 @@ const _88x31s = { "restartb": restartb, "tom1212": tom1212 }; +import FediPosts from "@/components/fediPosts"; function CustomIcon({src, name}) { - return {name} + return {name} } @@ -293,6 +293,9 @@ export default function Index() {


+

Recent fediverse Posts

+ +
{ Object.keys(_88x31s).map( diff --git a/src/components/fediPosts.css b/src/components/fediPosts.css new file mode 100644 index 0000000..69f0095 --- /dev/null +++ b/src/components/fediPosts.css @@ -0,0 +1,45 @@ +.note { + background-color: var(--background-secondary); + border: 1px solid var(--text-muted); + border-radius: 5px; + padding: .4em; + display: block +} + +.container { + display: grid; + grid-auto-columns: 1fr; + grid-auto-rows: 3fr; + border-radius: 5px; + overflow-y: auto; + max-height: 50vh; + grid-gap: 1em; +} + +.container a { + color: var(--text-primary); + text-decoration: none; +} + +.author { + display: flex; + align-items: center; + vertical-align: middle; + gap: 4px; +} + +.author img { + border-radius: 20%; + width: 48px; + height: 48px; +} + +.content { + text-align: left; +} + +.reactions, .reaction { + list-style: none; + text-align: left; + vertical-align: middle; +} diff --git a/src/components/fediPosts.jsx b/src/components/fediPosts.jsx new file mode 100644 index 0000000..f60aacc --- /dev/null +++ b/src/components/fediPosts.jsx @@ -0,0 +1,113 @@ +"use client"; + +import Image from "next/image"; +import { useEffect, useState } from "react"; +import styles from "./fediPosts.css" +import Link from "next/link"; + + +function FediPost({data}) { + if(data.reply) { + return null; + } + console.debug(data.reactionEmojis); + return ( + +
+
+
+ {data.user.username} +
+
+
{data.user.username}
+
+
+
{data.text}
+ +
+ + ) +} + + +export default function FediPosts() { + const [notes, setNotes] = useState([]); + + const getNotes = (_notes) => { + let payload = { + userId: "9w3ylp0gudtr0001", + limit: 100, + withReplies: false, + withRenotes: false, + }; + let lastNote = _notes[_notes.length - 1] || null; + if(lastNote) { + payload.untilId = lastNote.id; + } + fetch( + "https://fedi.transgender.ing/api/users/notes", + { + method: "POST", + body: JSON.stringify(payload), + headers: {"Content-Type": "application/json"} + } + ) + .then(res => res.json()).catch(console.error); + } + useEffect( + () => { + let payload = { + userId: "9w3ylp0gudtr0001", + limit: 100, + withReplies: false, + withRenotes: false, + withFiles: false, + }; + let lastNote = notes[notes.length - 1] || null; + if(lastNote) { + payload.untilId = lastNote.id; + } + fetch( + "https://fedi.transgender.ing/api/users/notes", + { + method: "POST", + body: JSON.stringify(payload), + headers: {"Content-Type": "application/json"} + } + ) + .then(res => res.json()) + .then((newNotes) => {setNotes([...notes, ...newNotes]);}) + }, + [] + ); + + if(!notes.length) { + return
Loading notes...
+ } + return ( +
+
{notes.map(note => )}
+ +
+ ) +} \ No newline at end of file diff --git a/src/components/siteNav.jsx b/src/components/siteNav.jsx index 09453f3..e0605bc 100644 --- a/src/components/siteNav.jsx +++ b/src/components/siteNav.jsx @@ -13,30 +13,30 @@ export default function Nav() { return (