when-free.openapps.xyz

Source

This app’s code and revision history are public. Download a copy or explore the files below.

Public
The app’s code and revision history are public.
Owned app · rev 2315d847681e
Run it yourself
Take the whole tree and run it on your own machine. The download needs no account. Cloning needs a sign-in.
Download .zip
bounded clone 3e1cb86700a5e96238d7a2f1
A copy you download is not bounded. The guarantees this app runs under - declared egress, proven invariants, writes that fail closed - live in the runtime serving this page, not in the files. What you get is auditable source you can read and run, with no runtime guarantees attached.
← All files
src/Home.tsx
// The landing page's live part: "Your polls" for returning organizers.
import { useMemo, useState } from "react";
import { navigate, usePath } from "./lib/router";
import { myPolls } from "./lib/polls";

export function YourPolls() {
  const path = usePath();
  // Read again whenever the landing comes back, so a poll made a moment ago is listed.
  const polls = useMemo(myPolls, [path]);
  const [all, setAll] = useState(false);
  if (!polls.length) return null;
  const shown = all ? polls : polls.slice(0, 4);
  return (
    <section className="your-polls" aria-labelledby="your-polls-title">
      <h2 className="your-title" id="your-polls-title">Your polls</h2>
      <ul className="your-list">
        {shown.map((p) => (
          <li key={p.id}>
            <a href={`/p/${p.id}`} onClick={(e) => { e.preventDefault(); navigate(`/p/${p.id}`); }}>
              <strong>{p.title || "Untitled poll"}</strong>
              <span>Made {new Date(p.at).toLocaleDateString(undefined, { month: "short", day: "numeric", year: "numeric" })}</span>
            </a>
          </li>
        ))}
      </ul>
      {polls.length > shown.length && <button className="link-btn" type="button" onClick={() => setAll(true)}>Show all {polls.length}</button>}
      <p className="hint">Listed on this device only. Open an admin link to add a poll here.</p>
    </section>
  );
}

Change history

Quality pass: comments, CSV export, share the final time, calendar menu, fixes
2315d84768 · 4 hours ago
Bounded source sync
145324066b · 1 day ago
Bounded source sync
ad9b674dac · 1 day ago
Bounded source sync
e5b69608f3 · 1 day ago
Bounded source sync
a1685914b0 · 1 day ago
Bounded source sync
7108f42d4d · 1 day ago
Bounded source sync
ffb51b672e · 1 day ago
Bounded source sync
23b5d0c53b · 1 day ago