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.
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.
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
Bounded source sync
Bounded source sync
Bounded source sync
Bounded source sync
Bounded source sync
Bounded source sync
Bounded source sync