From 0c8fa3a2a270747f3dbb54fe8792f3f0aec997e3 Mon Sep 17 00:00:00 2001 From: Ryan Schanzenbacher Date: Mon, 3 Aug 2026 01:22:44 -0400 Subject: Initial commit: combined darwin + guix-linux home-manager flake Supersedes nix-dotfiles (darwin) and guix-dotfiles' ad-hoc nix-home-manager flake (linux). See README.md/MIGRATION.md. --- .../lib/components/missives/missives.jsx | 40 ++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100755 users/ryan/modules/simple-bar/simple-bar-source/lib/components/missives/missives.jsx (limited to 'users/ryan/modules/simple-bar/simple-bar-source/lib/components/missives/missives.jsx') diff --git a/users/ryan/modules/simple-bar/simple-bar-source/lib/components/missives/missives.jsx b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/missives/missives.jsx new file mode 100755 index 0000000..3563937 --- /dev/null +++ b/users/ryan/modules/simple-bar/simple-bar-source/lib/components/missives/missives.jsx @@ -0,0 +1,40 @@ +import * as Uebersicht from "uebersicht"; +import { useSimpleBarContext } from "../simple-bar-context.jsx"; +import Missive from "./missive.jsx"; +import useServerSocket from "../../hooks/use-server-socket.js"; + +export { missivesStyles as styles } from "../../styles/components/missives"; + +const { React } = Uebersicht; + +/** + * Component to display a list of missives. + * It uses the simple-bar context to get settings and missives data. + * It also sets up a server socket to receive new missives. + * + * @returns {JSX.Element} The rendered component. + */ +export function Component() { + // Destructure settings, missives, and pushMissive function from the context + const { settings, missives, pushMissive } = useSimpleBarContext(); + const { enableServer } = settings.global; + + // Set up a server socket to listen for "missive" events and push new missives + useServerSocket("missive", enableServer, pushMissive); + + return ( +
+ {missives.map(({ id, side, content, timeout }) => { + return ( + + ); + })} +
+ ); +} -- cgit v1.3.1